chore: implement escaping character node

This commit is contained in:
Steven
2023-12-16 11:47:29 +08:00
parent 1237643028
commit e43a445c34
10 changed files with 132 additions and 0 deletions

View File

@ -17,6 +17,7 @@ const (
PlusSign TokenType = "+"
Dot TokenType = "."
GreaterThan TokenType = ">"
Backslash TokenType = "\\"
Newline TokenType = "\n"
Space TokenType = " "
)
@ -70,6 +71,8 @@ func Tokenize(text string) []*Token {
tokens = append(tokens, NewToken(PlusSign, "+"))
case '.':
tokens = append(tokens, NewToken(Dot, "."))
case '\\':
tokens = append(tokens, NewToken(Backslash, `\`))
case '\n':
tokens = append(tokens, NewToken(Newline, "\n"))
case ' ':