Skip to content

Commit

Permalink
add unit test to ensure esprima+recast WILL NOT fail GerHobbelt/jison#30
Browse files Browse the repository at this point in the history
 (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
  • Loading branch information
GerHobbelt committed Nov 10, 2017
1 parent 1337234 commit 4166f67
Show file tree
Hide file tree
Showing 2 changed files with 1,325 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/fixtures/jison-actions/jison_0016.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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);
}
Loading

0 comments on commit 4166f67

Please sign in to comment.