From e5ed6e13a4adbbe61317194af36c33c82b33c90f Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 25 Mar 2018 01:50:10 +0100 Subject: lost chapter --- lexer/lexer_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lexer') 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, ""}, } -- cgit v1.2.3