220 Commits (b399004a90387bce3f981433e6cf3acf407d4b48)
 

Author SHA1 Message Date
David Majda b399004a90 Update version to 0.6.0 + update release date in CHANGELOG 14 years ago
David Majda ffbe60094a Rewrite README.md 14 years ago
David Majda 1f89c7746f Quote keys in |parseFunctions| table in generated parsers
IE and Nitro choked when rule names that are JavaScript reserved words
(e.g. "class") were used.
14 years ago
David Majda 596bf6eba9 Update CHANGELOG 14 years ago
David Majda bafb8655f7 Clean up package.json
The engine's and dependencies' versions are the ones I've tested with.
Lower version will probably work too, but I don't want to spend more
time testing now so I'll play it safe.
14 years ago
David Majda 8d8a5e322f Fix @VERSION substitution in build-time preprocessing
The code didn't work properly when multiple @VERSION strings were
present in a preprocessed file.
14 years ago
David Majda 66e5418052 Build also minified version for the web in "jake dist" 14 years ago
David Majda 81fbbd7897 Make "test" and "benchmark" Jakefile tasks depend on "build"
This ensures the version tested/benchmarked is always up-to-date.
14 years ago
David Majda d00ba29ead Add "clean" and "distclean" Jakefile tasks 14 years ago
David Majda 69044e9d0b Add "dist" Jakefile task that prepares the distribution files 14 years ago
David Majda 827a5ac312 Add PEG.js version information and homepage header to peg.js 14 years ago
David Majda 9917f79991 Add PEG.js version to "Generated by..." line in generated parsers 14 years ago
David Majda aca15d6f36 Change Node.js pacakge name to from "peg" to "pegjs"
The only place where we use the name without "js" is the library
filename (peg.js) and consequently the module name (PEG).
14 years ago
David Majda db32ff2d0d Change version to 0.6.0pre 14 years ago
David Majda cc7ad9739f Add ability to start parsing from any grammar rule
Calling the parsing function could have been done without the ugly table
using |eval|, but this seemed to degrade performance significantly (by
about 3 %). This is probably because engines optimize badly in presence
of |eval|.

The method used in this patch does not change the benchmark suite
execution speed statistically significantly on V8.

Detailed results (benchmark suite totals):

---------------------------------
 Test #     Before       After
---------------------------------
      1   38.24 kB/s   38.28 kB/s
      2   38.35 kB/s   38.15 kB/s
      3   38.43 kB/s   38.40 kB/s
      4   38.53 kB/s   38.20 kB/s
      5   38.25 kB/s   38.39 kB/s
---------------------------------
Average   38.36 kB/s   38.39 kB/s
---------------------------------

Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.151 Safari/534.1
14 years ago
David Majda 1e57bf778d Require Node.js 0.4 or higher
This is not strictly necessary now, but I won't test PEG.js with lower
versions, so I can't guarantee correct functionality.
14 years ago
David Majda dcf904c392 bin/pegjs: Default parser variable name is "module.exports"
The previous default name was "exports.parser". This meant that to use
the generated parser in Node.js, you had to use code like this:

  var parser = require("./my-cool-parser").parser;
  parser.parse(...);

Now you can shorten it a bit:

  var parser = require("./my-cool-parser");
  parser.parse(...);

The shorter version makes sense since no other objects except the parser
are exported from the module.
14 years ago
David Majda 13a3621e79 Export the PEG library in simpler and more robust way 14 years ago
David Majda 3e7d31559d Do not pass |global| into wrapping functions in tests, it's useless 14 years ago
David Majda cfc6041041 Remove function wrapping and all |global| refrences from helpers.js
Originally I wanted to be very explicit with accesses to global object,
but since all this file is about extending it, the |global.| qualifier
seems more like noise.
14 years ago
David Majda f0eab4728a Use Unicode box-drawing characters for command-line benchmark table
Hopefully this works reasonably in all environments where Node.js runs.
14 years ago
David Majda 17c1531068 Make "Avg. time" column in the commmand-line benchmark table wider 14 years ago
David Majda c3822835c9 Update copyright year in LICENSE 14 years ago
David Majda a042f78558 Fix unit in command-line benchmark runner 14 years ago
David Majda 4e81eb48af Add "jake test" and "jake benchmark" 14 years ago
David Majda 918dcf6ed2 Test and benchmark command-line runners can be run from any directory 14 years ago
David Majda aa2327191f Escape 0xFF still with "\x", not "\u" 14 years ago
David Majda d5caaa7877 Nicer messages in command-line mode on read/write errors 14 years ago
David Majda 957b96c1b5 Add check for missing parameter of the -e/--export-var option. 14 years ago
David Majda 8f005c027b Fix encoding in |fs.readFileSync| calls ("utf-8" -> "utf8") 14 years ago
David Majda d0c074e2f8 Small style fixes 14 years ago
David Majda 8e63ad3b6c Add command-line runner for the benchmark suite 14 years ago
David Majda a091cb2ffd Factor out parts of benchmarks unrelated to running in the browser 14 years ago
David Majda fc1f489165 Save one concatenation when creating cache keys in generated parsers
Results of benchmark with 100 runs on V8:

  Before:  38.06 kB/s
  After:   38.72 kB/s
  Speedup: 1.734 %

Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.10 (KHTML, like
Gecko) Chrome/8.0.552.237 Safari/534.10
14 years ago
David Majda afcceb127f Add command-line runner for the test suite
The output format and code is heavily inspired by Nodeunit and code in
QUnit's "cli" branch.
14 years ago
David Majda 0e9d58ea96 Upgrade QUnit to the current master (c532d183664118fc2ca1) 14 years ago
David Majda 98cbd57ead Add two missing |var|s (fix global namespace pollution) 14 years ago
David Majda 1a3291fa36 Jakefile: Put the LIB_DIR existence check & creation at the right place 14 years ago
David Majda 595d3adb82 Add package.json for installing as Node package 14 years ago
David Majda 88f901f36e Jakefile: Create the "lib" directory if it does not exist
Closes GH-14.
Closes GH-15.
14 years ago
David Majda 4c59bbfef9 Fixes to previous commit
Require PEG only in the "parser" task -- it may not exist when executing
the "build" task. Also don't make the "build" task dependent on the
"parser" to break a dependency circle.
14 years ago
David Majda f3845726f2 Rakefile -> Jakefile
Or, swapped Ruby dependency for a Node dependency.

The build script was also modified to always regenerate the parser (in
case of the "parser" task) or rebuild the library (in case of the
"build" task) even if the source files were not modified. Not doing this
led to problems when the generating code changed but the files didn't
(which happened often during development).
14 years ago
David Majda 814ce7d9db Switch command-line mode backend from Rhino to Node 14 years ago
David Majda e25dcfbac8 Update CHANGELOG 14 years ago
David Majda aeb2cb4f1c Make sure quoting functions output only ASCII characters
This patch prevents portability problems. In particular, it fixes a
problem where "SyntaxError: Invalid range in character class." error
appeared when using command-line version on Widnows (see GH-13).
14 years ago
David Majda 4d68812b65 Fix usage description 14 years ago
David Majda 490eeadffe Bump version to 0.5+ 14 years ago
David Majda 977d1d20c7 Fix wrong version reported by "bin/pegjs --version"
DRY: Now the version is stored only in the VERSION file.
14 years ago
David Majda 4ea2003b7b Export PEG.VERSION property with PEG.js version
Value of the property is read in build time from the VERSION file.
14 years ago
David Majda e3effab86b Behave correctly in Rhino context (fixes previous commit) 14 years ago