peggyjs / peggy

Peggy: Parser generator for JavaScript
https://peggyjs.org/
MIT License
914 stars 65 forks source link

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

Closed matias-lg closed 7 months ago

matias-lg commented 1 year ago

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 }