I forgot comments existed haha

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

View File

@ -34,8 +34,8 @@ func TestLexer (test *testing.T) {
testString(test,
`
normalIdent TypeIdent
[$$abcdEfGhIjKlMnOpQrStUvWxYz]{+}(-)
~ ! @ # $ % ^ & *- _ = + \ | ; :** ::, < . > / ?
[$$abcdEfGhIjKlMnOpQrStUvWxYz]{+}(-) ; this is a comment
~ ! @ # $ % ^ & *- _ = + \ | :** ::, < . > / ?
!! ++ -- && || 'some \'string' 'nullterm\0' '\110\117\115\105'
1234 -1234 9876540321 (754.2340)
`,
@ -67,7 +67,6 @@ tok(Symbol, "="),
tok(Symbol, "+"),
tok(Symbol, "\\"),
tok(Symbol, "|"),
tok(Symbol, ";"),
tok(Colon, ":"),
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) {
test.Logf("%-40v | %-40v", left, right)
}
dumpToken := func (token lexer.Token) string {
return fmt.Sprintf("%4v: \"%s\"", token.Type, token.Value)
}
compareTokens := func () {
length := len(tokens)
if len(correct) > length { length = len(correct) }