codegen and dropped the useless walker

This commit is contained in:
Mihai Bazon
2012-08-16 18:11:04 +03:00
parent c0ba9e2986
commit 7f273c3b89
4 changed files with 450 additions and 298 deletions

View File

@@ -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()
});
}