generate: Add option token to lexer

This commit is contained in:
2025-10-15 18:16:49 -04:00
parent 50ca98f3c6
commit 17201a4c48
2 changed files with 13 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ func TestLex(test *testing.T) {
// wow
0001 Users []User,
0002 Followers U32,
0003 Wings ?Int,
}`))
if err != nil { test.Fatal(parse.Format(err)) }
@@ -42,6 +43,11 @@ func TestLex(test *testing.T) {
tok(TokenIdent, "Followers"),
tok(TokenIdent, "U32"),
tok(TokenComma, ","),
tok(TokenKey, "0003"),
tok(TokenIdent, "Wings"),
tok(TokenOption, "?"),
tok(TokenIdent, "Int"),
tok(TokenComma, ","),
tok(TokenRBrace, "}"),
tok(parse.EOF, ""),
}