feat: implement auto link parser

This commit is contained in:
Steven
2023-12-27 08:44:51 +08:00
parent 6fac116d8c
commit c8d7f93dca
14 changed files with 418 additions and 179 deletions

View File

@ -16,6 +16,7 @@ const (
Hyphen TokenType = "-"
PlusSign TokenType = "+"
Dot TokenType = "."
LessThan TokenType = "<"
GreaterThan TokenType = ">"
Backslash TokenType = "\\"
Newline TokenType = "\n"
@ -65,6 +66,8 @@ func Tokenize(text string) []*Token {
tokens = append(tokens, NewToken(Tilde, "~"))
case '-':
tokens = append(tokens, NewToken(Hyphen, "-"))
case '<':
tokens = append(tokens, NewToken(LessThan, "<"))
case '>':
tokens = append(tokens, NewToken(GreaterThan, ">"))
case '+':