peggyjs / peggy

Peggy: Parser generator for JavaScript

Home Page:https://peggyjs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation example for 'Negative assertion' gives an error in Playground

matias-lg opened this issue · comments

The example rule for a negative assertion gives an error when trying it in the playground:
image

The example rule is:

negPredicate = $[0-9]+ !{ return parseInt(match, 10) < 100 }

pasting it in the playground warns match is not defined instead of parsing.

solution:
Change the example for negPredicate = match:$[0-9]+ !{ return parseInt(match, 10) < 100 }