more cleanup (dropped AST_SwitchBlock)
This commit is contained in:
13
lib/parse.js
13
lib/parse.js
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user