pegjs/examples
David Majda 86769a6c5c Error handling: Make |?| return |null| on unsuccessful match
Before this commit, the |?| operator returned an empty string upon
unsuccessful match. This commit changes the returned value to |null|. It
also updates the PEG.js grammar and the example grammars, which used the
value returned by |?| quite often.

Returning |null| is possible because it no longer indicates a match
failure.

I expect that this change will simplify many real-world grammars, as an
empty string is almost never desirable as a return value (except some
lexer-level rules) and it is often translated into |null| or some other
value in action code.

Implements part of #198.
2013-12-01 16:12:35 +01:00
..
arithmetics.pegjs Text nodes: Use text nodes in examples/arithmetics.pegjs 2012-12-02 17:25:52 +01:00
css.pegjs Error handling: Make |?| return |null| on unsuccessful match 2013-12-01 16:12:35 +01:00
javascript.pegjs Error handling: Make |?| return |null| on unsuccessful match 2013-12-01 16:12:35 +01:00
json.pegjs Error handling: Use a special value (not |null|) to indicate failure 2013-12-01 16:08:55 +01:00