Last active
November 16, 2018 21:17
-
-
Save sfpgmr/18a371b3579915113e54b9a0b2ddeb25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ ForToken __ | |
"(" & __ | |
init:(ExpressionNoIn __ )? ";" __ | |
test:(Expression __)? ";" __ | |
update:(Expression __)? | |
")" __ | |
body:Statement | |
{ | |
/*scope.pop();*/ | |
return { | |
nodeType: "ForStatement", | |
init: extractOptional(init, 0), | |
test: extractOptional(test, 0), | |
update: extractOptional(update, 0), | |
body: body | |
}; | |
} | |
/ ForToken __ | |
"(" & __ | |
declarations:VariableDecl __ ";" __ | |
test:(Expression __)? ";" __ | |
update:(Expression __)? | |
")" __ | |
body:Statement | |
{ | |
/*scope.pop();*/ | |
return { | |
nodeType: "ForStatement", | |
init: { | |
nodeType: "VariableDeclaration", | |
declarations: declarations, | |
kind: "var" | |
}, | |
test: extractOptional(test, 0), | |
update: extractOptional(update, 0), | |
body: body | |
}; | |
} | |
/ ForToken __ | |
"(" __ | |
left:LeftHandSideExpression __ | |
InToken __ | |
right:Expression __ | |
")" __ | |
body:Statement | |
{ | |
/*scope.pop();*/ | |
return { | |
nodeType: "ForInStatement", | |
left: left, | |
right: right, | |
body: body | |
}; | |
} | |
/ ForToken __ | |
"(" __ | |
declarations:VariableDecl __ | |
InToken __ | |
right:Expression __ | |
")" __ | |
body:Statement | |
{ | |
/*scope.pop();*/ | |
return { | |
nodeType: "ForInStatement", | |
left: { | |
nodeType: "VariableDeclaration", | |
declarations: declarations, | |
kind: "var" | |
}, | |
right: right, | |
body: body | |
}; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment