17 Commits (f9ea46ef15cdc7933a5bdbd85826f9647562d6b3)

Author SHA1 Message Date
David Majda 9bf86b89a6 Fix stupid mistakes in metagrammar-test.js
The mistakes weren't caught because the first one introduces a syntax
error, causing the whole test suite not to load. Unfortunately, QUnit
didn't complain so I missed this.

The real commit these changes belong to is
33a1a7c1e9.
15 years ago
David Majda 33a1a7c1e9 Clean up class handling in the metagrammar and compiler
The class AST node now contains structured data and a raw text which is
used for error messages.
15 years ago
David Majda 137a4b4f53 Renamed |characters| -> |chars| (shorter, no loss of expressivity) 15 years ago
David Majda 76ed63c86e AST refactoring 6/6: Get rid of the |Grammar| namespace 15 years ago
David Majda b4bf49443a AST refactoring 5/6: Make AST classless 15 years ago
David Majda 1c7c5bb5da Correct variable name: "choice" -> "optional". 15 years ago
David Majda b2f230fad2 Added Optional AST node.
This does not speed up the benchmark suite execution statistically significantly
on V8.

Detailed results (benchmark suite totals):

---------------------------------
 Test #     Before       After
---------------------------------
      1   28.84 kB/s   28.75 kB/s
      2   28.76 kB/s   28.69 kB/s
      3   28.72 kB/s   28.69 kB/s
      4   28.84 kB/s   28.93 kB/s
      5   28.82 kB/s   28.70 kB/s
---------------------------------
Average   28.80 kB/s   28.75 kB/s
---------------------------------

Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.2 (KHTML, like Gecko)
Chrome/5.0.342.9 Safari/533.2
15 years ago
David Majda e5df8284b5 Added AndPredicate AST node.
This does not speed up the benchmark suite execution statistically significantly
on V8.

Detailed results (benchmark suite totals):

---------------------------------
 Test #     Before       After
---------------------------------
      1   28.72 kB/s   28.84 kB/s
      2   28.84 kB/s   28.76 kB/s
      3   28.83 kB/s   28.72 kB/s
      4   28.81 kB/s   28.84 kB/s
      5   28.76 kB/s   28.82 kB/s
---------------------------------
Average   28.79 kB/s   28.80 kB/s
---------------------------------

Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.9 Safari/533.2
15 years ago
David Majda c3c1c79665 Added OneOrMore AST node.
This speeds up the benchmark suite execution by 1.08% on V8.

Detailed results (benchmark suite totals):

---------------------------------
 Test #     Before       After
---------------------------------
      1   28.38 kB/s   28.72 kB/s
      2   28.52 kB/s   28.84 kB/s
      3   28.41 kB/s   28.83 kB/s
      4   28.47 kB/s   28.81 kB/s
      5   28.64 kB/s   28.76 kB/s
---------------------------------
Average   28.48 kB/s   28.79 kB/s
---------------------------------

Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.9 Safari/533.2
15 years ago
David Majda 4b51e6a6d3 Quote null characters in regexps, IE does not like them. 15 years ago
David Majda 7fc491412d Work around the fact that IE does not recognize "\v" in strings. 15 years ago
David Majda 3291c70d97 Added \uFEFF (BOM) to the definition of whitespace in the metagrammar.
The Rhino bug that prevented inclusion of \uFEFF among the whitespace characters
is no longer relevant here because we compile character classes into regexps
now, which avoids the infinite recursion.
15 years ago
David Majda 383c5acaa6 Replaced \xA0 by \u00A0 in the whitespace definition in the metagrammar.
This is purely stylistic change.
15 years ago
David Majda 4f4bb34ded Implemented negative character classes (e.g. [^a-z]). 15 years ago
David Majda b3381b9352 Fixed test name. 15 years ago
David Majda 22d2ac8ac2 Rewrote implementation of classes to be regexp-based. 15 years ago
David Majda a43d1b33e3 Bootstrapped the grammar parser, yay! I should have done this long ago. 15 years ago