Commit graph

5 commits

Author SHA1 Message Date
David Majda d3d4ace153 Move options handling from passes to |PEG.compiler.compile|
This eliminates some duplicate code.
2013-01-06 10:32:52 +01:00
David Majda 5942988f66 Remove the |startRule| property from the AST
It's redundant.
2013-01-06 10:21:48 +01:00
David Majda 3981433984 Fix too eager proxy rules removal
Fixes GH-137.
2013-01-06 10:17:10 +01:00
David Majda 5e146fce38 Text nodes: Implement text nodes
Implement a new syntax to extract matched strings from expressions. For
example, instead of:

  identifier = first:[a-zA-Z_] rest:[a-zA-Z0-9_]* { return first + rest.join(""); }

you can now just write:

  identifier = $([a-zA-Z_] [a-zA-Z0-9_]*)

This is useful mostly for "lexical" rules at the bottom of many
grammars.

Note that structured match results are still built for the expressions
prefixed by "$", they are just ignored. I plan to optimize this later
(sometime after the code generator rewrite).
2012-12-02 17:05:13 +01:00
David Majda 0519d7e3ce Git repo npmization: Make the repo a npm package
Includes:

  * Moving the source code from /src to /lib.
  * Adding an explicit file list to package.json
  * Updating the Makefile.
  * Updating the spec and benchmark suites and their READMEs.

Part of a fix for GH-32.
2012-11-10 14:21:14 +01:00
Renamed from src/compiler/passes/remove-proxy-rules.js (Browse further)