From c91fcd12cc7fb8c16743e634ced079955ffb81cb Mon Sep 17 00:00:00 2001 From: Bob Nystrom Date: Wed, 4 Dec 2013 19:12:21 -0800 Subject: [PATCH] Treat ";" like newlines. --- src/wren_compiler.c | 1 + test/semicolon.wren | 1 + 2 files changed, 2 insertions(+) create mode 100644 test/semicolon.wren diff --git a/src/wren_compiler.c b/src/wren_compiler.c index 9a29ff89..aa7e8a88 100644 --- a/src/wren_compiler.c +++ b/src/wren_compiler.c @@ -476,6 +476,7 @@ static void readRawToken(Parser* parser) case ']': makeToken(parser, TOKEN_RIGHT_BRACKET); return; case '{': makeToken(parser, TOKEN_LEFT_BRACE); return; case '}': makeToken(parser, TOKEN_RIGHT_BRACE); return; + case ';': makeToken(parser, TOKEN_LINE); return; case ':': makeToken(parser, TOKEN_COLON); return; case '.': makeToken(parser, TOKEN_DOT); return; case ',': makeToken(parser, TOKEN_COMMA); return; diff --git a/test/semicolon.wren b/test/semicolon.wren new file mode 100644 index 00000000..f0909200 --- /dev/null +++ b/test/semicolon.wren @@ -0,0 +1 @@ +var a = "ok"; io.write(a) // expect: ok