more cleanup (dropped AST_SwitchBlock)

This commit is contained in:
Mihai Bazon
2012-10-03 15:52:01 +03:00
parent 3412498795
commit 11863d6f9a
6 changed files with 8 additions and 20 deletions

View File

@@ -867,7 +867,7 @@ function parse($TEXT, options) {
case "switch":
return new AST_Switch({
expression : parenthesised(),
body : switch_block_()
body : switch_body_()
});
case "throw":
@@ -1034,7 +1034,7 @@ function parse($TEXT, options) {
return a;
};
var switch_block_ = embed_tokens(curry(in_loop, function(){
var switch_body_ = curry(in_loop, function(){
expect("{");
var a = [], cur = null, branch = null, start = S.token;
while (!is("punc", "}")) {
@@ -1065,14 +1065,9 @@ function parse($TEXT, options) {
}
}
if (branch) branch.end = prev();
var end = S.token;
next();
return new AST_SwitchBlock({
start : start,
body : a,
end : end
});
}));
return a;
});
function try_() {
var body = block_(), bcatch = null, bfinally = null;