You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2016/06/17 06:17:22 UTC

[11/32] ios commit: CB-11445 Updated checked-in node_modules

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/0d465c30/node_modules/pegjs/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/node_modules/pegjs/CHANGELOG.md b/node_modules/pegjs/CHANGELOG.md
new file mode 100644
index 0000000..2212735
--- /dev/null
+++ b/node_modules/pegjs/CHANGELOG.md
@@ -0,0 +1,508 @@
+Change Log
+==========
+
+This file documents all notable changes to PEG.js. The releases follow [semantic
+versioning](http://semver.org/).
+
+0.9.0
+-----
+
+Released: August 30, 2015
+
+### Major Changes
+
+  * **Tracing support.** Parsers can be compiled with support for tracing their
+    progress, which can help debugging complex grammars. This feature is
+    experimental and is expected to evolve over time as experience is gained.
+    [More details](https://github.com/pegjs/pegjs/commit/da57118a43a904f753d44d407994cf0b36358adc)
+
+  * **Infinite loop detection.** Grammar constructs that could cause infinite
+    loops in generated parsers are detected during compilation and cause errors.
+
+  * **Improved location information API.** The `line`, `column`, and `offset`
+    functions available in parser code were replaced by a single `location`
+    function which returns an object describing the current location. Similarly,
+    the `line`, `column`, and `offset` properties of exceptions were replaced by
+    a single `location` property. The location is no longer a single point but a
+    character range, which is meaningful mainly in actions where the range
+    covers action\u2019s expression.
+    [More details](https://github.com/pegjs/pegjs/compare/e75f21dc8f0e66b3d87c4c19b3fcb8f89d9c3acd...eaca5f0acf97b66ef141fed84aa95d4e72e33757)
+
+  * **Improved error reporting.** All exceptions thrown when generating a parser
+    have associated location information. And all exceptions thrown by generated
+    parser and PEG.js itself have a stack trace (the `stack` property) in
+    environments that support `Error.captureStackTrace`.
+
+  * **Strict mode code**. All PEG.js and generated parser code is written using
+    [JavaScript strict mode](https://developer.mozilla.org/cs/docs/Web/JavaScript/Reference/Strict_mode).
+
+### Minor Changes
+
+  * Labels behave like block-scoped variables. This means parser code can see
+    labels defined outside expressions containing code.
+
+  * Empty sequences are no longer allowed.
+
+  * Label names can\u2019t be JavaScript reserved words.
+
+  * Rule and label names can contain Unicode characters like in JavaScript.
+
+  * Rules have to be separated either by `;` or a newline (until now, any
+    whitespace was enough).
+
+  * The PEG.js grammar and all the example grammars were completely rewritten.
+    This rewrite included a number of cleanups, formatting changes, naming
+    changes, and bug fixes.
+
+  * The parser object can now be accessed as `parser` in parser code.
+
+  * Location information computation is faster.
+
+  * Added support for Node.js >= 0.10.x, io.js, and Edge. Removed support for
+    Node.js < 0.10.x.
+
+### Bug Fixes
+
+  * Fixed left recursion detector which missed many cases.
+
+  * Fixed escaping of U+0100\u2014U+107F and U+1000\u2014U+107F in generated code and
+    error messages.
+
+  * Renamed `parse` and `SyntaxError` to `peg$parse` and `peg$SyntaxError` to
+    mark them as internal identifiers.
+
+[Complete set of changes](https://github.com/pegjs/pegjs/compare/v0.8.0...v0.9.0)
+
+0.8.0
+-----
+
+Released: December 24, 2013
+
+### Big Changes
+
+  * Completely rewrote the code generator. Among other things, it allows
+    optimizing generated parsers for parsing speed or code size using the
+    `optimize` option of the `PEG.buildParser` method or the `--optimize`/`-o`
+    option on the command-line. All internal identifiers in generated code now
+    also have a `peg$` prefix to discourage their use and avoid conflicts.
+    [[#35](https://github.com/dmajda/pegjs/issues/35),
+    [#92](https://github.com/dmajda/pegjs/issues/92)]
+
+  * Completely redesigned error handling. Instead of returning `null` inside
+    actions to indicate match failure, new `expected` and `error` functions can
+    be called to trigger an error. Also, expectation inside the `SyntaxError`
+    exceptions are now structured to allow easier machine processing.
+    [[#198](https://github.com/dmajda/pegjs/issues/198)]
+
+  * Implemented a plugin API. The list of plugins to use can be specified using
+    the `plugins` option of the `PEG.buildParser` method or the `--plugin`
+    option on the command-line. Also implemented the `--extra-options` and
+    `--extra-options-file` command-line options, which are mainly useful to pass
+    additional options to plugins.
+    [[#106](https://github.com/dmajda/pegjs/issues/106)]
+
+  * Made `offset`, `line` and `column` functions, not variables. They are now
+    available in all parsers and return lazily-computed position data. Removed
+    now useless `trackLineAndColumn` option of the `PEG.buildParser` method and
+    the `--track-line-and-column` option on the command-line.
+
+  * Added a new `text` function. When called inside an action, it returns the
+    text matched by action's expression.
+    [[#131](https://github.com/dmajda/pegjs/issues/131)]
+
+  * Added a new `$` operator. It extracts matched strings from expressions.
+
+  * The `?` operator now returns `null` on unsuccessful match.
+
+  * Predicates now always return `undefined`.
+
+  * Replaced the `startRule` parameter of the `parse` method in generated
+    parsers with more generic `options` parameter. The start rule can now be
+    specified as the `startRule` option. The `options` parameter can be also
+    used to pass custom options to the parser because it is visible as the
+    `options` variable inside parser code.
+    [[#37](https://github.com/dmajda/pegjs/issues/37)]
+
+  * The list of allowed start rules of a generated parser now has to be
+    specified explicitly using the `allowedStartRules` option of the
+    `PEG.buildParser` method or the `--allowed-start-rule` option on the
+    command-line. This will make certain optimizations like rule inlining easier
+    in the future.
+
+  * Removed the `toSource` method of generated parsers and introduced a new
+    `output` option of the `PEG.buildParser` method. It allows callers to
+    specify whether they want to get back the parser object or its source code.
+
+  * The source code is now a valid npm package. This makes using development
+    versions easier.
+    [[#32](https://github.com/dmajda/pegjs/issues/32)]
+
+  * Generated parsers are now ~25% faster and ~62%/~3% smaller (when optimized
+    for size/speed) than those generated by 0.7.0.
+
+  * Requires Node.js 0.8.0+.
+
+### Small Changes
+
+  * `bin/pegjs` now outputs just the parser source if the value of the
+    `--export-var` option is empty. This makes embedding generated parsers into
+    other files easier.
+    [[#143](https://github.com/dmajda/pegjs/issues/143)]
+
+  * Changed the value of the `name` property of `PEG.GrammarError` instances
+    from \u201cPEG.GrammarError\u201d to just \u201cGrammarError\u201d. This better reflects the
+    fact that PEG.js can get required with different variable name than `PEG`.
+
+  * Setup prototype chain for `PEG.GrammarError` correctly.
+
+  * Setup prototype chain for `SyntaxError` in generated parsers correctly.
+
+  * Fixed error messages in certain cases with trailing input
+    [[#119](https://github.com/dmajda/pegjs/issues/119)]
+
+  * Fixed code generated for classes starting with `\^`.
+    [[#125](https://github.com/dmajda/pegjs/issues/125)]
+
+  * Fixed too eager proxy rules removal.
+    [[#137](https://github.com/dmajda/pegjs/issues/137)]
+
+  * Added a license to all vendored libraries.
+    [[#207](https://github.com/dmajda/pegjs/issues/207)]
+
+  * Converted the test suite from QUnit to Jasmine, cleaning it up on the way.
+
+  * Travis CI integration.
+
+  * Various internal code improvements and fixes.
+
+  * Various generated code improvements and fixes.
+
+  * Various example grammar improvements and fixes.
+
+  * Improved `README.md`.
+
+  * Converted `CHANGELOG` to Markdown.
+
+0.7.0
+-----
+
+Released: April 18, 2012
+
+### Big Changes
+
+  * Added ability to pass options to `PEG.buildParser`.
+
+  * Implemented the `trackLineAndColumn` option for `PEG.buildParser` (together
+    with the `--track-line-and-column` command-line option). It makes the
+    generated parser track line and column during parsing. These are made
+    available inside actions and predicates as `line` and `column` variables.
+
+  * Implemented the `cache` option for `PEG.buildParser` (together with the
+    `--cache` command-line option). This option enables/disables the results
+    cache in generated parsers, resulting in dramatic speedup when the cache is
+    disabled (the default now). The cost is breaking the linear parsing time
+    guarantee.
+
+  * The current parse position is visible inside actions and predicates as the
+    `offset` variable.
+
+  * Exceptions thrown by the parser have `offset`, `expected` and `found`
+    properties containing machine-readable information about the parse failure
+    (based on a patch by Marcin Stefaniuk).
+
+  * Semantic predicates have access to preceding labels.
+    [[GH-69](https://github.com/dmajda/pegjs/issues/69)]
+
+  * Implemented case-insensitive literal and class matching.
+    [[GH-34](https://github.com/dmajda/pegjs/issues/34)]
+
+  * Rewrote the code generator \u2014 split some computations into separate passes
+    and based it on a proper templating system (Codie).
+
+  * Rewrote variable handling in generated parsers in a stack-like fashion,
+    simplifying the code and making the parsers smaller and faster.
+
+  * Adapted to Node.js 0.6.6+ (no longer supported in older versions).
+
+  * Dropped support for IE < 8.
+
+  * As a result of several optimizations, parsers generated by 0.7.0 are ~6.4
+    times faster and ~19% smaller than those generated by 0.6.2 (as reported by
+    `/tools/impact`).
+
+### Small Changes
+
+  * Fixed reported error position when part of the input is not consumed.
+    [[GH-48](https://github.com/dmajda/pegjs/issues/48)]
+
+  * Fixed incorrect disjunction operator in `computeErrorPosition` (original
+    patch by Wolfgang Kluge).
+
+  * Fixed regexp for detecting command-line options in `/bin/pegjs`.
+    [[GH-51](https://github.com/dmajda/pegjs/issues/51)]
+
+  * Generate more efficient code for empty literals (original patch by Wolfgang
+    Kluge).
+
+  * Fixed comment typos (patches by Wolfgang Kluge and Jason Davies).
+    [[GH-59](https://github.com/dmajda/pegjs/issues/59)]
+
+  * Fixed a typo in JavaScript example grammar.
+    [[GH-62](https://github.com/dmajda/pegjs/issues/62)]
+
+  * Made copy & paste inclusion of the PEG.js library into another code easier
+    by changing how the library is exported.
+
+  * Improved the copyright comment and the \u201cGenerated by...\u201d header.
+
+  * Replaced `Jakefile` with `Makefile`.
+
+  * Added `make hint` task that checks all JavaScript files using JSHint and
+    resolved all issues it reported. All JavaScript files and also generated
+    parsers are JSHint-clean now.
+
+  * Fixed output printed during test failures (expected value was being printed
+    instead of the actual one). Original patch by Wolfgang Kluge.
+
+  * Added a `/tools/impact` script to measure speed and size impact of commits.
+
+  * Various generated code improvements and fixes.
+
+  * Various internal code improvements and fixes.
+
+  * Improved `README.md`.
+
+0.6.2
+-----
+
+Released: August 20, 2011
+
+### Small Changes
+
+  * Reset parser position when action returns `null`.
+
+  * Fixed typo in JavaScript example grammar.
+
+0.6.1
+-----
+
+Released: April 14, 2011
+
+### Small Changes
+
+  * Use `--ascii` option when generating a minified version.
+
+0.6.0
+-----
+
+Released: April 14, 2011
+
+### Big Changes
+
+  * Rewrote the command-line mode to be based on Node.js instead of Rhino \u2014 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-line one in two
+    flavors (normal and minified).
+
+  * Parser variable name is no longer required argument of `bin/pegjs` \u2014 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 \u2014 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 \u2014 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 \u201cGenerated by...\u201d 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
+-----
+
+Released: November 28, 2010
+
+### Small Changes
+
+  * Fixed a problem where \u201cSyntaxError: Invalid range in character class.\u201d error
+    appeared when using command-line version on Widnows
+    ([GH-13](https://github.com/dmajda/pegjs/issues/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
+---
+
+Released: June 10, 2010
+
+### 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 \u2014 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 \u201cGenerated by ...\u201d 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](https://github.com/dmajda/pegjs/issues/1)).
+
+  * Fixed bug causing incorrect error messages
+    ([issue #2](https://github.com/dmajda/pegjs/issues/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
+---
+
+Released: April 17, 2010
+
+### Big Changes
+
+  * Improved IE compatibility \u2014 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
+---
+
+Released: March 14, 2010
+
+  * 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` \u2192 `parser_var`.
+
+  * Internal code improvements.
+
+0.2.1
+-----
+
+Released: March 8, 2010
+
+  * Added `pegjs-` prefix to the name of the minified runtime file.
+
+0.2
+---
+
+Released: March 8, 2010
+
+  * 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
+---
+
+Released: March 8, 2010
+
+  * Initial release.

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/0d465c30/node_modules/pegjs/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/pegjs/LICENSE b/node_modules/pegjs/LICENSE
index 48ab3e5..89232b5 100644
--- a/node_modules/pegjs/LICENSE
+++ b/node_modules/pegjs/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2010-2011 David Majda
+Copyright (c) 2010-2015 David Majda
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/0d465c30/node_modules/pegjs/README.md
----------------------------------------------------------------------
diff --git a/node_modules/pegjs/README.md b/node_modules/pegjs/README.md
index 7a4c17e..52ca9f2 100644
--- a/node_modules/pegjs/README.md
+++ b/node_modules/pegjs/README.md
@@ -1,7 +1,10 @@
 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.
+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
 --------
@@ -9,33 +12,48 @@ 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 \u2014 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
+  * Based on [parsing expression
+    grammar](http://en.wikipedia.org/wiki/Parsing_expression_grammar) formalism
+    \u2014 more powerful than traditional LL(*k*) and LR(*k*) parsers
+  * Usable [from your browser](http://pegjs.org/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.
+[Online version](http://pegjs.org/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
+### Node.js
 
-To use command-line version, install [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) first. You can then install PEG.js:
+To use the `pegjs` command, install PEG.js globally:
+
+    $ npm install -g pegjs
+
+To use the JavaScript API, install PEG.js locally:
 
     $ 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.
+If you need both the `pegjs` command and the JavaScript API, install PEG.js both
+ways.
 
 ### 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 `<script>` tag.
+[Download](http://pegjs.org/#download) the PEG.js library (regular or minified
+version) or install it using Bower:
+
+    $ bower install pegjs
 
 Generating a Parser
 -------------------
 
-PEG.js generates parser from a grammar that describes expected input and can specify what the parser returns (using semantic actions on matched parts of the input). Generated parser itself is a JavaScript object with a simple API.
+PEG.js generates parser from a grammar that describes expected input and can
+specify what the parser returns (using semantic actions on matched parts of the
+input). Generated parser itself is a JavaScript object with a simple API.
 
 ### Command Line
 
@@ -43,13 +61,31 @@ To generate a parser from your grammar, use the `pegjs` command:
 
     $ pegjs arithmetics.pegjs
 
-This writes parser source code into a file with the same name as the grammar file but with \u201c.js\u201d extension. You can also specify the output file explicitly:
+This writes parser source code into a file with the same name as the grammar
+file but with \u201c.js\u201d extension. You can also specify the output file explicitly:
 
     $ pegjs arithmetics.pegjs arithmetics-parser.js
 
-If you omit both input and ouptut file, standard input and output are used.
+If you omit both input and output file, standard input and output are used.
 
-By default, the parser object is assigned to `module.exports`, which makes the output a Node.js module. You can assign it to another variable by passing a variable name using the `-e`/`--export-var` option. This may be helpful if you want to use the parser in browser environment.
+By default, the parser object is assigned to `module.exports`, which makes the
+output a Node.js module. You can assign it to another variable by passing a
+variable name using the `-e`/`--export-var` option. This may be helpful if you
+want to use the parser in browser environment.
+
+You can tweak the generated parser with several options:
+
+  * `--cache` \u2014 makes the parser cache results, avoiding exponential parsing
+    time in pathological cases but making the parser slower
+  * `--allowed-start-rules` \u2014 comma-separated list of rules the parser will be
+    allowed to start parsing from (default: the first rule in the grammar)
+  * `--plugin` \u2014 makes PEG.js use a specified plugin (can be specified multiple
+    times)
+  * `--extra-options` \u2014 additional options (in JSON format) to pass to
+    `PEG.buildParser`
+  * `--extra-options-file` \u2014 file with additional options (in JSON format) to
+    pass to `PEG.buildParser`
+  * `--trace` \u2014 makes the parser trace its progress
 
 ### JavaScript API
 
@@ -57,33 +93,64 @@ In Node.js, require the PEG.js parser generator module:
 
     var PEG = require("pegjs");
 
-In browser, include the PEG.js library in your web page or application using the `<script>` tag. The API will be available through the `PEG` global object.
+In browser, include the PEG.js library in your web page or application using the
+`<script>` tag. The API will be available in the `PEG` global object.
 
-To generate a parser, call the `PEG.buildParser` method and pass your grammar as a parameter:
+To generate a parser, call the `PEG.buildParser` method and pass your grammar as
+a parameter:
 
     var parser = PEG.buildParser("start = ('a' / 'b')+");
 
-The method will return generated parser object or throw an exception if the grammar is invalid. The exception will contain `message` property with more details about the error.
-
-To get parser\u2019s source code, call the `toSource` method on the parser.
+The method will return generated parser object or its source code as a string
+(depending on the value of the `output` option \u2014 see below). It will throw an
+exception if the grammar is invalid. The exception will contain `message`
+property with more details about the error.
+
+You can tweak the generated parser by passing a second parameter with an options
+object to `PEG.buildParser`. The following options are supported:
+
+  * `cache` \u2014 if `true`, makes the parser cache results, avoiding exponential
+    parsing time in pathological cases but making the parser slower (default:
+    `false`)
+  * `allowedStartRules` \u2014 rules the parser will be allowed to start parsing from
+    (default: the first rule in the grammar)
+  * `output` \u2014 if set to `"parser"`, the method will return generated parser
+    object; if set to `"source"`, it will return parser source code as a string
+    (default: `"parser"`)
+  * `optimize`\u2014 selects between optimizing the generated parser for parsing
+    speed (`"speed"`) or code size (`"size"`) (default: `"speed"`)
+  * `plugins` \u2014 plugins to use
 
 Using the Parser
 ----------------
 
-Using the generated parser is simple \u2014 just call its `parse` method and pass an input string as a parameter. The method will return a parse result (the exact value depends on the grammar used to build the parser) or throw an exception if the input is invalid. The exception will contain `line`, `column` and `message` properties with more details about the error.
+Using the generated parser is simple \u2014 just call its `parse` method and pass an
+input string as a parameter. The method will return a parse result (the exact
+value depends on the grammar used to build the parser) or throw an exception if
+the input is invalid. The exception will contain `location`, `expected`, `found`
+and `message` properties with more details about the error.
 
     parser.parse("abba"); // returns ["a", "b", "b", "a"]
 
     parser.parse("abcd"); // throws an exception
 
-You can also start parsing from a specific rule in the grammar. Just pass the rule name to the `parse` method as a second parameter.
+You can tweak parser behavior by passing a second parameter with an options
+object to the `parse` method. The following options are supported:
+
+  * `startRule` \u2014 name of the rule to start parsing from
+  * `tracer` \u2014 tracer to use
+
+Parsers can also support their own custom options.
 
 Grammar Syntax and Semantics
 ----------------------------
 
-The grammar syntax is similar to JavaScript in that it is not line-oriented and ignores whitespace between tokens. You can also use JavaScript-style comments (`// ...` and `/* ... */`).
+The grammar syntax is similar to JavaScript in that it is not line-oriented and
+ignores whitespace between tokens. You can also use JavaScript-style comments
+(`// ...` and `/* ... */`).
 
-Let's look at example grammar that recognizes simple arithmetic expressions like `2*(3+4)`. A parser generated from this grammar computes their values.
+Let's look at example grammar that recognizes simple arithmetic expressions like
+`2*(3+4)`. A parser generated from this grammar computes their values.
 
     start
       = additive
@@ -103,32 +170,95 @@ Let's look at example grammar that recognizes simple arithmetic expressions like
     integer "integer"
       = digits:[0-9]+ { return parseInt(digits.join(""), 10); }
 
-On the top level, the grammar consists of *rules* (in our example, there are five of them). Each rule has a *name* (e.g. `integer`) that identifies the rule, and a *parsing expression* (e.g. `digits:[0-9]+ { return parseInt(digits.join(""), 10); }`) that defines a pattern to match against the input text and possibly contains some JavaScript code that determines what happens when the pattern matches successfully. A rule can also contain *human-readable name* that is used in error messages (in our example, only the `integer` rule has a human-readable name). The parsing starts at the first rule, which is also called the *start rule*.
-
-A rule name must be a JavaScript identifier. It is followed by an equality sign (\u201c=\u201d) and a parsing expression. If the rule has a human-readable name, it is written as a JavaScript string between the name and separating equality sign. Rules need to be separated only by whitespace (their beginning is easily recognizable), but a semicolon (\u201c;\u201d) after the parsing expression is allowed.
+On the top level, the grammar consists of *rules* (in our example, there are
+five of them). Each rule has a *name* (e.g. `integer`) that identifies the rule,
+and a *parsing expression* (e.g. `digits:[0-9]+ { return
+parseInt(digits.join(""), 10); }`) that defines a pattern to match against the
+input text and possibly contains some JavaScript code that determines what
+happens when the pattern matches successfully. A rule can also contain
+*human-readable name* that is used in error messages (in our example, only the
+`integer` rule has a human-readable name). The parsing starts at the first rule,
+which is also called the *start rule*.
+
+A rule name must be a JavaScript identifier. It is followed by an equality sign
+(\u201c=\u201d) and a parsing expression. If the rule has a human-readable name, it is
+written as a JavaScript string between the name and separating equality sign.
+Rules need to be separated only by whitespace (their beginning is easily
+recognizable), but a semicolon (\u201c;\u201d) after the parsing expression is allowed.
+
+The first rule can be preceded by an *initializer* \u2014 a piece of JavaScript code
+in curly braces (\u201c{\u201d and \u201c}\u201d). This code is executed before the generated parser
+starts parsing. All variables and functions defined in the initializer are
+accessible in rule actions and semantic predicates. The code inside the
+initializer can access the parser object using the `parser` variable and options
+passed to the parser using the `options` variable. Curly braces in the
+initializer code must be balanced. Let's look at the example grammar from above
+using a simple initializer.
+
+    {
+      function makeInteger(o) {
+        return parseInt(o.join(""), 10);
+      }
+    }
 
-Rules can be preceded by an *initializer* \u2014 a piece of JavaScript code in curly braces (\u201c{\u201d and \u201c}\u201d). This code is executed before the generated parser starts parsing. All variables and functions defined in the initializer are accessible in rule actions and semantic predicates. Curly braces in the initializer code must be balanced.
-
-The parsing expressions of the rules are used to match the input text to the grammar. There are various types of expressions \u2014 matching characters or character classes, indicating optional parts and repetition, etc. Expressions can also contain references to other rules. See detailed description below.
-
-If an expression successfully matches a part of the text when running the generated parser, it produces a *match result*, which is a JavaScript value. For example:
+    start
+      = additive
 
-  * An expression matching a literal string produces a JavaScript string containing matched part of the input.
-  * An expression matching repeated occurrence of some subexpression produces a JavaScript array with all the matches.
+    additive
+      = left:multiplicative "+" right:additive { return left + right; }
+      / multiplicative
 
-The match results propagate through the rules when the rule names are used in expressions, up to the start rule. The generated parser returns start rule's match result when parsing is successful.
+    multiplicative
+      = left:primary "*" right:multiplicative { return left * right; }
+      / primary
 
-One special case of parser expression is a *parser action* \u2014 a piece of JavaScript code inside curly braces (\u201c{\u201d and \u201c}\u201d) that takes match results of some of the the preceding expressions and returns a JavaScript value. This value is considered match result of the preceding expression (in other words, the parser action is a match result transformer).
+    primary
+      = integer
+      / "(" additive:additive ")" { return additive; }
 
-In our arithmetics example, there are many parser actions. Consider the action in expression `digits:[0-9]+ { return parseInt(digits.join(""), 10); }`. It takes the match result of the expression [0-9]+, which is an array of strings containing digits, as its parameter. It joins the digits together to form a number and converts it to a JavaScript `number` object.
+    integer "integer"
+      = digits:[0-9]+ { return makeInteger(digits); }
+
+The parsing expressions of the rules are used to match the input text to the
+grammar. There are various types of expressions \u2014 matching characters or
+character classes, indicating optional parts and repetition, etc. Expressions
+can also contain references to other rules. See detailed description below.
+
+If an expression successfully matches a part of the text when running the
+generated parser, it produces a *match result*, which is a JavaScript value. For
+example:
+
+  * An expression matching a literal string produces a JavaScript string
+    containing matched part of the input.
+  * An expression matching repeated occurrence of some subexpression produces a
+    JavaScript array with all the matches.
+
+The match results propagate through the rules when the rule names are used in
+expressions, up to the start rule. The generated parser returns start rule's
+match result when parsing is successful.
+
+One special case of parser expression is a *parser action* \u2014 a piece of
+JavaScript code inside curly braces (\u201c{\u201d and \u201c}\u201d) that takes match results of
+some of the the preceding expressions and returns a JavaScript value. This value
+is considered match result of the preceding expression (in other words, the
+parser action is a match result transformer).
+
+In our arithmetics example, there are many parser actions. Consider the action
+in expression `digits:[0-9]+ { return parseInt(digits.join(""), 10); }`. It
+takes the match result of the expression [0-9]+, which is an array of strings
+containing digits, as its parameter. It joins the digits together to form a
+number and converts it to a JavaScript `number` object.
 
 ### Parsing Expression Types
 
-There are several types of parsing expressions, some of them containing subexpressions and thus forming a recursive structure:
+There are several types of parsing expressions, some of them containing
+subexpressions and thus forming a recursive structure:
 
 #### "*literal*"<br>'*literal*'
 
-Match exact literal string and return it. The string syntax is the same as in JavaScript.
+Match exact literal string and return it. The string syntax is the same as in
+JavaScript. Appending `i` right after the literal makes the match
+case-insensitive.
 
 #### .
 
@@ -136,7 +266,12 @@ Match exactly one character and return it as a string.
 
 #### [*characters*]
 
-Match one character from a set and return it as a string. The characters in the list can be escaped in exactly the same way as in JavaScript string. The list of characters can also contain ranges (e.g. `[a-z]` means \u201call lowercase letters\u201d). Preceding the characters with `^` inverts the matched set (e.g. `[^a-z]` means \u201call character but lowercase letters\u201d).
+Match one character from a set and return it as a string. The characters in the
+list can be escaped in exactly the same way as in JavaScript string. The list of
+characters can also contain ranges (e.g. `[a-z]` means \u201call lowercase letters\u201d).
+Preceding the characters with `^` inverts the matched set (e.g. `[^a-z]` means
+\u201call character but lowercase letters\u201d). Appending `i` right after the right
+bracket makes the match case-insensitive.
 
 #### *rule*
 
@@ -148,65 +283,172 @@ Match a subexpression and return its match result.
 
 #### *expression* \*
 
-Match zero or more repetitions of the expression and return their match results in an array. The matching is greedy, i.e. the parser tries to match the expression as many times as possible.
+Match zero or more repetitions of the expression and return their match results
+in an array. The matching is greedy, i.e. the parser tries to match the
+expression as many times as possible. Unlike in regular expressions, there is no
+backtracking.
 
 #### *expression* +
 
-Match one or more repetitions of the expression and return their match results in an array. The matching is greedy, i.e. the parser tries to match the expression as many times as possible.
+Match one or more repetitions of the expression and return their match results
+in an array. The matching is greedy, i.e. the parser tries to match the
+expression as many times as possible. Unlike in regular expressions, there is no
+backtracking.
 
 #### *expression* ?
 
-Try to match the expression. If the match succeeds, return its match result, otherwise return an empty string.
+Try to match the expression. If the match succeeds, return its match result,
+otherwise return `null`. Unlike in regular expressions, there is no
+backtracking.
 
 #### & *expression*
 
-Try to match the expression. If the match succeeds, just return an empty string and do not advance the parser position, otherwise consider the match failed.
+Try to match the expression. If the match succeeds, just return `undefined` and
+do not advance the parser position, otherwise consider the match failed.
 
 #### ! *expression*
 
-Try to match the expression and. If the match does not succeed, just return an empty string and do not advance the parser position, otherwise consider the match failed.
+Try to match the expression. If the match does not succeed, just return
+`undefined` and do not advance the parser position, otherwise consider the match
+failed.
 
 #### & { *predicate* }
 
-The predicate is a piece of JavaScript code that is executed as if it was inside a function. It should return some JavaScript value using the `return` statement. If the returned value evaluates to `true` in boolean context, just return an empty string and do not advance the parser position; otherwise consider the match failed.
+The predicate is a piece of JavaScript code that is executed as if it was inside
+a function. It gets the match results of labeled expressions in preceding
+expression as its arguments. It should return some JavaScript value using the
+`return` statement. If the returned value evaluates to `true` in boolean
+context, just return `undefined` and do not advance the parser position;
+otherwise consider the match failed.
 
-The code inside the predicate has access to all variables and functions defined in the initializer at the beginning of the grammar. Curly braces in the predicate code must be balanced.
+The code inside the predicate can access all variables and functions defined in
+the initializer at the beginning of the grammar.
+
+The code inside the predicate can also access location information using the
+`location` function. It returns an object like this:
+
+    {
+      start: { offset: 23, line: 5, column: 6 },
+      end:   { offset: 23, line: 5, column: 6 }
+    }
+
+The `start` and `end` properties both refer to the current parse position. The
+`offset` property contains an offset as a zero-based index and `line` and
+`column` properties contain a line and a column as one-based indices.
+
+The code inside the predicate can also access the parser object using the
+`parser` variable and options passed to the parser using the `options` variable.
+
+Note that curly braces in the predicate code must be balanced.
 
 #### ! { *predicate* }
 
-The predicate is a piece of JavaScript code that is executed as if it was inside a function. It should return some JavaScript value using the `return` statement. If the returned value evaluates to `false` in boolean context, just return an empty string and do not advance the parser position; otherwise consider the match failed.
+The predicate is a piece of JavaScript code that is executed as if it was inside
+a function. It gets the match results of labeled expressions in preceding
+expression as its arguments. It should return some JavaScript value using the
+`return` statement. If the returned value evaluates to `false` in boolean
+context, just return `undefined` and do not advance the parser position;
+otherwise consider the match failed.
+
+The code inside the predicate can access all variables and functions defined in
+the initializer at the beginning of the grammar.
+
+The code inside the predicate can also access location information using the
+`location` function. It returns an object like this:
+
+    {
+      start: { offset: 23, line: 5, column: 6 },
+      end:   { offset: 23, line: 5, column: 6 }
+    }
+
+The `start` and `end` properties both refer to the current parse position. The
+`offset` property contains an offset as a zero-based index and `line` and
+`column` properties contain a line and a column as one-based indices.
+
+The code inside the predicate can also access the parser object using the
+`parser` variable and options passed to the parser using the `options` variable.
+
+Note that curly braces in the predicate code must be balanced.
 
-The code inside the predicate has access to all variables and functions defined in the initializer at the beginning of the grammar. Curly braces in the predicate code must be balanced.
+#### $ *expression*
+
+Try to match the expression. If the match succeeds, return the matched string
+instead of the match result.
 
 #### *label* : *expression*
 
-Match the expression and remember its match result under given lablel. The label must be a JavaScript identifier.
+Match the expression and remember its match result under given label. The label
+must be a JavaScript identifier.
 
-Labeled expressions are useful together with actions, where saved match results can be accessed by action's JavaScript code.
+Labeled expressions are useful together with actions, where saved match results
+can be accessed by action's JavaScript code.
 
-#### *expression<sub>1</sub>* *expression<sub>2</sub>* ... *expression<sub>n</sub>*
+#### *expression<sub>1</sub>* *expression<sub>2</sub>* ...  *expression<sub>n</sub>*
 
 Match a sequence of expressions and return their match results in an array.
 
 #### *expression* { *action* }
 
-Match the expression. If the match is successful, run the action, otherwise consider the match failed.
+Match the expression. If the match is successful, run the action, otherwise
+consider the match failed.
+
+The action is a piece of JavaScript code that is executed as if it was inside a
+function. It gets the match results of labeled expressions in preceding
+expression as its arguments. The action should return some JavaScript value
+using the `return` statement. This value is considered match result of the
+preceding expression.
+
+To indicate an error, the code inside the action can invoke the `expected`
+function, which makes the parser throw an exception. The function takes one
+parameter \u2014 a description of what was expected at the current position. This
+description will be used as part of a message of the thrown exception.
+
+The code inside an action can also invoke the `error` function, which also makes
+the parser throw an exception. The function takes one parameter \u2014 an error
+message. This message will be used by the thrown exception.
+
+The code inside the action can access all variables and functions defined in the
+initializer at the beginning of the grammar. Curly braces in the action code
+must be balanced.
+
+The code inside the action can also access the string matched by the expression
+using the `text` function.
 
-The action is a piece of JavaScript code that is executed as if it was inside a function. It gets the match results of labeled expressions in preceding expression as its arguments. The action should return some JavaScript value using the `return` statement. This value is considered match result of the preceding expression. The action can return `null` to indicate a match failure.
 
-The code inside the action has access to all variables and functions defined in the initializer at the beginning of the grammar. Curly braces in the action code must be balanced.
+The code inside the action can also access location information using the
+`location` function. It returns an object like this:
+
+    {
+      start: { offset: 23, line: 5, column: 6 },
+      end:   { offset: 25, line: 5, column: 8 }
+    }
+
+The `start` property refers to the position at the beginning of the expression,
+the `end` property refers to position after the end of the expression. The
+`offset` property contains an offset as a zero-based index and `line` and
+`column` properties contain a line and a column as one-based indices.
+
+The code inside the action can also access the parser object using the `parser`
+variable and options passed to the parser using the `options` variable.
+
+Note that curly braces in the action code must be balanced.
 
 #### *expression<sub>1</sub>* / *expression<sub>2</sub>* / ... / *expression<sub>n</sub>*
 
-Try to match the first expression, if it does not succeed, try the second one, etc. Return the match result of the first successfully matched expression. If no expression matches, consider the match failed.
+Try to match the first expression, if it does not succeed, try the second one,
+etc. Return the match result of the first successfully matched expression. If no
+expression matches, consider the match failed.
 
 Compatibility
 -------------
 
-Both the parser generator and generated parsers should run well in the following environments:
+Both the parser generator and generated parsers should run well in the following
+environments:
 
-  * Node.js 0.4.4+
-  * IE 6+
+  * Node.js 0.10.0+
+  * io.js
+  * Internet Explorer 8+
+  * Edge
   * Firefox
   * Chrome
   * Safari
@@ -215,12 +457,23 @@ Both the parser generator and generated parsers should run well in the following
 Development
 -----------
 
-  * [Project website](https://pegjs.majda.cz/)
-  * [Source code](https://github.com/dmajda/pegjs)
-  * [Issue tracker](https://github.com/dmajda/pegjs/issues)
+  * [Project website](http://pegjs.org/)
+  * [Wiki](https://github.com/pegjs/pegjs/wiki)
+  * [Source code](https://github.com/pegjs/pegjs)
+  * [Trello board](https://trello.com/board/peg-js/50a8eba48cf95d4957006b01)
+  * [Issue tracker](https://github.com/pegjs/pegjs/issues)
   * [Google Group](http://groups.google.com/group/pegjs)
   * [Twitter](http://twitter.com/peg_js)
 
-PEG.js is developed by [David Majda](http://majda.cz/) ([@dmajda](http://twitter.com/dmajda)). You are welcome to contribute code. Unless your contribution is really trivial you should get in touch with me first \u2014 this can prevent wasted effort on both sides. You can send code both as patch or GitHub pull request.
+PEG.js is developed by [David Majda](http://majda.cz/)
+([@dmajda](http://twitter.com/dmajda)). The [Bower
+package](https://github.com/pegjs/bower) is maintained by [Michel
+Kr�mer](http://www.michel-kraemer.com/)
+([@michelkraemer](https://twitter.com/michelkraemer)).
+
+You are welcome to contribute code.  Unless your contribution is really trivial
+you should get in touch with me first \u2014 this can prevent wasted effort on both
+sides. You can send code both as a patch or a GitHub pull request.
 
-Note that PEG.js is still very much work in progress. There are no compatibility guarantees until version 1.0.
+Note that PEG.js is still very much work in progress. There are no compatibility
+guarantees until version 1.0.

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/0d465c30/node_modules/pegjs/VERSION
----------------------------------------------------------------------
diff --git a/node_modules/pegjs/VERSION b/node_modules/pegjs/VERSION
index b616048..ac39a10 100644
--- a/node_modules/pegjs/VERSION
+++ b/node_modules/pegjs/VERSION
@@ -1 +1 @@
-0.6.2
+0.9.0

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/0d465c30/node_modules/pegjs/bin/pegjs
----------------------------------------------------------------------
diff --git a/node_modules/pegjs/bin/pegjs b/node_modules/pegjs/bin/pegjs
index c24246e..e934ed9 100755
--- a/node_modules/pegjs/bin/pegjs
+++ b/node_modules/pegjs/bin/pegjs
@@ -1,30 +1,47 @@
 #!/usr/bin/env node
 
-var sys = require("sys");
-var fs  = require("fs");
-var PEG = require("../lib/peg");
+"use strict";
+
+var fs   = require("fs");
+var path = require("path");
+var PEG  = require("../lib/peg");
 
 /* Helpers */
 
 function printVersion() {
-  sys.puts("PEG.js " + PEG.VERSION);
+  console.log("PEG.js " + PEG.VERSION);
 }
 
 function printHelp() {
-  sys.puts("Usage: pegjs [options] [--] [<input_file>] [<output_file>]");
-  sys.puts("");
-  sys.puts("Generates a parser from the PEG grammar specified in the <input_file> and");
-  sys.puts("writes it to the <output_file>.");
-  sys.puts("");
-  sys.puts("If the <output_file> is omitted, its name is generated by changing the");
-  sys.puts("<input_file> extension to \".js\". If both <input_file> and <output_file> are");
-  sys.puts("omitted, standard input and output are used.");
-  sys.puts("");
-  sys.puts("Options:");
-  sys.puts("  -e, --export-var <variable>  name of the variable where the parser object");
-  sys.puts("                               will be stored (default: \"module.exports\")");
-  sys.puts("  -v, --version                print version information and exit");
-  sys.puts("  -h, --help                   print help and exit");
+  console.log("Usage: pegjs [options] [--] [<input_file>] [<output_file>]");
+  console.log("");
+  console.log("Generates a parser from the PEG grammar specified in the <input_file> and writes");
+  console.log("it to the <output_file>.");
+  console.log("");
+  console.log("If the <output_file> is omitted, its name is generated by changing the");
+  console.log("<input_file> extension to \".js\". If both <input_file> and <output_file> are");
+  console.log("omitted, standard input and output are used.");
+  console.log("");
+  console.log("Options:");
+  console.log("  -e, --export-var <variable>        name of the variable where the parser");
+  console.log("                                     object will be stored (default:");
+  console.log("                                     \"module.exports\")");
+  console.log("      --cache                        make generated parser cache results");
+  console.log("      --allowed-start-rules <rules>  comma-separated list of rules the generated");
+  console.log("                                     parser will be allowed to start parsing");
+  console.log("                                     from (default: the first rule in the");
+  console.log("                                     grammar)");
+  console.log("  -o, --optimize <goal>              select optimization for speed or size");
+  console.log("                                     (default: speed)");
+  console.log("      --trace                        enable tracing in generated parser");
+  console.log("      --plugin <plugin>              use a specified plugin (can be specified");
+  console.log("                                     multiple times)");
+  console.log("      --extra-options <options>      additional options (in JSON format) to pass");
+  console.log("                                     to PEG.buildParser");
+  console.log("      --extra-options-file <file>    file with additional options (in JSON");
+  console.log("                                     format) to pass to PEG.buildParser");
+  console.log("  -v, --version                      print version information and exit");
+  console.log("  -h, --help                         print help and exit");
 }
 
 function exitSuccess() {
@@ -36,16 +53,45 @@ function exitFailure() {
 }
 
 function abort(message) {
-  sys.error(message);
+  console.error(message);
   exitFailure();
 }
 
+function addExtraOptions(options, json) {
+  var extraOptions;
+
+  try {
+    extraOptions = JSON.parse(json);
+  } catch (e) {
+    if (!(e instanceof SyntaxError)) { throw e; }
+
+    abort("Error parsing JSON: " + e.message);
+  }
+  if (typeof extraOptions !== "object") {
+    abort("The JSON with extra options has to represent an object.");
+  }
+
+  for (var key in extraOptions) {
+    if (extraOptions.hasOwnProperty(key)) {
+      options[key] = extraOptions[key];
+    }
+  }
+}
+
+/*
+ * Extracted into a function just to silence JSHint complaining about creating
+ * functions in a loop.
+ */
+function trim(s) {
+  return s.trim();
+}
+
 /* Arguments */
 
 var args = process.argv.slice(2); // Trim "node" and the script path.
 
 function isOption(arg) {
-  return /-.+/.test(arg);
+  return (/^-/).test(arg);
 }
 
 function nextArg() {
@@ -64,6 +110,13 @@ function readStream(inputStream, callback) {
 
 /* This makes the generated parser a CommonJS module by default. */
 var exportVar = "module.exports";
+var options = {
+  cache:    false,
+  output:   "source",
+  optimize: "speed",
+  trace:    false,
+  plugins:  []
+};
 
 while (args.length > 0 && isOption(args[0])) {
   switch (args[0]) {
@@ -76,6 +129,74 @@ while (args.length > 0 && isOption(args[0])) {
       exportVar = args[0];
       break;
 
+    case "--cache":
+      options.cache = true;
+      break;
+
+    case "--allowed-start-rules":
+      nextArg();
+      if (args.length === 0) {
+        abort("Missing parameter of the -e/--allowed-start-rules option.");
+      }
+      options.allowedStartRules = args[0]
+        .split(",")
+        .map(trim);
+      break;
+
+    case "--trace":
+      options.trace = true;
+      break;
+
+    case "-o":
+    case "--optimize":
+      nextArg();
+      if (args.length === 0) {
+        abort("Missing parameter of the -o/--optimize option.");
+      }
+      if (args[0] !== "speed" && args[0] !== "size") {
+        abort("Optimization goal must be either \"speed\" or \"size\".");
+      }
+      options.optimize = args[0];
+      break;
+
+    case "--plugin":
+      nextArg();
+      if (args.length === 0) {
+        abort("Missing parameter of the --plugin option.");
+      }
+      var id = /^(\.\/|\.\.\/)/.test(args[0]) ? path.resolve(args[0]) : args[0];
+      var mod;
+      try {
+        mod = require(id);
+      } catch (e) {
+        if (e.code !== "MODULE_NOT_FOUND") { throw e; }
+
+        abort("Can't load module \"" + id + "\".");
+      }
+      options.plugins.push(mod);
+      break;
+
+    case "--extra-options":
+      nextArg();
+      if (args.length === 0) {
+        abort("Missing parameter of the --extra-options option.");
+      }
+      addExtraOptions(options, args[0]);
+      break;
+
+    case "--extra-options-file":
+      nextArg();
+      if (args.length === 0) {
+        abort("Missing parameter of the --extra-options-file option.");
+      }
+      try {
+        var json = fs.readFileSync(args[0]);
+      } catch(e) {
+        abort("Can't read from file \"" + args[0] + "\".");
+      }
+      addExtraOptions(options, json);
+      break;
+
     case "-v":
     case "--version":
       printVersion();
@@ -100,7 +221,8 @@ while (args.length > 0 && isOption(args[0])) {
 
 switch (args.length) {
   case 0:
-    var inputStream = process.openStdin();
+    process.stdin.resume();
+    var inputStream = process.stdin;
     var outputStream = process.stdout;
     break;
 
@@ -112,7 +234,7 @@ switch (args.length) {
       abort("Can't read from file \"" + inputFile + "\".");
     });
 
-    var outputFile = args.length == 1
+    var outputFile = args.length === 1
       ? args[0].replace(/\.[^.]*$/, ".js")
       : args[1];
     var outputStream = fs.createWriteStream(outputFile);
@@ -127,16 +249,22 @@ switch (args.length) {
 }
 
 readStream(inputStream, function(input) {
+  var source;
+
   try {
-    var parser = PEG.buildParser(input);
+    source = PEG.buildParser(input, options);
   } catch (e) {
-    if (e.line !== undefined && e.column !== undefined) {
-      abort(e.line + ":" + e.column + ": " + e.message);
+    if (e.location !== undefined) {
+      abort(e.location.start.line + ":" + e.location.start.column + ": " + e.message);
     } else {
       abort(e.message);
     }
   }
 
-  outputStream.write(exportVar + " = " + parser.toSource() + ";\n");
-  outputStream.end();
+  outputStream.write(
+    exportVar !== "" ? exportVar + " = " + source + ";\n" : source + "\n"
+  );
+  if (outputStream !== process.stdout) {
+    outputStream.end();
+  }
 });

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/0d465c30/node_modules/pegjs/examples/arithmetics.pegjs
----------------------------------------------------------------------
diff --git a/node_modules/pegjs/examples/arithmetics.pegjs b/node_modules/pegjs/examples/arithmetics.pegjs
index 52fae2a..597f7d4 100644
--- a/node_modules/pegjs/examples/arithmetics.pegjs
+++ b/node_modules/pegjs/examples/arithmetics.pegjs
@@ -1,22 +1,44 @@
 /*
- * Classic example grammar, which recognizes simple arithmetic expressions like
- * "2*(3+4)". The parser generated from this grammar then computes their value.
+ * Simple Arithmetics Grammar
+ * ==========================
+ *
+ * Accepts expressions like "2 * (3 + 4)" and computes their value.
  */
 
-start
-  = additive
+{
+  function combine(first, rest, combiners) {
+    var result = first, i;
 
-additive
-  = left:multiplicative "+" right:additive { return left + right; }
-  / multiplicative
+    for (i = 0; i < rest.length; i++) {
+      result = combiners[rest[i][1]](result, rest[i][3]);
+    }
 
-multiplicative
-  = left:primary "*" right:multiplicative { return left * right; }
-  / primary
+    return result;
+  }
+}
 
-primary
-  = integer
-  / "(" additive:additive ")" { return additive; }
+Expression
+  = first:Term rest:(_ ("+" / "-") _ Term)* {
+      return combine(first, rest, {
+        "+": function(left, right) { return left + right; },
+        "-": function(left, right) { return left - right; }
+      });
+    }
 
-integer "integer"
-  = digits:[0-9]+ { return parseInt(digits.join(""), 10); }
+Term
+  = first:Factor rest:(_ ("*" / "/") _ Factor)* {
+      return combine(first, rest, {
+        "*": function(left, right) { return left * right; },
+        "/": function(left, right) { return left / right; }
+      });
+    }
+
+Factor
+  = "(" _ expr:Expression _ ")" { return expr; }
+  / Integer
+
+Integer "integer"
+  = [0-9]+ { return parseInt(text(), 10); }
+
+_ "whitespace"
+  = [ \t\n\r]*

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/0d465c30/node_modules/pegjs/examples/css.pegjs
----------------------------------------------------------------------
diff --git a/node_modules/pegjs/examples/css.pegjs b/node_modules/pegjs/examples/css.pegjs
index 5593d3c..24f9298 100644
--- a/node_modules/pegjs/examples/css.pegjs
+++ b/node_modules/pegjs/examples/css.pegjs
@@ -1,96 +1,119 @@
 /*
- * CSS parser based on the grammar described at http://www.w3.org/TR/CSS2/grammar.html.
+ * CSS Grammar
+ * ===========
  *
- * The parser builds a tree representing the parsed CSS, composed of basic
- * JavaScript values, arrays and objects (basically JSON). It can be easily
- * used by various CSS processors, transformers, etc.
+ * Based on grammar from CSS 2.1 specification [1] (including the errata [2]).
+ * Generated parser builds a syntax tree composed of nested JavaScript objects,
+ * vaguely inspired by CSS DOM [3]. The CSS DOM itself wasn't used as it is not
+ * expressive enough (e.g. selectors are reflected as text, not structured
+ * objects) and somewhat cumbersome.
  *
- * Note that the parser does not handle errors in CSS according to the
- * specification -- many errors which it should recover from (e.g. malformed
- * declarations or unexpected end of stylesheet) are simply fatal. This is a
- * result of straightforward rewrite of the CSS grammar to PEG.js and it should
- * be fixed sometimes.
+ * Limitations:
+ *
+ *   * Many errors which should be recovered from according to the specification
+ *     (e.g. malformed declarations or unexpected end of stylesheet) are fatal.
+ *     This is a result of straightforward rewrite of the CSS grammar to PEG.js.
+ *
+ * [1] http://www.w3.org/TR/2011/REC-CSS2-20110607
+ * [2] http://www.w3.org/Style/css2-updates/REC-CSS2-20110607-errata.html
+ * [3] http://www.w3.org/TR/DOM-Level-2-Style/css.html
  */
 
-/* ===== Syntactical Elements ===== */
+{
+  function extractOptional(optional, index) {
+    return optional ? optional[index] : null;
+  }
+
+  function extractList(list, index) {
+    var result = [], i;
+
+    for (i = 0; i < list.length; i++) {
+      if (list[i][index] !== null) {
+        result.push(list[i][index]);
+      }
+    }
+
+    return result;
+  }
+
+  function buildList(first, rest, index) {
+    return (first !== null ? [first] : []).concat(extractList(rest, index));
+  }
+
+  function buildExpression(first, rest) {
+    var result = first, i;
+
+    for (i = 0; i < rest.length; i++) {
+      result = {
+        type:     "Expression",
+        operator: rest[i][0],
+        left:     result,
+        right:    rest[i][1]
+      };
+    }
+
+    return result;
+  }
+}
 
 start
   = stylesheet:stylesheet comment* { return stylesheet; }
 
+/* ----- G.1 Grammar ----- */
+
 stylesheet
   = charset:(CHARSET_SYM STRING ";")? (S / CDO / CDC)*
     imports:(import (CDO S* / CDC S*)*)*
-    rules:((ruleset / media / page) (CDO S* / CDC S*)*)* {
-      var importsConverted = [];
-      for (var i = 0; i < imports.length; i++) {
-        importsConverted.push(imports[i][0]);
-      }
-
-      var rulesConverted = [];
-      for (i = 0; i < rules.length; i++) {
-        rulesConverted.push(rules[i][0]);
-      }
-
+    rules:((ruleset / media / page) (CDO S* / CDC S*)*)*
+    {
       return {
-        type:    "stylesheet",
-        charset: charset !== "" ? charset[1] : null,
-        imports: importsConverted,
-        rules:   rulesConverted
+        type:    "StyleSheet",
+        charset: extractOptional(charset, 1),
+        imports: extractList(imports, 0),
+        rules:   extractList(rules, 0)
       };
     }
 
 import
   = IMPORT_SYM S* href:(STRING / URI) S* media:media_list? ";" S* {
       return {
-        type:  "import_rule",
+        type:  "ImportRule",
         href:  href,
-        media: media !== "" ? media : []
+        media: media !== null ? media : []
       };
     }
 
 media
   = MEDIA_SYM S* media:media_list "{" S* rules:ruleset* "}" S* {
       return {
-        type:  "media_rule",
+        type: "MediaRule",
         media: media,
         rules: rules
       };
     }
 
 media_list
-  = head:medium tail:("," S* medium)* {
-      var result = [head];
-      for (var i = 0; i < tail.length; i++) {
-        result.push(tail[i][2]);
-      }
-      return result;
-    }
+  = first:medium rest:("," S* medium)* { return buildList(first, rest, 2); }
 
 medium
-  = ident:IDENT S* { return ident; }
+  = name:IDENT S* { return name; }
 
 page
-  = PAGE_SYM S* qualifier:pseudo_page?
+  = PAGE_SYM S* selector:pseudo_page?
     "{" S*
-    declarationsHead:declaration?
-    declarationsTail:(";" S* declaration?)*
-    "}" S* {
-      var declarations = declarationsHead !== "" ? [declarationsHead] : [];
-      for (var i = 0; i < declarationsTail.length; i++) {
-        if (declarationsTail[i][2] !== "") {
-          declarations.push(declarationsTail[i][2]);
-        }
-      }
-
+    declarationsFirst:declaration?
+    declarationsRest:(";" S* declaration?)*
+    "}" S*
+    {
       return {
-        type:         "page_rule",
-        qualifier:    qualifier !== "" ? qualifier : null,
-        declarations: declarations
+        type:         "PageRule",
+        selector:     selector,
+        declarations: buildList(declarationsFirst, declarationsRest, 2)
       };
     }
 
 pseudo_page
-  = ":" ident:IDENT S* { return ident; }
+  = ":" value:IDENT S* { return { type: "PseudoSelector", value: value }; }
 
 operator
   = "/" S* { return "/"; }
@@ -100,51 +123,36 @@ combinator
   = "+" S* { return "+"; }
   / ">" S* { return ">"; }
 
-unary_operator
-  = "+"
-  / "-"
-
 property
-  = ident:IDENT S* { return ident; }
+  = name:IDENT S* { return name; }
 
 ruleset
-  = selectorsHead:selector
-    selectorsTail:("," S* selector)*
+  = selectorsFirst:selector
+    selectorsRest:("," S* selector)*
     "{" S*
-    declarationsHead:declaration?
-    declarationsTail:(";" S* declaration?)*
-    "}" S* {
-      var selectors = [selectorsHead];
-      for (var i = 0; i < selectorsTail.length; i++) {
-        selectors.push(selectorsTail[i][2]);
-      }
-
-      var declarations = declarationsHead !== "" ? [declarationsHead] : [];
-      for (i = 0; i < declarationsTail.length; i++) {
-        if (declarationsTail[i][2] !== "") {
-          declarations.push(declarationsTail[i][2]);
-        }
-      }
-
+    declarationsFirst:declaration?
+    declarationsRest:(";" S* declaration?)*
+    "}" S*
+    {
       return {
-        type:         "ruleset",
-        selectors:    selectors,
-        declarations: declarations
+        type:         "RuleSet",
+        selectors:    buildList(selectorsFirst, selectorsRest, 2),
+        declarations: buildList(declarationsFirst, declarationsRest, 2)
       };
     }
 
 selector
   = left:simple_selector S* combinator:combinator right:selector {
       return {
-        type:       "selector",
+        type:       "Selector",
         combinator: combinator,
         left:       left,
         right:      right
       };
     }
-  / left:simple_selector S* right:selector {
+  / left:simple_selector S+ right:selector {
       return {
-        type:       "selector",
+        type:       "Selector",
         combinator: " ",
         left:       left,
         right:      right
@@ -153,51 +161,42 @@ selector
   / selector:simple_selector S* { return selector; }
 
 simple_selector
-  = element:element_name
-    qualifiers:(
-        id:HASH { return { type: "ID selector", id: id.substr(1) }; }
-      / class
-      / attrib
-      / pseudo
-    )* {
+  = element:element_name qualifiers:(id / class / attrib / pseudo)* {
       return {
-        type:       "simple_selector",
+        type:       "SimpleSelector",
         element:    element,
         qualifiers: qualifiers
       };
     }
-  / qualifiers:(
-        id:HASH { return { type: "ID selector", id: id.substr(1) }; }
-      / class
-      / attrib
-      / pseudo
-    )+ {
+  / qualifiers:(id / class / attrib / pseudo)+ {
       return {
-        type:       "simple_selector",
+        type:       "SimpleSelector",
         element:    "*",
         qualifiers: qualifiers
       };
     }
 
+id
+  = id:HASH { return { type: "IDSelector", id: id }; }
+
 class
-  = "." class_:IDENT { return { type: "class_selector", "class": class_ }; }
+  = "." class_:IDENT { return { type: "ClassSelector", "class": class_ }; }
 
 element_name
-  = IDENT / '*'
+  = IDENT
+  / "*"
 
 attrib
   = "[" S*
     attribute:IDENT S*
-    operatorAndValue:(
-      ('=' / INCLUDES / DASHMATCH) S*
-      (IDENT / STRING) S*
-    )?
-    "]" {
+    operatorAndValue:(("=" / INCLUDES / DASHMATCH) S* (IDENT / STRING) S*)?
+    "]"
+    {
       return {
-        type:      "attribute_selector",
+        type:      "AttributeSelector",
         attribute: attribute,
-        operator:  operatorAndValue !== "" ? operatorAndValue[0] : null,
-        value:     operatorAndValue !== "" ? operatorAndValue[2] : null
+        operator:  extractOptional(operatorAndValue, 0),
+        value:     extractOptional(operatorAndValue, 2)
       };
     }
 
@@ -206,31 +205,22 @@ pseudo
     value:(
         name:FUNCTION S* params:(IDENT S*)? ")" {
           return {
-            type:   "function",
+            type:   "Function",
             name:   name,
-            params: params !== "" ? [params[0]] : []
+            params: params !== null ? [params[0]] : []
           };
         }
       / IDENT
-    ) {
-      /*
-       * The returned object has somewhat vague property names and values because
-       * the rule matches both pseudo-classes and pseudo-elements (they look the
-       * same at the syntactic level).
-       */
-      return {
-        type:  "pseudo_selector",
-        value: value
-      };
-    }
+    )
+    { return { type: "PseudoSelector", value: value }; }
 
 declaration
-  = property:property ":" S* expression:expr important:prio? {
+  = name:property ':' S* value:expr prio:prio? {
       return {
-        type:       "declaration",
-        property:   property,
-        expression: expression,
-        important:  important !== "" ? true : false
+        type:      "Declaration",
+        name:      name,
+        value:     value,
+        important: prio !== null
       };
     }
 
@@ -238,93 +228,68 @@ prio
   = IMPORTANT_SYM S*
 
 expr
-  = head:term tail:(operator? term)* {
-      var result = head;
-      for (var i = 0; i < tail.length; i++) {
-        result = {
-          type:     "expression",
-          operator: tail[i][0],
-          left:     result,
-          right:    tail[i][1]
-        };
-      }
-      return result;
-    }
+  = first:term rest:(operator? term)* { return buildExpression(first, rest); }
 
 term
-  = operator:unary_operator?
-    value:(
-        EMS S*
-      / EXS S*
-      / LENGTH S*
-      / ANGLE S*
-      / TIME S*
-      / FREQ S*
-      / PERCENTAGE S*
-      / NUMBER S*
-    )               { return { type: "value",  value: operator + value[0] }; }
-  / value:URI S*    { return { type: "uri",    value: value               }; }
+  = quantity:(PERCENTAGE / LENGTH / EMS / EXS / ANGLE / TIME / FREQ / NUMBER)
+    S*
+    {
+      return {
+        type:  "Quantity",
+        value: quantity.value,
+        unit:  quantity.unit
+      };
+    }
+  / value:STRING S* { return { type: "String", value: value }; }
+  / value:URI S*    { return { type: "URI",    value: value }; }
   / function
   / hexcolor
-  / value:STRING S* { return { type: "string", value: value               }; }
-  / value:IDENT S*  { return { type: "ident",  value: value               }; }
+  / value:IDENT S*  { return { type: "Ident",  value: value }; }
 
 function
   = name:FUNCTION S* params:expr ")" S* {
-      return {
-        type:   "function",
-        name:   name,
-        params: params
-      };
+      return { type: "Function", name: name, params: params };
     }
 
 hexcolor
-  = value:HASH S* { return { type: "hexcolor", value: value}; }
+  = value:HASH S* { return { type: "Hexcolor", value: value }; }
 
-/* ===== Lexical Elements ===== */
+/* ----- G.2 Lexical scanner ----- */
 
 /* Macros */
 
 h
-  = [0-9a-fA-F]
+  = [0-9a-f]i
 
 nonascii
-  = [\x80-\xFF]
+  = [\x80-\uFFFF]
 
 unicode
-  = "\\" h1:h h2:h? h3:h? h4:h? h5:h? h6:h? ("\r\n" / [ \t\r\n\f])? {
-      return String.fromCharCode(parseInt("0x" + h1 + h2 + h3 + h4 + h5 + h6));
+  = "\\" digits:$(h h? h? h? h? h?) ("\r\n" / [ \t\r\n\f])? {
+      return String.fromCharCode(parseInt(digits, 16));
     }
 
 escape
   = unicode
-  / "\\" char_:[^\r\n\f0-9a-fA-F] { return char_; }
+  / "\\" ch:[^\r\n\f0-9a-f]i { return ch; }
 
 nmstart
-  = [_a-zA-Z]
+  = [_a-z]i
   / nonascii
   / escape
 
 nmchar
-  = [_a-zA-Z0-9-]
+  = [_a-z0-9-]i
   / nonascii
   / escape
 
-integer
-  = digits:[0-9]+ { return parseInt(digits.join("")); }
-
-float
-  = before:[0-9]* "." after:[0-9]+ {
-      return parseFloat(before.join("") + "." + after.join(""));
-    }
-
 string1
-  = '"' chars:([^\n\r\f\\"] / "\\" nl:nl { return nl } / escape)* '"' {
+  = '"' chars:([^\n\r\f\\"] / "\\" nl:nl { return ""; } / escape)* '"' {
       return chars.join("");
     }
 
 string2
-  = "'" chars:([^\n\r\f\\'] / "\\" nl:nl { return nl } / escape)* "'" {
+  = "'" chars:([^\n\r\f\\'] / "\\" nl:nl { return ""; } / escape)* "'" {
       return chars.join("");
     }
 
@@ -332,23 +297,24 @@ comment
   = "/*" [^*]* "*"+ ([^/*] [^*]* "*"+)* "/"
 
 ident
-  = dash:"-"? nmstart:nmstart nmchars:nmchar* {
-      return dash + nmstart + nmchars.join("");
+  = prefix:$"-"? start:nmstart chars:nmchar* {
+      return prefix + start + chars.join("");
     }
 
 name
-  = nmchars:nmchar+ { return nmchars.join(""); }
+  = chars:nmchar+ { return chars.join(""); }
 
 num
-  = float
-  / integer
+  = [+-]? ([0-9]+ / [0-9]* "." [0-9]+) ("e" [+-]? [0-9]+)? {
+      return parseFloat(text());
+    }
 
 string
   = string1
   / string2
 
 url
-  = chars:([!#$%&*-~] / nonascii / escape)* { return chars.join(""); }
+  = chars:([!#$%&*-\[\]-~] / nonascii / escape)* { return chars.join(""); }
 
 s
   = [ \t\r\n\f]+
@@ -362,115 +328,25 @@ nl
   / "\r"
   / "\f"
 
-A
-  = [aA]
-  / "\\" "0"? "0"? "0"? "0"? "41" ("\r\n" / [ \t\r\n\f])? { return "A"; }
-  / "\\" "0"? "0"? "0"? "0"? "61" ("\r\n" / [ \t\r\n\f])? { return "a"; }
-
-C
-  = [cC]
-  / "\\" "0"? "0"? "0"? "0"? "43" ("\r\n" / [ \t\r\n\f])? { return "C"; }
-  / "\\" "0"? "0"? "0"? "0"? "63" ("\r\n" / [ \t\r\n\f])? { return "c"; }
-
-D
-  = [dD]
-  / "\\" "0"? "0"? "0"? "0"? "44" ("\r\n" / [ \t\r\n\f])? { return "D"; }
-  / "\\" "0"? "0"? "0"? "0"? "64" ("\r\n" / [ \t\r\n\f])? { return "d"; }
-
-E
-  = [eE]
-  / "\\" "0"? "0"? "0"? "0"? "45" ("\r\n" / [ \t\r\n\f])? { return "E"; }
-  / "\\" "0"? "0"? "0"? "0"? "65" ("\r\n" / [ \t\r\n\f])? { return "e"; }
-
-G
-  = [gG]
-  / "\\" "0"? "0"? "0"? "0"? "47" ("\r\n" / [ \t\r\n\f])? { return "G"; }
-  / "\\" "0"? "0"? "0"? "0"? "67" ("\r\n" / [ \t\r\n\f])? { return "g"; }
-  / "\\" char_:[gG] { return char_; }
-
-H
-  = h:[hH]
-  / "\\" "0"? "0"? "0"? "0"? "48" ("\r\n" / [ \t\r\n\f])? { return "H"; }
-  / "\\" "0"? "0"? "0"? "0"? "68" ("\r\n" / [ \t\r\n\f])? { return "h"; }
-  / "\\" char_:[hH] { return char_; }
-
-I
-  = i:[iI]
-  / "\\" "0"? "0"? "0"? "0"? "49" ("\r\n" / [ \t\r\n\f])? { return "I"; }
-  / "\\" "0"? "0"? "0"? "0"? "69" ("\r\n" / [ \t\r\n\f])? { return "i"; }
-  / "\\" char_:[iI] { return char_; }
-
-K
-  = [kK]
-  / "\\" "0"? "0"? "0"? "0"? "4" [bB] ("\r\n" / [ \t\r\n\f])? { return "K"; }
-  / "\\" "0"? "0"? "0"? "0"? "6" [bB] ("\r\n" / [ \t\r\n\f])? { return "k"; }
-  / "\\" char_:[kK] { return char_; }
-
-L
-  = [lL]
-  / "\\" "0"? "0"? "0"? "0"? "4" [cC] ("\r\n" / [ \t\r\n\f])? { return "L"; }
-  / "\\" "0"? "0"? "0"? "0"? "6" [cC] ("\r\n" / [ \t\r\n\f])? { return "l"; }
-  / "\\" char_:[lL] { return char_; }
-
-M
-  = [mM]
-  / "\\" "0"? "0"? "0"? "0"? "4" [dD] ("\r\n" / [ \t\r\n\f])? { return "M"; }
-  / "\\" "0"? "0"? "0"? "0"? "6" [dD] ("\r\n" / [ \t\r\n\f])? { return "m"; }
-  / "\\" char_:[mM] { return char_; }
-
-N
-  = [nN]
-  / "\\" "0"? "0"? "0"? "0"? "4" [eE] ("\r\n" / [ \t\r\n\f])? { return "N"; }
-  / "\\" "0"? "0"? "0"? "0"? "6" [eE] ("\r\n" / [ \t\r\n\f])? { return "n"; }
-  / "\\" char_:[nN] { return char_; }
-
-O
-  = [oO]
-  / "\\" "0"? "0"? "0"? "0"? "4" [fF] ("\r\n" / [ \t\r\n\f])? { return "O"; }
-  / "\\" "0"? "0"? "0"? "0"? "6" [fF] ("\r\n" / [ \t\r\n\f])? { return "o"; }
-  / "\\" char_:[oO] { return char_; }
-
-P
-  = [pP]
-  / "\\" "0"? "0"? "0"? "0"? "50" ("\r\n" / [ \t\r\n\f])? { return "P"; }
-  / "\\" "0"? "0"? "0"? "0"? "70" ("\r\n" / [ \t\r\n\f])? { return "p"; }
-  / "\\" char_:[pP] { return char_; }
-
-R
-  = [rR]
-  / "\\" "0"? "0"? "0"? "0"? "52" ("\r\n" / [ \t\r\n\f])? { return "R"; }
-  / "\\" "0"? "0"? "0"? "0"? "72" ("\r\n" / [ \t\r\n\f])? { return "r"; }
-  / "\\" char_:[rR] { return char_; }
-
-S_
-  = [sS]
-  / "\\" "0"? "0"? "0"? "0"? "53" ("\r\n" / [ \t\r\n\f])? { return "S"; }
-  / "\\" "0"? "0"? "0"? "0"? "73" ("\r\n" / [ \t\r\n\f])? { return "s"; }
-  / "\\" char_:[sS] { return char_; }
-
-T
-  = [tT]
-  / "\\" "0"? "0"? "0"? "0"? "54" ("\r\n" / [ \t\r\n\f])? { return "T"; }
-  / "\\" "0"? "0"? "0"? "0"? "74" ("\r\n" / [ \t\r\n\f])? { return "t"; }
-  / "\\" char_:[tT] { return char_; }
-
-U
-  = [uU]
-  / "\\" "0"? "0"? "0"? "0"? "55" ("\r\n" / [ \t\r\n\f])? { return "U"; }
-  / "\\" "0"? "0"? "0"? "0"? "75" ("\r\n" / [ \t\r\n\f])? { return "u"; }
-  / "\\" char_:[uU] { return char_; }
-
-X
-  = [xX]
-  / "\\" "0"? "0"? "0"? "0"? "58" ("\r\n" / [ \t\r\n\f])? { return "X"; }
-  / "\\" "0"? "0"? "0"? "0"? "78" ("\r\n" / [ \t\r\n\f])? { return "x"; }
-  / "\\" char_:[xX] { return char_; }
-
-Z
-  = [zZ]
-  / "\\" "0"? "0"? "0"? "0"? "5" [aA] ("\r\n" / [ \t\r\n\f])? { return "Z"; }
-  / "\\" "0"? "0"? "0"? "0"? "7" [aA] ("\r\n" / [ \t\r\n\f])? { return "z"; }
-  / "\\" char_:[zZ] { return char_; }
+A  = "a"i / "\\" "0"? "0"? "0"? "0"? [\x41\x61] ("\r\n" / [ \t\r\n\f])? { return "a"; }
+C  = "c"i / "\\" "0"? "0"? "0"? "0"? [\x43\x63] ("\r\n" / [ \t\r\n\f])? { return "c"; }
+D  = "d"i / "\\" "0"? "0"? "0"? "0"? [\x44\x64] ("\r\n" / [ \t\r\n\f])? { return "d"; }
+E  = "e"i / "\\" "0"? "0"? "0"? "0"? [\x45\x65] ("\r\n" / [ \t\r\n\f])? { return "e"; }
+G  = "g"i / "\\" "0"? "0"? "0"? "0"? [\x47\x67] ("\r\n" / [ \t\r\n\f])? / "\\g"i { return "g"; }
+H  = "h"i / "\\" "0"? "0"? "0"? "0"? [\x48\x68] ("\r\n" / [ \t\r\n\f])? / "\\h"i { return "h"; }
+I  = "i"i / "\\" "0"? "0"? "0"? "0"? [\x49\x69] ("\r\n" / [ \t\r\n\f])? / "\\i"i { return "i"; }
+K  = "k"i / "\\" "0"? "0"? "0"? "0"? [\x4b\x6b] ("\r\n" / [ \t\r\n\f])? / "\\k"i { return "k"; }
+L  = "l"i / "\\" "0"? "0"? "0"? "0"? [\x4c\x6c] ("\r\n" / [ \t\r\n\f])? / "\\l"i { return "l"; }
+M  = "m"i / "\\" "0"? "0"? "0"? "0"? [\x4d\x6d] ("\r\n" / [ \t\r\n\f])? / "\\m"i { return "m"; }
+N  = "n"i / "\\" "0"? "0"? "0"? "0"? [\x4e\x6e] ("\r\n" / [ \t\r\n\f])? / "\\n"i { return "n"; }
+O  = "o"i / "\\" "0"? "0"? "0"? "0"? [\x4f\x6f] ("\r\n" / [ \t\r\n\f])? / "\\o"i { return "o"; }
+P  = "p"i / "\\" "0"? "0"? "0"? "0"? [\x50\x70] ("\r\n" / [ \t\r\n\f])? / "\\p"i { return "p"; }
+R  = "r"i / "\\" "0"? "0"? "0"? "0"? [\x52\x72] ("\r\n" / [ \t\r\n\f])? / "\\r"i { return "r"; }
+S_ = "s"i / "\\" "0"? "0"? "0"? "0"? [\x53\x73] ("\r\n" / [ \t\r\n\f])? / "\\s"i { return "s"; }
+T  = "t"i / "\\" "0"? "0"? "0"? "0"? [\x54\x74] ("\r\n" / [ \t\r\n\f])? / "\\t"i { return "t"; }
+U  = "u"i / "\\" "0"? "0"? "0"? "0"? [\x55\x75] ("\r\n" / [ \t\r\n\f])? / "\\u"i { return "u"; }
+X  = "x"i / "\\" "0"? "0"? "0"? "0"? [\x58\x78] ("\r\n" / [ \t\r\n\f])? / "\\x"i { return "x"; }
+Z  = "z"i / "\\" "0"? "0"? "0"? "0"? [\x5a\x7a] ("\r\n" / [ \t\r\n\f])? / "\\z"i { return "z"; }
 
 /* Tokens */
 
@@ -510,45 +386,46 @@ MEDIA_SYM "@media"
 CHARSET_SYM "@charset"
   = comment* "@charset "
 
-/* Note: We replace "w" with "s" here to avoid infinite recursion. */
+/* We use |s| instead of |w| here to avoid infinite recursion. */
 IMPORTANT_SYM "!important"
-  = comment* "!" (s / comment)* I M P O R T A N T { return "!important"; }
+  = comment* "!" (s / comment)* I M P O R T A N T
 
 EMS "length"
-  = comment* num:num e:E m:M { return num + e + m; }
+  = comment* value:num E M { return { value: value, unit: "em" }; }
 
 EXS "length"
-  = comment* num:num e:E x:X { return num + e + x; }
+  = comment* value:num E X { return { value: value, unit: "ex" }; }
 
 LENGTH "length"
-  = comment* num:num unit:(P X / C M / M M / I N / P T / P C) {
-      return num + unit.join("");
-    }
+  = comment* value:num P X { return { value: value, unit: "px" }; }
+  / comment* value:num C M { return { value: value, unit: "cm" }; }
+  / comment* value:num M M { return { value: value, unit: "mm" }; }
+  / comment* value:num I N { return { value: value, unit: "in" }; }
+  / comment* value:num P T { return { value: value, unit: "pt" }; }
+  / comment* value:num P C { return { value: value, unit: "pc" }; }
 
 ANGLE "angle"
-  = comment* num:num unit:(D E G / R A D / G R A D) {
-      return num + unit.join("");
-    }
+  = comment* value:num D E G   { return { value: value, unit: "deg"  }; }
+  / comment* value:num R A D   { return { value: value, unit: "rad"  }; }
+  / comment* value:num G R A D { return { value: value, unit: "grad" }; }
 
 TIME "time"
-  = comment* num:num unit:(m:M s:S_ { return m + s; } / S_) {
-      return num + unit;
-    }
+  = comment* value:num M S_ { return { value: value, unit: "ms" }; }
+  / comment* value:num S_   { return { value: value, unit: "s"  }; }
 
 FREQ "frequency"
-  = comment* num:num unit:(H Z / K H Z) { return num + unit.join(""); }
-
-DIMENSION "dimension"
-  = comment* num:num unit:ident { return num + unit; }
+  = comment* value:num H Z   { return { value: value, unit: "hz" }; }
+  / comment* value:num K H Z { return { value: value, unit: "kh" }; }
 
 PERCENTAGE "percentage"
-  = comment* num:num "%" { return num + "%"; }
+  = comment* value:num "%" { return { value: value, unit: "%" }; }
 
 NUMBER "number"
-  = comment* num:num { return num; }
+  = comment* value:num { return { value: value, unit: null }; }
 
 URI "uri"
-  = comment* U R L "(" w value:(string / url) w ")" { return value; }
+  = comment* U R L "("i w url:string w ")" { return url; }
+  / comment* U R L "("i w url:url w ")"    { return url; }
 
 FUNCTION "function"
   = comment* name:ident "(" { return name; }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org