PeggerRelease Notes


Bigger and badder enhancements.


  • New: Added Peg.find(), Peg.replace(), Peg.replaceAll(), Peg.replaceAllFn(), and Peg.searchAll().
  • New: Added Match.snippet(), Match.location(), Match.lineNum(), and Match.findMatch().
  • New: Added Start-of-Stream \sos and Start-of-Line \sol macro rules.
  • New: Added \pass and \fail macro rules.
  • New: nTimes RepetitionRule now has its own {x} syntax.
  • New: Pegger now runs in Javascript!
  • Chg: \eol macro no longer matches characters - breaking change!.
  • Chg: Allowed RuleRefs to be more independent with regards to labels and inclusion in match results.
  • Chg: Added system hook that lets PegParseErrs be converted to custom Errs (added for AFX).
  • Bug: Grammars did not error when defining multiple definitions with the same name.
  • Bug: CharRule now accepts escaped unicode ranges.


  • New: afPegger is now packaged as a SkySpark extension.
  • Chg: now takes an optional label.
  • Chg: Changed the dump() API to be more consistent with AFX.


  • New: New dump macro for debugging: \dump(HELLO).
  • Chg: RepetitionRule now checks for \eos to avoid getting stuck in an infinite loop (a common trap for new players).
  • Chg: no-op macro may pass or fail: \noop(fail).
  • Chg: Reworked internals to better distinguish between grammar definitions and rules.
  • Chg: Documentation tweaks.
  • Bug: Identity crisis! Simple proxy rules could overwrite rule names and unwanted labels could be inherited.


  • New: Added ranges to multiplicity expressions in PEG grammar, e.g. rule{2,6}
  • Chg: Ensured rule expressions are properly escaped (more edge cases tested).


  • New: Rules may be spread across multiple lines.
  • New: Rules may be excluded from results, and omitted from debug logging.
  • New: Comments may be placed inside rules, inbetween rules, and after rules.
  • New: Introduced operator precendence between firstOf / sequence rules.
  • Chg: Logging is much cleaner and understandable.
  • Chg: Removed action functions on Rules - they were too ambiguous - tree walking is far better.
  • Chg: Added brief description of PEG notation to docs.
  • Chg: Exposed Rule API so you may created your own Rule classes.


An entire re-write into something awesome!


  • New: Re-written in to a leaner, meaner, and way more expressive PEG parser!



  • New: Added checked param to Parser.parse() methods.


  • New: TreeRules and support classes for generic parsing of tree structures.
  • New: Rules.eos() for detecting End-Of-Stream.
  • New: Added Rules.oneOf()
  • New: An action ctx is passed into the action success funcs.


  • New: Rules.doAction() and Rules.anySpaceChars().


  • New: Preview release.