Commit graph

19 commits

Author SHA1 Message Date
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
David Majda 4cda79951a Git repo npmization: Compose PEG.js from Node.js modules
PEG.js source code becomes a set of Node.js modules that include each
other as needed. The distribution version is built by bundling these
modules together, wrapping them inside a bit of boilerplate code that
makes |module.exports| and |require| work.

Part of a fix for GH-32.
2012-11-10 10:38:48 +01:00
David Majda c6cf129635 Git repo npmization: Do not use @VERSION
When the Git repository will be a npm package, there will be no
preprocessing step and thus no @VERSION substitution. Let's get rid of
it.

Part of a fix for GH-32.
2012-11-09 16:07:19 +01:00
David Majda 143924357b Setup prototype chain for |PEG.GrammarError| correctly 2012-10-28 19:06:47 +01:00
David Majda 428fe294cf Change |PEG.GrammarError| name
Change the value of the |name| property of |PEG.GrammarError| instances
from "PEG.GrammarError" to just "GrammarError". This better reflects the
fact that PEG.js can get required under different name than "PEG".
2012-10-28 18:57:45 +01:00
David Majda 406ac0a288 Fix banner typo 2012-10-28 15:20:05 +01:00
David Majda abf33d3feb Add a note about semantic versioning to |PEG.VERSION| comment 2012-04-16 15:35:54 +02:00
David Majda 7f2dc850e0 Change how the library is exported
This commit makes the library define the |PEG| global variable (for
browser export) and possibly assign it into |module.exports| (for
Node.js export) later. The |module.exports| assignment is done *outside*
the main library |function| statement.

The big idea behind this is to make copy & paste inclusion of the
library into another code easier -- one just needs to strip the last
three lines.
2012-04-16 15:34:30 +02:00
David Majda 7e02e45831 Improve copyright comment 2012-04-16 14:39:59 +02:00
David Majda 9615eb4bb6 Allow passing options to |PEG.buildParser|
These get passed down to the emitter templates.
2012-03-26 20:15:23 +02:00
David Majda 2f671e0022 src/peg.js: Prevent redefinition of |undefined| differently
Fixes the following JSHint error:

  ./src/peg.js: line 5, col 5, Expected an identifier and instead saw 'undefined' (a reserved word).
2011-09-18 16:25:46 +02:00
David Majda 827a5ac312 Add PEG.js version information and homepage header to peg.js 2011-04-02 10:41:43 +02:00
David Majda 13a3621e79 Export the PEG library in simpler and more robust way 2011-02-13 12:37:15 +01:00
David Majda 4ea2003b7b Export PEG.VERSION property with PEG.js version
Value of the property is read in build time from the VERSION file.
2010-11-14 17:11:36 +01:00
David Majda e3effab86b Behave correctly in Rhino context (fixes previous commit) 2010-09-28 21:06:01 +02:00
David Majda 2120de36af Behave like CommonJS module in CommonJS context 2010-09-28 21:02:11 +02:00
David Majda 77ec4f7162 Little bit cleaner way to protect against |undefined| redefinition 2010-09-28 20:22:44 +02:00
David Majda a42b957573 Remove now mostly useless comment headers from the code 2010-08-21 15:38:17 +02:00
David Majda e59f3ba338 Split the source code into several files, introduce build system
The source code is now in the src directory. The library needs to be
built using "rake", which creates the lib/peg.js file by combining the
source files.
2010-08-15 19:45:51 +02:00