help with macro
Created by: jlongster
I doubt this is a bug, but I'd like some help. I'm writing a macro that iterates through statements and will do stuff to them; for now, I'm just trying to get it to iterate through the statements.
macro _unroll {
case ($stmt $rest ...) => {
$stmt
_unroll($rest ...)
}
case () => {
}
}
macro async {
case { $stmt ... } => {
_unroll($stmt ...)
}
}
async {
var x = 5;
var y = 5;
}
This throws an error though:
/usr/local/lib/node_modules/sweet.js/lib/parser.js:3117
throw e$320;
^
Error: Line 112: Unexpected token ;
at throwError (/usr/local/lib/node_modules/sweet.js/lib/parser.js:984:24)
at throwUnexpected (/usr/local/lib/node_modules/sweet.js/lib/parser.js:1033:9)
at expect (/usr/local/lib/node_modules/sweet.js/lib/parser.js:1038:13)
at parsePrimaryExpression (/usr/local/lib/node_modules/sweet.js/lib/parser.js:1264:13)
at parseLeftHandSideExpressionAllowCall (/usr/local/lib/node_modules/sweet.js/lib/parser.js:1382:56)
at parsePostfixExpression (/usr/local/lib/node_modules/sweet.js/lib/parser.js:1414:24)
at parseUnaryExpression (/usr/local/lib/node_modules/sweet.js/lib/parser.js:1469:16)
at parseMultiplicativeExpression (/usr/local/lib/node_modules/sweet.js/lib/parser.js:1472:24)
at parseAdditiveExpression (/usr/local/lib/node_modules/sweet.js/lib/parser.js:1484:24)
at parseShiftExpression (/usr/local/lib/node_modules/sweet.js/lib/parser.js:1496:24)
What am I doing wrong?