I forgot comments existed haha

This commit is contained in:
Sasha Koshka 2024-01-25 08:26:02 +00:00
parent 699cd88000
commit 5b5c66d409
2 changed files with 6 additions and 7 deletions

View File

@ -34,8 +34,8 @@ func TestLexer (test *testing.T) {
testString(test, testString(test,
` `
normalIdent TypeIdent normalIdent TypeIdent
[$$abcdEfGhIjKlMnOpQrStUvWxYz]{+}(-) [$$abcdEfGhIjKlMnOpQrStUvWxYz]{+}(-) ; this is a comment
~ ! @ # $ % ^ & *- _ = + \ | ; :** ::, < . > / ? ~ ! @ # $ % ^ & *- _ = + \ | :** ::, < . > / ?
!! ++ -- && || 'some \'string' 'nullterm\0' '\110\117\115\105' !! ++ -- && || 'some \'string' 'nullterm\0' '\110\117\115\105'
1234 -1234 9876540321 (754.2340) 1234 -1234 9876540321 (754.2340)
`, `,
@ -67,7 +67,6 @@ tok(Symbol, "="),
tok(Symbol, "+"), tok(Symbol, "+"),
tok(Symbol, "\\"), tok(Symbol, "\\"),
tok(Symbol, "|"), tok(Symbol, "|"),
tok(Symbol, ";"),
tok(Colon, ":"), tok(Colon, ":"),
tok(Star, "*"), tok(Star, "*"),
tok(Star, "*"), tok(Star, "*"),

View File

@ -74,14 +74,14 @@ func testStringErr (
} }
} }
dumpToken := func (token lexer.Token) string {
return fmt.Sprintf("%4v: \"%s\"", token.Type, token.Value)
}
printColumns := func (left, right string) { printColumns := func (left, right string) {
test.Logf("%-40v | %-40v", left, right) test.Logf("%-40v | %-40v", left, right)
} }
dumpToken := func (token lexer.Token) string {
return fmt.Sprintf("%4v: \"%s\"", token.Type, token.Value)
}
compareTokens := func () { compareTokens := func () {
length := len(tokens) length := len(tokens)
if len(correct) > length { length = len(correct) } if len(correct) > length { length = len(correct) }