786 Commits (e510ecc3d01103b61b504128cee5341dd8c4e005)
 

Author SHA1 Message Date
David Majda ade2c249f2 Behavior specs cleanup: Improve rule reference specs 9 years ago
David Majda 936d6453a5 Behavior specs cleanup: Improve dot specs 9 years ago
David Majda 74be12c657 Behavior specs cleanup: Improve character class specs 9 years ago
David Majda 54191fbf12 Behavior specs cleanup: Improve literal specs 9 years ago
David Majda 2faff0000e Behavior specs cleanup: Make |toParse| work without expected value
This means we can assert just "this string parses" and ignore the
returned value.
9 years ago
David Majda ce91921a1d Behavior specs cleanup: Don't describe named rules separately
While naming a rule creates a separate node on the AST level, it's not a
new concept on the user level, so its specs should be a part of rule
specs.
9 years ago
David Majda a597e65a66 Behavior specs cleanup: Reorder toplevel |describe| blocks
Reorder toplevel |describe| blocks to more closely match ordering used
in the PEG.js grammar and elsewhere in PEG.js.
9 years ago
David Majda 3308807d22 Behavior specs cleanup: Move spec/api/generated-parser-behavior.spec.js
Move spec/api/generated-parser-behavior.spec.js to
spec/behavior/generated-parser-behavior.spec.js. It's not an API test,
strictly speaking.
9 years ago
David Majda 84473db3ce Specs cleanup: Small description cleanups/fixes 9 years ago
David Majda cc8edd8892 README.md: Fix typo
Based on a pull request by Julien Valéry:

  https://github.com/pegjs/website/pull/14
9 years ago
David Majda fb7de36051 Update website URL
PEG.js website was moved from http://pegjs.majda.cz/ to http://pegjs.org/.
9 years ago
David Majda 2dedce52d6 Add info about the Bower package maintainer 9 years ago
David Majda 9a822528f9 Add Bower installation instructions 9 years ago
David Majda 178d56699a Update GitHub project URLs
See https://groups.google.com/d/msg/pegjs/4a6zWKQSG6U/n8Pm257Lz6wJ.

I didn't update CHANGELOG.md as I consider issue URLs there historical artifacts
;-)
9 years ago
David Majda 5a2ca2abc7 Add two missing blank lines 10 years ago
David Majda 5ce5f7a612 Specs cleanup: Use raw node types in |generateBytecode| specs
Use raw node types instead of humanized node names in |generateBytecode|
specs. This corresponds more closely to the level the specs are written
at.
10 years ago
David Majda 0977dd37a3 Reordering in visitors and their specs
Reorder visiting functions and their specs to more closely match
ordering used in the PEG.js grammar.
10 years ago
David Majda 850ddf5889 Specs cleanup: Simplify compiler passes specs
After 898a7b5a2d the specs mostly tested
the visitor implementation, not actual code in the passes.
10 years ago
David Majda 4ec9e6ba10 Remove useless test in the |reportLeftRecursion| pass
Empty sequences are not allowed anymore so we don't have to test for
them.
10 years ago
David Majda 898a7b5a2d Simplify visitors by providing default visit functions
The |visitor.build| function now supplies default visit functions for
visitors it builds. These functions don't do anything beside traversing
the tree and passing arguments around to child visit functions.

Having the default visit functions allowed to simplify several visitors.
10 years ago
David Majda 4a3b9cbb8d Require Node.js >= 0.10.0
Travis CI builds with Node.js 0.8.x started to fail:

  https://travis-ci.org/dmajda/pegjs/jobs/26691570

Rather than investigating what's wrong I decided to stop supporting Node
0.8.x. Node.js 0.10.x is here for over a year, which should be enough
time for everyone to upgrade in the fast-paced Node.js world.
10 years ago
David Majda e101e1b6f3 Specs cleanup: Implement generated parser API specs
The generated parser API specs are mostly extracted from
generated-parser.spec.js, which got renamed to
generated-parser-behavior.spec.js to better reflect its purpose.
10 years ago
David Majda 94c8b08acf Specs cleanup: Implement plugin API specs 10 years ago
David Majda d0ff834a3d Specs cleanup: Implement PEG.js API specs
Some parts were previously part of generated parser specs, these were
moved.
10 years ago
David Majda 0306a76152 Specs cleanup: Rename & simplify |varyAll|
Rename |varyAll| to |varyOptimizationOptions|, because that's what the
function does. Simplify as we don't need a fully generic solution.
10 years ago
David Majda 3d637173ee Specs cleanup: Split specs into unit and API specs
Unit specs are unit tests of internal stuff. API specs are tests of the
user-visible APIs and behavior.

