You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Offending bnf.y grammar excerpt where @action after the @0 IS NOT expanded into proper JavaScript code like it should:
handle_action
: handle prec action
{
$$ = [($handle.length ? $handle.join(' ') : '')];
if ($action) {
var rv = checkActionBlock($action, @action);
if (rv) {
yyerror(rmCommonWS`
production rule action code block does not compile: ${rv}
Erroneous area:
${yylexer.prettyPrintRange(@action, @handle)}
`);
}
$$.push($action);
}
if ($prec) {
if ($handle.length === 0) {
yyerror(rmCommonWS`
You cannot specify a precedence override for an epsilon (a.k.a. empty) rule!
Erroneous area:
${yylexer.prettyPrintRange(@handle, @0 /* @handle is very probably NULL! We need this one for some decent location info! */, @action /* ditto! */)}
`);
}
$$.push($prec);
}
if ($$.length === 1) {
$$ = $$[0];
}
}
Removing the comment immediately following @0 fixes the problem.
This must be a problem with my code rewriter logic in there; it's still regex-based and apparently goes bonkers when you mix comments with ES6 string templates. Grmbl. I was planning to migrate to using recast AST rewriting already, but that will take some effort / time that is in short supply. :-(
The text was updated successfully, but these errors were encountered:
(which currently still uses regexes for code manipulation instead of esprima+recast AST rewriting) :: action code in grammar doesn't expand `@label` ref inside template string with comments
Offending bnf.y grammar excerpt where
@action
after the@0
IS NOT expanded into proper JavaScript code like it should:Removing the comment immediately following
@0
fixes the problem.This must be a problem with my code rewriter logic in there; it's still regex-based and apparently goes bonkers when you mix comments with ES6 string templates. Grmbl. I was planning to migrate to using recast AST rewriting already, but that will take some effort / time that is in short supply. :-(
The text was updated successfully, but these errors were encountered: