aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAnthony Van de Gejuchte <anthonyvdgent@gmail.com>2015-12-17 23:02:35 +0100
committerAnthony Van de Gejuchte <anthonyvdgent@gmail.com>2015-12-17 23:02:35 +0100
commitbd99b004137961b3b604fcd55602835bf6ffc522 (patch)
tree128f19c3c0f5335a696477a8291dbe30a8106b82 /lib
parent9e2f9f7910fa1a51a12ce51a1711601ad6587089 (diff)
downloadtracifyjs-bd99b004137961b3b604fcd55602835bf6ffc522.tar.gz
tracifyjs-bd99b004137961b3b604fcd55602835bf6ffc522.zip
Semicolon after do...while statement is optional
Diffstat (limited to 'lib')
-rw-r--r--lib/parse.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/parse.js b/lib/parse.js
index de27d987..4d06ae05 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -724,9 +724,9 @@ function parse($TEXT, options) {
);
};
- function semicolon() {
+ function semicolon(optional) {
if (is("punc", ";")) next();
- else if (!can_insert_semicolon()) unexpected();
+ else if (!optional && !can_insert_semicolon()) unexpected();
};
function parenthesised() {
@@ -814,7 +814,7 @@ function parse($TEXT, options) {
case "do":
return new AST_Do({
body : in_loop(statement),
- condition : (expect_token("keyword", "while"), tmp = parenthesised(), semicolon(), tmp)
+ condition : (expect_token("keyword", "while"), tmp = parenthesised(), semicolon(true), tmp)
});
case "while":