pegjs/lib/compiler
David Majda 5a4d04fa90 Construct expectations using functions
Until now, expectations were constructed using object literals. This
commit changes the construction to use factory functions.

This change makes generated parsers slightly smaller because property
names don't have to be repeated many times and factory function calls
are more amenable to minifying.

Some numbers based on the aggregate size of parsers generated from
examples/*.pegjs:

  Optimization   Minified?   Size before   Size after   Saving
  ------------------------------------------------------------
  speed          no               719066       716063    0.42%
  speed          yes              188998       180202    4.65%
  size           no               194810       197813    1.52%
  size           yes              108782        99947    8.12%

(Minification was done using "uglify --mangle --compress" with
uglify-js 2.4.24.)
2016-06-18 06:57:09 +02:00
..
passes Construct expectations using functions 2016-06-18 06:57:09 +02:00
asts.js Fix labels leaking to outer scope 2016-03-11 16:42:03 +01:00
js.js Simplify various escaping functions 2016-06-11 13:29:50 +02:00
opcodes.js Fix comment typo 2015-08-18 10:58:22 +02:00
visitor.js Fix labels leaking to outer scope 2016-03-11 16:42:03 +01:00