parser: introduce GetPositionalLength()

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-09-03 17:41:51 +00:00
parent 01cd4139bd
commit 8cc75da138
2 changed files with 43 additions and 0 deletions
+5
View File
@@ -43,6 +43,11 @@ var (
IsCommentStart = lexer.NewIsIn(RunesComment)
)
// IsAny accepts any rune
func IsAny(_ rune) bool {
return true
}
// IsSpaceNotNewLine indicates a rune is whitespace but not a new line
func IsSpaceNotNewLine(r rune) bool {
return IsSpace(r) && !IsNewLine(r)