From b27a99a7fbf05330cc47c48b71ff68212254cdb4 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Wed, 28 Dec 2011 18:03:07 +0000 Subject: [PATCH] Added pegjs Which is going to replace uglify --- node_modules/.bin/pegjs | 1 + node_modules/pegjs/CHANGELOG | 146 + node_modules/pegjs/LICENSE | 22 + node_modules/pegjs/README.md | 226 + node_modules/pegjs/VERSION | 1 + node_modules/pegjs/bin/pegjs | 142 + node_modules/pegjs/examples/arithmetics.pegjs | 22 + node_modules/pegjs/examples/css.pegjs | 554 ++ node_modules/pegjs/examples/javascript.pegjs | 1530 +++++ node_modules/pegjs/examples/json.pegjs | 120 + node_modules/pegjs/lib/peg.js | 5141 +++++++++++++++++ node_modules/pegjs/package.json | 24 + parsers/javascript.pegjs | 1530 +++++ 13 files changed, 9459 insertions(+) create mode 120000 node_modules/.bin/pegjs create mode 100644 node_modules/pegjs/CHANGELOG create mode 100644 node_modules/pegjs/LICENSE create mode 100644 node_modules/pegjs/README.md create mode 100644 node_modules/pegjs/VERSION create mode 100755 node_modules/pegjs/bin/pegjs create mode 100644 node_modules/pegjs/examples/arithmetics.pegjs create mode 100644 node_modules/pegjs/examples/css.pegjs create mode 100644 node_modules/pegjs/examples/javascript.pegjs create mode 100644 node_modules/pegjs/examples/json.pegjs create mode 100644 node_modules/pegjs/lib/peg.js create mode 100644 node_modules/pegjs/package.json create mode 100644 parsers/javascript.pegjs diff --git a/node_modules/.bin/pegjs b/node_modules/.bin/pegjs new file mode 120000 index 000000000..67b7cecf8 --- /dev/null +++ b/node_modules/.bin/pegjs @@ -0,0 +1 @@ +../pegjs/bin/pegjs \ No newline at end of file diff --git a/node_modules/pegjs/CHANGELOG b/node_modules/pegjs/CHANGELOG new file mode 100644 index 000000000..e5967cf94 --- /dev/null +++ b/node_modules/pegjs/CHANGELOG @@ -0,0 +1,146 @@ +0.6.2 (2011-08-20) +------------------ + +Small Changes: + +* Reset parser position when action returns |null|. +* Fixed typo in JavaScript example grammar. + +0.6.1 (2011-04-14) +------------------ + +Small Changes: + +* Use --ascii option when generating a minified version. + +0.6.0 (2011-04-14) +------------------ + +Big Changes: + +* Rewrote the command-line mode to be based on Node.js instead of Rhino -- no + more Java dependency. This also means that PEG.js is available as a Node.js + package and can be required as a module. +* Version for the browser is built separately from the command-ine one in two + flavors (normal and minified). +* Parser variable name is no longer required argument of bin/pegjs -- it is + "module.exports" by default and can be set using the -e/--export-var option. + This makes parsers generated by /bin/pegjs Node.js modules by default. +* Added ability to start parsing from any grammar rule. +* Added several compiler optimizations -- 0.6 is ~12% faster than 0.5.1 in the + benchmark on V8. + +Small Changes: + +* Split the source code into multiple files combined together using a build + system. +* Jake is now used instead of Rake for build scripts -- no more Ruby dependency. +* Test suite can be run from the command-line. +* Benchmark suite can be run from the command-line. +* Benchmark browser runner improvements (users can specify number of runs, + benchmarks are run using |setTimeout|, table is centered and fixed-width). +* Added PEG.js version to "Generated by..." line in generated parsers. +* Added PEG.js version information and homepage header to peg.js. +* Generated code improvements and fixes. +* Internal code improvements and fixes. +* Rewrote README.md. + +0.5.1 (2010-11-28) +------------------ + +Small Changes: + +* Fixed a problem where "SyntaxError: Invalid range in character class." error + appeared when using command-line version on Widnows (GH-13). +* Fixed wrong version reported by "bin/pegjs --version". +* Removed two unused variables in the code. +* Fixed incorrect variable name on two places. + +0.5 (2010-06-10) +---------------- + +Big Changes: + +* Syntax change: Use labeled expressions and variables instead of $1, $2, etc. +* Syntax change: Replaced ":" after a rule name with "=". +* Syntax change: Allow trailing semicolon (";") for rules +* Semantic change: Start rule of the grammar is now implicitly its first rule. +* Implemented semantic predicates. +* Implemented initializers. +* Removed ability to change the start rule when generating the parser. +* Added several compiler optimizations -- 0.5 is ~11% faster than 0.4 in the + benchmark on V8. + +Small Changes: + +* PEG.buildParser now accepts grammars only in string format. +* Added "Generated by ..." message to the generated parsers. +* Formatted all grammars more consistently and transparently. +* Added notes about ECMA-262, 5th ed. compatibility to the JSON example grammar. +* Guarded against redefinition of |undefined|. +* Made bin/pegjs work when called via a symlink (issue #1). +* Fixed bug causing incorrect error messages (issue #2). +* Fixed error message for invalid character range. +* Fixed string literal parsing in the JavaScript grammar. +* Generated code improvements and fixes. +* Internal code improvements and fixes. +* Improved README.md. + +0.4 (2010-04-17) +---------------- + +Big Changes: + +* Improved IE compatibility -- IE6+ is now fully supported. +* Generated parsers are now standalone (no runtime is required). +* Added example grammars for JavaScript, CSS and JSON. +* Added a benchmark suite. +* Implemented negative character classes (e.g. [^a-z]). +* Project moved from BitBucket to GitHub. + +Small Changes: + +* Code generated for the character classes is now regexp-based (= simpler and + more scalable). +* Added \uFEFF (BOM) to the definition of whitespace in the metagrammar. +* When building a parser, left-recursive rules (both direct and indirect) are + reported as errors. +* When building a parser, missing rules are reported as errors. +* Expected items in the error messages do not contain duplicates and they are + sorted. +* Fixed several bugs in the example arithmetics grammar. +* Converted README to GitHub Flavored Markdown and improved it. +* Added CHANGELOG. +* Internal code improvements. + +0.3 (2010-03-14) +---------------- + +* Wrote README. +* Bootstrapped the grammar parser. +* Metagrammar recognizes JavaScript-like comments. +* Changed standard grammar extension from .peg to .pegjs (it is more specific). +* Simplified the example arithmetics grammar + added comment. +* Fixed a bug with reporting of invalid ranges such as [b-a] in the metagrammar. +* Fixed --start vs. --start-rule inconsistency between help and actual option + processing code. +* Avoided ugliness in QUnit output. +* Fixed typo in help: "parserVar" -> "parser_var". +* Internal code improvements. + +0.2.1 (2010-03-08) +------------------ + +* Added "pegjs-" prefix to the name of the minified runtime file. + +0.2 (2010-03-08) +---------------- + +* Added Rakefile that builds minified runtime using Google Closure Compiler API. +* Removed trailing commas in object initializers (Google Closure does not like + them). + +0.1 (2010-03-08) +---------------- + +* Initial release. diff --git a/node_modules/pegjs/LICENSE b/node_modules/pegjs/LICENSE new file mode 100644 index 000000000..48ab3e5a5 --- /dev/null +++ b/node_modules/pegjs/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2010-2011 David Majda + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/pegjs/README.md b/node_modules/pegjs/README.md new file mode 100644 index 000000000..7a4c17e84 --- /dev/null +++ b/node_modules/pegjs/README.md @@ -0,0 +1,226 @@ +PEG.js +====== + +PEG.js is a simple parser generator for JavaScript that produces fast parsers with excellent error reporting. You can use it to process complex data or computer languages and build transformers, interpreters, compilers and other tools easily. + +Features +-------- + + * Simple and expressive grammar syntax + * Integrates both lexical and syntactical analysis + * Parsers have excellent error reporting out of the box + * Based on [parsing expression grammar](http://en.wikipedia.org/wiki/Parsing_expression_grammar) formalism — more powerful than traditional LL(*k*) and LR(*k*) parsers + * Usable [from your browser](http://pegjs.majda.cz/online), from the command line, or via JavaScript API + +Getting Started +--------------- + +[Online version](http://pegjs.majda.cz/online) is the easiest way to generate a parser. Just enter your grammar, try parsing few inputs, and download generated parser code. + +Installation +------------ + +### Command Line / Server-side + +To use command-line version, install [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) first. You can then install PEG.js: + + $ npm install pegjs + +Once installed, you can use the `pegjs` command to generate your parser from a grammar and use the JavaScript API from Node.js. + +### Browser + +[Download](http://pegjs.majda.cz/#download) the PEG.js library (regular or minified version) and include it in your web page or application using the `