aboutsummaryrefslogtreecommitdiff
path: root/lexer
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-03-25 01:50:10 +0100
committerDimitri Sokolyuk <demon@dim13.org>2018-03-25 01:50:10 +0100
commite5ed6e13a4adbbe61317194af36c33c82b33c90f (patch)
tree790b5c954959ac852f0072f8bb2bd3137a4dac48 /lexer
parent88efa3eb20001d1dc23e6b5a8413ea7adf10294e (diff)
lost chapter
Diffstat (limited to 'lexer')
-rw-r--r--lexer/lexer_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/lexer/lexer_test.go b/lexer/lexer_test.go
index e4e64a4..f63d7c3 100644
--- a/lexer/lexer_test.go
+++ b/lexer/lexer_test.go
@@ -30,6 +30,7 @@ if (5 < 10) {
"foo bar"
[1, 2];
{"foo": "bar"}
+macro(x, y) { x + y; };
`
tests := []struct {
@@ -122,6 +123,19 @@ if (5 < 10) {
{token.COLON, ":"},
{token.STRING, "bar"},
{token.RBRACE, "}"},
+ {token.MACRO, "macro"},
+ {token.LPAREN, "("},
+ {token.IDENT, "x"},
+ {token.COMMA, ","},
+ {token.IDENT, "y"},
+ {token.RPAREN, ")"},
+ {token.LBRACE, "{"},
+ {token.IDENT, "x"},
+ {token.PLUS, "+"},
+ {token.IDENT, "y"},
+ {token.SEMICOLON, ";"},
+ {token.RBRACE, "}"},
+ {token.SEMICOLON, ";"},
{token.EOF, ""},
}