1029 Commits (b5bd30c813fccd674995c3f61f843162236a076c)
 

Author SHA1 Message Date
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 9 years ago
David Majda 75cd17ed58 bin/pegjs: Implement the --format option 9 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.
9 years ago
David Majda db9920e3ca peg.generate: Implement { format: "global" } 9 years ago
David Majda 61c11ee1b4 peg.generate: Implement { format: "amd" } 9 years ago
David Majda f633f697c9 peg.generate: Implement { format: "node" } 9 years ago
David Majda 9454c11c59 generate-js.js: Fix "=" alignment 9 years ago
David Majda e546af5543 Regenerate lib/parser.js 9 years ago
David Majda a3397c31f9 Makefile: Fix bin/pegjs invocation
It was broken since a57431955e.
9 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.
9 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.
9 years ago
David Majda 65550965c6 Remove extraneous "with" from an error message 9 years ago
David Majda b3a90de020 Syntax error messages: Use Oxford comma
In general PEG.js uses American English, where Oxford comma is
prevalent.

Part of #371.
9 years ago
David Majda ec8ede5bbe Grammar error messages 3/3: Improve the left recursion message
New wording is more explanatory.

Part of #371.
9 years ago
David Majda f5e43f842c Grammar error messages 2/3: Improve the infinite loop message
New wording is more explanatory.

Part of #371.
9 years ago
David Majda 85fb8aaa0e Grammar error messages 1/3: Improve the missing rule message
New wording is more similar to wording used in various programming
languages and it is in line with the duplicate rule message.

Part of #371.
9 years ago
David Majda eb67cbedb4 Report duplicate labels as errors
Resolves #270.
9 years ago
David Majda 2a889535bd Add location to the "Rule ... is already defined" error message
See this discussion:

  eb5875bc6a (commitcomment-17970220)
9 years ago
David Majda f9bc0fe619 package.json: Sort files alphabetically 9 years ago
David Majda eb5875bc6a Report duplicate rule definitions as errors
Based on a pull request by Futago-za Ryuu (@futagoza):

  https://github.com/pegjs/pegjs/pull/329

Resolves #318.
9 years ago
David Majda 149c829897 lib/compiler/index.js: Order default option values alphabetically 9 years ago
David Majda c0e2bd218c README.md: Describe the --optimize command-line option 9 years ago
David Majda da1395e21e README.md: Describe the --dependency command-line option 9 years ago
David Majda 6bf19ae6f8 README.md: Order command-line options alphabetically 9 years ago
David Majda 01aa32615b README.md: Describe the "trace" peg.generate option 9 years ago
David Majda f41535224d README.md: Order peg.generate options alphabetically 9 years ago
David Majda 3672eff31c bin/pegjs: Order peg.generate options alphabetically 9 years ago