I think it makes sense to make this distinction because then the public
API line is more clearly visible e.g. when using the specs as
documentation.
10 years ago
David Majda f457c41dd4 Declare the |j| variable before use in lib/utils/arrays.js
Until now it was inadvertently global.
10 years ago
David Majda 24394e3f91 Fix comment alignment in lib/compiler/passes/generate-javascript.js 10 years ago
David Majda 2b06476c69 Regenerate lib/parser.js after bytecode changes 10 years ago
David Majda dad1207c46 Improve semantics of the TEXT bytecode instruction
The TEXT instruction now replaces position at the top of the stack with
the input from that position until the current position. This is simpler
and cleaner semantics than the previous one, where TEXT also popped an
additional value from the stack and kept the position there.
10 years ago
David Majda a815a8b902 Implement additional PUSH_* bytecode instructions
Implement the following bytecode instructions:

  * PUSH_UNDEFINED
  * PUSH_NULL
  * PUSH_FAILED
  * PUSH_EMPTY_ARRAY

These instructions push simple JavaSccript values to the stack directly,
without going through constants. This makes the bytecode slightly
shorter and the bytecode generator somewhat simpler.

Also note that PUSH_EMPTY_ARRAY allows us to avoid a hack which protects
the [] constant from modification.
10 years ago
David Majda c6f0818d49 Use sentence case consistently in {spec,benchmark}/README.md headers 10 years ago
David Majda 4d456402be Small cleanup of benchmark/index.js
Update coding style to match the rest of PEG.js.
10 years ago
David Majda 811a5c0f01 Small cleanup of benchmark/runner.js
Update coding style to match the rest of PEG.js.
10 years ago
David Majda b901a5c37a Rewrite benchmark/README.md
More clarity, better grammar (hopefully).
10 years ago
David Majda f102814998 Rewrite spec/README.md
More clarity, better grammar (hopefully).
10 years ago
David Majda fc1d54d049 Convert benchmark/README to Markdown
It will look nicer on GitHub.
10 years ago
David Majda 24e1644c58 Convert spec/README to Markdown
It will look nicer on GitHub.
10 years ago
David Majda 85c8f386c1 Formatting 10 years ago
David Majda f03ba4bf4f generate-javascript.js: s/generateJavaScript/generateJavascript/
This makes the variable name in sync with pass name in lib/compiler.js.
10 years ago
David Majda 57f7fae684 Fix a bug in |stringEscape|
The |stringEscape| function both in lib/compiler/javascript.js and in
generated parsers didn't escape characters in the U+0100..U+107F and
U+1000..U+107F ranges.
10 years ago
David Majda 88e5f136e1 Utility functions cleanup: Cleanup lib/compiler/javascript.js 10 years ago
David Majda c1e1502d43 Utility functions cleanup: Cleanup lib/compiler/visitor.js 10 years ago
David Majda bfaad70899 Utility functions cleanup: Cleanup lib/compiler/asts.js 10 years ago
David Majda 05f97f444d Utility functions cleanup: Cleanup lib/utils/classes.js 10 years ago
David Majda 1582304f16 Utility functions cleanup: Cleanup lib/utils/objects.js 10 years ago
David Majda 50b2054fbf Utility functions cleanup: Cleanup lib/utils/arrays.js 10 years ago
David Majda 5adad3ae12 Utility functions cleanup: Split lib/utils.js
Split lib/utils.js into multiple files. Some of the functions were
generic, these were moved into files in lib/utils. Other funtions were
specific for the compiler, these were moved to files in lib/compiler.

This commit only moves functions around -- there is no renaming and
cleanup performed. Both will come later.
10 years ago
David Majda ff8e877fce Change module exporting style
Modules now generally store the exported object in a named variable or
function first and only assign |module.exports| at the very end. This is
a difference when compared to style used until now, where most modules
started with a |module.exports| assignment.

I think the explicit name helps readability and understandability.
10 years ago
David Majda 11aab6374f s/head/first/ & s/tail/rest/ in a testcase
Makes the testcase in sync with example grammars.
10 years ago