parser: add initial Parser emitting non-whitespace tokens

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-08-31 00:11:33 +00:00
parent a15deb7e42
commit 1090a374f0
7 changed files with 252 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
package parser
import (
"asciigoat.org/core/lexer"
)
var (
// IsNewLine tells if the rune indicates a line break or the start of one
IsNewLine = lexer.NewIsIn("\r\n")
// IsNotNewLine tells if the rune is not a line break nor the start of one
IsNotNewLine = lexer.NewIsNot(IsNewLine)
// IsSpace tells if the rune is considered whitespace by Unicode
IsSpace = lexer.IsSpace
// IsNotSpace tells if the rune is not considered whitespace by Unicode
IsNotSpace = lexer.NewIsNot(IsSpace)
)