Skip to content

Instantly share code, notes, and snippets.

@pvdz
Created June 11, 2014 00:05
Show Gist options
  • Save pvdz/51ef6936eef0dc87a19d to your computer and use it in GitHub Desktop.
Save pvdz/51ef6936eef0dc87a19d to your computer and use it in GitHub Desktop.
function this_par_parseCatch(inFunction, inLoop, inSwitch, labelSet){
if (this_tok_nextPuncIfString('catch')) {
var type = this_tok_mustBeNum(0x28, false);
if (type === 13) {
if (this_par_isReservedIdentifier(false)) this_tok_throwSyntaxError('Catch scope var name is reserved');
this_tok_next(false);
} else {
this_tok_throwSyntaxError('Missing catch scope variable');
}
this_tok_mustBeNum(0x29, false);
this_par_parseCompleteBlock(true, inFunction, inLoop, inSwitch, labelSet);
}
}
function this_par_parseCatch(inFunction, inLoop, inSwitch, labelSet){
var step = 1;
var v5, v4, v3, v2, v1, v0;
var f5, f4, f3, f2, f1, f0;
return function(){
while (true) {
switch (step) {
case 1:
v0 = (f0 = f0 || this_tok_nextPuncIfString('catch'))();
if (yielding) return;
case 2: step = 2;
if (v0)step = 3;
else step = 4;
continue;
case 3: step = 3;
v1 = (f1 = f1 || this_tok_mustBeNum(0x28, false))();
if (yielding) return;
case 6: step = 6;
var type = v1;
if (type === 13)step = 7;
else step = 8;
continue;
case 7: step = 7;
v2 = (f2 = f2 || this_par_isReservedIdentifier(false))();
if (yielding) return;
case 10: step = 10;
if (v2)step = 11;
else step = 12;
continue;
case 11: step = 11;
v3 = (f3 = f3 || this_tok_throwSyntaxError('Catch scope var name is reserved'))();
if (yielding) return;
case 14: step = 14;
;
//step = 12;
//continue;
case 12: step = 12;
this_tok_next(false);
step = 9;
continue;
case 8: step = 8;
v4 = (f4 = f4 || this_tok_throwSyntaxError('Missing catch scope variable'))();
if (yielding) return;
case 15: step = 15;
;
//step = 9;
//continue;
case 9: step = 9;
this_tok_mustBeNum(0x29, false);
v5 = (f5 = f5 || this_par_parseCompleteBlock(true, inFunction, inLoop, inSwitch, labelSet))();
if (yielding) return;
case 16: step = 16;
;
//step = 4;
//continue;
case 4: step = 4;
}
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment