944 Commits (9c04c94c85faad8e223eeabe146039d654cd1cf8)
 

Author SHA1 Message Date
David Majda 9c04c94c85 Escape vertical tab as "\v", not "\x0B"
See #441.
8 years ago
David Majda f36a667376 Remove "undefined" redefinition protection
See #441.
8 years ago
David Majda aa1a2e74cf Replace suitable for loops with Array methods (in /examples)
See #441.
8 years ago
David Majda 9fbb45a2c9 Replace suitable for loops with Array methods (in /benchmark)
See #441.
8 years ago
David Majda df5f86103e Replace suitable for loops with Array methods (in /spec)
See #441.
8 years ago
David Majda fad4ab74d1 Replace suitable for loops with Array methods (in /lib)
See #441.
8 years ago
David Majda 3e8bcbea73 Replace suitable for loops with Array methods (in /src)
See #441.
8 years ago
David Majda 1c3fbf6cb0 Replace "... instanceof Array" with "Array.isArray(...)"
See #441.
8 years ago
David Majda d346d2a66d Replace objects.keys with Object.keys
See #441.
8 years ago
David Majda 0059cc3bdd Replace arrays.some with Array.prototype.some
See #441.
8 years ago
David Majda d162fe1cfc Replace arrays.every with Array.prototype.every
See #441.
8 years ago
David Majda 5f65de92bc Replace arrays.map with Array.prototype.map
See #441.
8 years ago
David Majda b044a021c4 Replace arrays.each with Array.prototype.forEach
See #441.
8 years ago
David Majda 2a6a058c9c Merge pull request #440 from atavakoli/fix-js-example-logicalexpr
JavaScript example: Use LogicalExpression nodes for "&&" and "||"
8 years ago
Ali Tavakoli d914c7b150 JavaScript example: Use LogicalExpression nodes for "&&" and "||"
The buildLogicalExpression function was defined, but not used;
specifically, the Logical(AND|OR)Expression(NoIn)? rules were
constructing BinaryExpression nodes, but are now LogicalExpression
nodes as per the ESTree spec (es5.md).
8 years ago
David Majda bf08c6cbc3 JavaScript example: Declare built AST as compatible with ESTree
ESTree is now the canonical JavaScript AST format. Mozilla SpiderMonkey
Parser API, which we delared compatibility with before, is obsolete.
8 years ago
David Majda 567655e72f JavaScript example: Add "type" to ObjectExpression properties
Nodes representing ObjectExpression properties were missing the "type"
property (set to "Property") so let's add it.
8 years ago
David Majda 7fd273d893 Merge pull request #439 from atavakoli/fix-js-example-vardecl
Added 'kind' to VariableDeclaration in example
8 years ago
Ali Tavakoli 5f9bc6ed4d JavaScript example: Add "kind" to VariableDeclaration nodes
The JavaScript example grammar's VariableDeclaration nodes were missing
the "kind" member (which is always set to "var", according to the
ESTree spec).
8 years ago
David Majda 671166bbe8 Update version to 0.10.0 8 years ago
David Majda 86c040e05f Update CHANGELOG.md 8 years ago
David Majda 8003edafc9 Rename the "node" module format to "commonjs"
Parsers generated in this format use module.exports, so they are not
strictly CommonJS, but this is a common extension and the original name
would be confusing once Node.js implements ES2015 modules.
8 years ago
David Majda 8962dcfd16 Rename the "global" module format to "globals"
I think the new name is more widely used when describing the pattern.
8 years ago
David Majda 0478f8a6cf package.json: Sort files alphabetically 8 years ago
David Majda b77d33ca05 generate-js.js: Quote the "class" key in DESCRIBE_EXPECTATION_FNS
"class" is a reserved word. Having it as a key unquoted broke IE 8 (both
in standards and quirks mode) and IE 9 (in quirks mode).
8 years ago
David Majda 2a8544d86c README.md: Remove io.js from the list of compatible environments 8 years ago
David Majda 5c0f0add95 Downgrade eslint to 2.13.1
It turns out ESLint 3.x works only with Node.js >= 4, which breaks Travis
CI builds:

  https://travis-ci.org/pegjs/pegjs/builds/149205616
8 years ago
David Majda f09271493c Use jQuery.scrollTo 2.1.2 8 years ago
David Majda 0753d8d4d5 Use jQuery 1.12.4 8 years ago
David Majda 9446e07f6a Use uglify-js 2.7.0 8 years ago
David Majda a8d01e1834 Use eslint 3.2.0
Note the update required disabling the "no-control-regex" rule, which
started reporting following errors:

  /Users/dmajda/Programming/PEG.js/pegjs/lib/compiler/js.js
    22:16  error  Unexpected control character in regular expression  no-control-regex
    27:16  error  Unexpected control character in regular expression  no-control-regex
    28:16  error  Unexpected control character in regular expression  no-control-regex
    51:16  error  Unexpected control character in regular expression  no-control-regex
    52:16  error  Unexpected control character in regular expression  no-control-regex

  /Users/dmajda/Programming/PEG.js/pegjs/lib/parser.js
    76:16  error  Unexpected control character in regular expression  no-control-regex
    77:16  error  Unexpected control character in regular expression  no-control-regex
    90:16  error  Unexpected control character in regular expression  no-control-regex
    91:16  error  Unexpected control character in regular expression  no-control-regex
8 years ago
David Majda e6c3e7180f Use browserify 13.1.0 8 years ago
David Majda 2647f5789f generated-parser-behavior.spec.js: Test also with options.trace === true
Based on a pull request by @Mingun:

  https://github.com/pegjs/pegjs/pull/397
8 years ago
David Majda bf9d9561c4 Tighten "try ... catch" clauses in spec helpers
They wrapped too much code.
8 years ago
David Majda 67d85f2de8 Align names of compiler passes that detect infinite loops
Rename compiler passes as follows:

  reportLeftRecursion -> reportInfiniteRecursion
  reportInfiniteLoops -> reportInfiniteRepetition

This reflects the fact that both passes detect different ways of causing
the same problem (possible infinite loop when parsing).
8 years ago
David Majda 9717dc3417 Talk about "undefined rules" instead of "missing rules" internally
The new terminology is more precise and in line with commonly used
programming languages.

The change involves mainly renaming related compiler pass and files
associated with it.
8 years ago
David Majda e9cb23608d Split peg$buildException into two separate functions
This change reflects the fact that PEG.js-generated parsers really
produce two kinds of syntax errors:

  Structured errors

    Caused by match failures, trailing input, or calls of the "expected"
    function in parser code. Their messages have fixed format ("Expected
    ... but ... found.").

  Simple errors

    Caused by calls of the "error" function in parser code. Their
    messages don't have any fixed format.

Each kind of error now has a separate helper function which builds its
instances.
8 years ago
David Majda e03d92488a Set the "found" property of syntax errors produced by "error" to null
The property doesn't correspond to anything in the error's message.
8 years ago
David Majda 6ca546a44e Regenerate lib/parser.js 8 years ago
David Majda 75cd17ed58 bin/pegjs: Implement the --format option 8 years ago
David Majda d83e4d5a48 bin/pegjs: Generate parsers in "node" format
I think the "node" format is what most people want these days.

An option to override will be added in the next commit.
8 years ago
David Majda db9920e3ca peg.generate: Implement { format: "global" } 8 years ago
David Majda 61c11ee1b4 peg.generate: Implement { format: "amd" } 8 years ago
David Majda f633f697c9 peg.generate: Implement { format: "node" } 8 years ago
David Majda 9454c11c59 generate-js.js: Fix "=" alignment 8 years ago
David Majda e546af5543 Regenerate lib/parser.js 8 years ago
David Majda a3397c31f9 Makefile: Fix bin/pegjs invocation
It was broken since a57431955e.
8 years ago
David Majda e8be76ee3a Don't expose the "parser" variable in parser code
The "parser" variable allowed access to the parser object. Among other
things, this made it possible to invoke the parser recursively using
"parser.parse".

One problem with the "parser" variable is that it bakes in the idea that
the parser is an *object*, not a *module*. While this is true now, it
won't necessarily be in the future, when parsers may be exported as ES6
modules. Also, people tend to use parsers as modules even today, e.g.
like this:

  var parse = require("parser").parse;
  var result = parse(...);

Such usage broke the "parser" variable (as it was implemented).

For this reasons I decided to remove the "parser" variable. If someone
needs to do tricks like recursive invocation of the parser, he/she must
pass the parser or the "parse" function itself using options.

Related to #433.
8 years ago
David Majda 6aa956452e Don't use "this" inside peg.generate
This change makes it possible to use "generate" as a module function,
e.g. like this:

  var generate = require("pegjs").generate;
  var parser = generate(...);

Fixes #433.
8 years ago
David Majda 65550965c6 Remove extraneous "with" from an error message 8 years ago