aboutsummaryrefslogtreecommitdiff
path: root/lib/parse.js
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-08-16 18:11:04 +0300
committerMihai Bazon <mihai@bazon.net>2012-08-16 18:11:04 +0300
commit7f273c3b89352c6fda528dfee17776cffcfe1fb4 (patch)
treec140b56c5224e1f186a75ab22310b660a4fb7220 /lib/parse.js
parentc0ba9e29861ab08ad8a5131705f421e96d634f4b (diff)
downloadtracifyjs-7f273c3b89352c6fda528dfee17776cffcfe1fb4.tar.gz
tracifyjs-7f273c3b89352c6fda528dfee17776cffcfe1fb4.zip
codegen and dropped the useless walker
Diffstat (limited to 'lib/parse.js')
-rw-r--r--lib/parse.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/parse.js b/lib/parse.js
index 2cd160fa..fdf44ce3 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -833,15 +833,12 @@ function parse($TEXT, exigent_mode) {
expect(":");
S.labels.push(label);
var start = S.token, stat = statement();
- if (exigent_mode && !(stat instanceof AST_LabeledStatement))
- unexpected(start);
S.labels.pop();
- stat.label = label;
- return stat;
+ return new AST_LabeledStatement({ statement: stat });
};
function simple_statement() {
- return new AST_Statement({ body: prog1(expression, semicolon) });
+ return new AST_SimpleStatement({ body: prog1(expression, semicolon) });
};
function break_cont(type) {
@@ -1024,7 +1021,11 @@ function parse($TEXT, exigent_mode) {
next();
bfinally = new AST_Finally({
start : start,
- body : block_(),
+ body : new AST_Bracketed({
+ start : S.token,
+ body : block_(),
+ end : prev()
+ }),
end : prev()
});
}