Futago-za Ryuu
96a386ff15
Merged documents for test suites
2017-10-15 02:36:10 +01:00
Futago-za Ryuu
5c36738a52
Rewrote test/impact as a Node.js script
...
"test/impact" was a bash script before, and used tools spefic to some systems, which required Window users to have more software installed.
This rewrite removes the bash script and add's a cross platform Node.js script that doesn't depend on platform-spefic tools.
2017-10-06 07:49:52 +01:00
Futago-za Ryuu
08bbd6d5b6
Moved "eslint-env node" to the root
...
It seem's kind of pointless setting the comment "/* eslint-env node */" at the top of only some JavaScript files when nearly all of them are Node.js releated, so I moved this option to the root level config, only leaving the 'lib' folder as "/* eslint-env commonjs */"
2017-10-02 06:32:20 +01:00
Futago-za Ryuu
5a833bd982
Moved all spec and benchmark tests
...
- Moved benchmark to test/benchmark
- Moved tests to test/spec
- Removed individual servers
- Implemented single test server
- Moved server assets to test/server
- Updated Gulpfile.js
- Moved tools/impact to test/impact
This commit move's nearly all code related to testing the PEG.js module into the test directory, and also ensures they run as they did before the move.
2017-10-02 04:35:46 +01:00
felix
cb3c5f4473
Improve error message for unbalanced brace. ( #534 )
...
Currently, an open brace without a corresponding brace will emit this confusing error message:
> Expected "!", "$", "&", "(", "*", "+", ".", "/", "/*", "//", ";", "?", character class, code block, comment, end of line, identifier, literal, or whitespace but "{" found.
This change adds an error case to the grammar to make it clear what the problem is.
2017-09-15 21:36:19 +01:00
felix
ee00a1ae6a
Check allowedStartRules exist. ( #532 )
...
Fixes #524
2017-09-12 21:21:35 +01:00
felix
958e15879d
Reimplement offset() and add range(). ( #528 )
...
* Reimplement offset()
* Implement range()
Fixes #526 , thanks @felix9
2017-09-04 05:48:17 +01:00
Futago-za Ryuu
57bb28414e
Merge pull request #509 from Mingun/simplify-bc
...
Simplify bytecode: remove unnecessary opcode.
2017-08-24 04:17:45 +01:00
Futago-za Ryuu
55bcaa46ef
Updated ESLint configuration files
...
- added "root" option to main config
- moved "env.commonjs" to root
2017-07-22 15:45:10 +01:00
Mingun
575db38d1f
Simplify bytecode: remove unnecessary opcode.
...
Now generated sources looks little better :)
2017-06-24 22:36:21 +05:00
David Majda
205c55d309
Tests: s/Spec/Test/
...
Missed in f5a372b075
(I probably grepped
case-sensitively).
2016-12-16 16:45:34 +01:00
David Majda
2942fa1867
Tests: Make tracing tests more specific
...
Check that the console and the default tracer are called with specific
arguments in given order. Previously the order of calls wasn't checked.
2016-12-16 14:25:41 +01:00
David Majda
9cc35d2cab
Tests: DRY up tracing tests
2016-12-16 14:14:05 +01:00
David Majda
5d6bd75619
Tests: Use "to.be.{a,an}" instead of "expect(typeof ...)"
2016-12-16 13:43:22 +01:00
David Majda
6817f3b964
Tests: Require specific modules instead of the whole library
...
Requiring the whole library was a relict from the time where the tests
were exercising the browser build when run in the browser.
2016-12-16 13:21:48 +01:00
David Majda
f5a372b075
Use "test" and "tests" instead of "spec" and "specs"
...
This reflects a convention used in most JavaScript projects. The change
involves renaming the "spec" directory, Gulp task, etc.
2016-12-08 10:05:17 +01:00
David Majda
23e04bb4f4
Jasmine: Delete remains the old test suite
2012-05-06 19:05:38 +02:00
David Majda
8ef5f08c90
Jasmine: Convert |removeProxyRules| compiler pass tests
2012-05-06 19:05:38 +02:00
David Majda
eaf2af8e7b
Jasmine: Convert |computeParams| compiler pass tests
2012-05-06 19:05:38 +02:00
David Majda
4edc9982cc
Jasmine: Convert |computeVarNames| compiler pass tests
2012-05-06 19:05:38 +02:00
David Majda
1471df9a69
Jasmine: Convert |reportLeftRecursion| compiler pass tests
2012-05-06 19:05:38 +02:00
David Majda
2889ca72fc
Jasmine: Convert |reportMissingRules| compiler pass tests
2012-05-06 19:05:38 +02:00
David Majda
e030834a0e
Delete test/compiler-test.js
2012-05-06 19:05:38 +02:00
David Majda
112e4122d0
Jasmine: Convert remaining error reporting tests
2012-05-06 19:05:38 +02:00
David Majda
94aaf4ec75
Jasmine: Convert error position reporting tests
2012-05-06 19:05:38 +02:00
David Majda
1825dd4a42
Jasmine: Convert start rule tests
2012-05-06 19:05:37 +02:00
David Majda
68bfeac134
Jasmine: Drop the idempotence test
...
The code this test covered is long gone.
2012-05-06 19:05:37 +02:00
David Majda
f61813238d
Jasmine: Convert complex example tests
2012-05-06 19:05:37 +02:00
David Majda
022a51f94e
Jasmine: Convert cache tests
2012-05-06 19:05:37 +02:00
David Majda
e9f7255d47
Jasmine: Convert initializer tests
2012-05-06 19:05:37 +02:00
David Majda
f5f40f68d2
Jasmine: Convert choice matching tests
2012-05-06 19:05:37 +02:00
David Majda
1b0789fbae
Jasmine: Convert sequence matching tests
2012-05-06 19:05:37 +02:00
David Majda
ae8a89c9e4
Jasmine: Convert labeled matching tests
2012-05-06 19:05:37 +02:00
David Majda
b013ba8cc9
Jasmine: Convert simple and matching tests
2012-05-06 19:05:37 +02:00
David Majda
343e9db525
Jasmine: Convert simple not matching tests
2012-05-06 19:05:37 +02:00
David Majda
2bb25efa44
Jasmine: Convert semantic and code tests
2012-05-06 19:05:37 +02:00
David Majda
f04096189f
Jasmine: Convert semantic not code tests
2012-05-06 19:05:37 +02:00
David Majda
ccf31f8822
Jasmine: Convert optional matching tests
2012-05-06 19:05:37 +02:00
David Majda
669668fc1b
Jasmine: Convert zero or more matching tests
2012-05-06 19:05:37 +02:00
David Majda
1ab06ff906
Jasmine: Convert one or more matching tests
2012-05-06 19:05:37 +02:00
David Majda
03716a562d
Jasmine: Convert action code tests
2012-05-06 19:05:37 +02:00
David Majda
b06bd774f5
Jasmine: Convert rule reference matching tests
2012-05-06 19:05:36 +02:00
David Majda
14c11b4dfc
Jasmine: Convert class matching tests
2012-05-06 19:05:36 +02:00
David Majda
75ab03dc85
Jasmine: Convert any matching tests
2012-05-06 19:05:36 +02:00
David Majda
ec48742032
Jasmine: Convert literal matching tests
2012-05-06 19:05:36 +02:00
David Majda
feddd10190
Jasmine: Delete test/parser-test.js
2012-05-06 19:05:36 +02:00
David Majda
94205ab639
Jasmine: Convert tests of parser's "grammar" rule
2012-05-06 19:05:36 +02:00
David Majda
f746189f2b
Jasmine: Convert tests of parser's "initializer" rule
2012-05-06 19:05:36 +02:00
David Majda
171d62fce4
Jasmine: Convert tests of parser's "rule" rule
2012-05-06 19:05:36 +02:00
David Majda
e17d4de7ae
Jasmine: Convert tests of parser's "expression" rule
2012-05-06 19:05:36 +02:00
David Majda
cc22086a09
Jasmine: Convert tests of parser's "choice" rule
2012-05-06 19:05:36 +02:00
David Majda
434abdb272
Jasmine: Convert tests of parser's "sequence" rule
2012-05-06 19:05:36 +02:00
David Majda
ec8889f85d
Jasmine: Convert tests of parser's "labeled" rule
2012-05-06 19:05:36 +02:00
David Majda
bf6d412a4f
Jasmine: Convert tests of parser's "prefixed" rule
2012-05-06 19:05:36 +02:00
David Majda
3e083cc51b
Jasmine: Convert tests of parser's "suffixed" rule
2012-05-06 19:05:36 +02:00
David Majda
45f825c24f
Jasmine: Convert tests of parser's "primary" rule
2012-05-06 19:05:35 +02:00
David Majda
57bbcd71e5
Jasmine: Convert tests of parser's "action" rule
2012-05-06 19:05:35 +02:00
David Majda
35771e15bc
Jasmine: Convert tests of parser's "braced" rule
2012-05-06 19:05:35 +02:00
David Majda
b1cb214e8b
Jasmine: Convert non-tests of parser's character class rules
2012-05-06 19:05:35 +02:00
David Majda
4f5b78b372
Jasmine: Convert tests of parser's "identifier" rule
2012-05-06 19:05:35 +02:00
David Majda
a3d93f000f
Jasmine: Convert tests of parser's "literal" rule
2012-05-06 19:05:35 +02:00
David Majda
573db92583
Jasmine: Convert tests of parser's "string" rule
2012-05-06 19:05:35 +02:00
David Majda
fa65018b15
Jasmine: Convert tests of parser's "doubleQuotedString" rule
2012-05-06 19:05:35 +02:00
David Majda
0e384b31f4
Jasmine: Convert tests of parser's "doubleQuotedCharacter" rule
2012-05-06 19:05:35 +02:00
David Majda
2f5f8d5932
Jasmine: Convert tests of parser's "simpleDoubleQuotedCharacter" rule
2012-05-06 19:05:35 +02:00
David Majda
fb01f48c97
Jasmine: Convert tests of parser's "singleQuotedString" rule
2012-05-06 19:05:35 +02:00
David Majda
d3b3fe9b78
Jasmine: Convert tests of parser's "singleQuotedCharacter" rule
2012-05-06 19:05:35 +02:00
David Majda
124e45606c
Jasmine: Convert tests of parser's "simpleSingleQuotedCharacter" rule
2012-05-06 19:05:35 +02:00
David Majda
ba68919b0a
Jasmine: Convert tests of parser's "class" rule
2012-05-06 19:05:35 +02:00
David Majda
5fb59b05f2
Jasmine: Convert tests of parser's "classCharacterRange" rule
2012-05-06 19:05:34 +02:00
David Majda
d29a753b8d
Jasmine: Convert tests of parser's "classCharacter" rule
2012-05-06 18:39:54 +02:00
David Majda
b9ae8f9561
Jasmine: Convert tests of parser's "bracketDelimitedCharacter" rule
2012-05-06 18:39:54 +02:00
David Majda
da4ac8bb92
Jasmine: Convert tests of parser's "simpleBracketDelimitedCharacter" rule
2012-05-06 18:39:54 +02:00
David Majda
2bb266bbaf
Jasmine: Convert tests of parser's "simpleEscapeSequence" rule
2012-05-06 18:39:54 +02:00
David Majda
2619becb9d
Jasmine: Convert tests of parser's "zeroEscapeSequence" rule
2012-05-06 18:39:54 +02:00
David Majda
2b43f8ebb8
Jasmine: Convert tests of parser's "hexEscapeSequence" rule
2012-05-06 18:39:53 +02:00
David Majda
0bbca136a2
Jasmine: Convert tests of parser's "unicodeEscapeSequence" rule
2012-05-06 18:39:53 +02:00
David Majda
a27dc5ae4a
Jasmine: Convert tests of parser's "eolEscapeSequence" rule
2012-05-06 18:39:53 +02:00
David Majda
4f91286013
Jasmine: Convert non-tests of parser's character class rules
2012-05-06 18:39:53 +02:00
David Majda
3bc61c4c50
Jasmine: Convert tests of parser's "__" rule
2012-05-06 18:39:53 +02:00
David Majda
fadaef84dd
Jasmine: Convert tests of parser's "comment" rule
2012-05-06 18:39:53 +02:00
David Majda
b5ccaed491
Jasmine: Convert tests of parser's "singleLineComment" rule
2012-05-06 18:39:53 +02:00
David Majda
dac3b0d8d9
Jasmine: Convert tests of parser's "multiLineComment" rule
2012-05-06 18:39:53 +02:00
David Majda
328edf667c
Jasmine: Convert tests of parser's "eol" rule
2012-05-06 18:39:53 +02:00
David Majda
b4cffee9d4
Jasmine: Convert tests of parser's "eolChar" rule
2012-05-06 18:39:53 +02:00
David Majda
a46b9c197b
Jasmine: Convert tests of parser's "whitespace" rule
2012-05-06 18:39:53 +02:00
David Majda
53f70b9eb9
Move compiler passes and their tests into a subdirectory
2012-04-19 14:23:21 +02:00
David Majda
f046e0a838
Move compiler-related source files and tests into a subdirectory
2012-04-19 13:22:37 +02:00
David Majda
ef06621a2b
Remove extra comma in compiler tests
2012-04-17 12:00:58 +02:00
David Majda
5b3321d302
Implement |cache| option for |PEG.buildParser|
...
This option enables/disables the results cache in generated parsers.
Until now, it was always enabled, but after this commit it needs to be
enabled explicitly (i.e. the |cache| option default value is |false|).
The reason is that parsing without it is *much* faster according to the
benchmark.
Note that disabling the cache breaks the linear parsing time guarantee,
meaning that with some grammars you can get exponential parsing time
with respect to the input length. This, together with the possibility of
improving the cache performance in the future, is the reason to keep it
as an option.
Speed impact
------------
Before: 214.08 kB/s
After: 827.52 kB/s
Difference: 286.54%
Size impact
-----------
Before: 1045396 b
After: 949783 b
Difference: -9.15%
(Measured by /tools/impact with Node.js v0.6.6 on x86_64 GNU/Linux.)
2012-04-17 09:48:29 +02:00
David Majda
f3970bfa5c
Extend QUnit a bit more cleanly
2012-04-16 15:45:50 +02:00
David Majda
d35b21e9b2
Simplify the |indent| function in /test/run
2012-04-16 15:29:04 +02:00
David Majda
9d5990f80a
Update code formatting in /test/run to match conventions I use elsewhere
2012-04-16 15:26:42 +02:00
David Majda
6d624a89bd
Update bundled QUnit to version 1.5.0
2012-04-16 14:54:34 +02:00
David Majda
52d7ec2224
Implement |trackLineAndColumn| option for |PEG.buildParser|
...
This option makes the generated parser track line and column during
parsing. Tracked line and column are made available inside actions and
predicates as |line| and |column| variables.
Note that in actions these variables denote start position of the
action's expression while in predicates they denote the current
position. The slightly different behavior is motivated by expected
usage.
2012-03-26 20:15:29 +02:00
David Majda
f2f88b87ea
Make current parse position visible in actions and predicates
...
The speed/size impact is insignificant.
Speed impact
------------
Before: 214.11 kB/s
After: 214.87 kB/s
Difference: 0.35%
Size impact
-----------
Before: 1042691 b
After: 1046731 b
Difference: 0.38%
(Measured by /tools/impact with Node.js v0.6.6 on x86_64 GNU/Linux.)
2012-03-06 19:55:55 +01:00
David Majda
f47da5c682
Fix a bug in param name fixup code for sequences
2012-03-06 08:46:28 +01:00
David Majda
4d5b1d58aa
AST: Store rules in an array instead of an object
...
This simplifies the code a bit and makes the AST more regular (each node
type has a fixed set of properties). The latter may get useful later
when generalizing visitors.
2012-03-04 17:29:32 +01:00
David Majda
a2af1fe612
Semantic predicates now have access to preceding labels
...
Part of a fix for GH-69.
2012-02-27 20:18:21 +01:00
David Majda
4cf50bcf9f
Move param computations from the emitter into a separate pass
...
This has two main benefits:
1. The knowledge about scoping params in at one designated place,
making all future adjustments in this area easier.
2. Action-related code does not handle sequences specially anymore.
Such knowledge/behavior doesn't belong there.
2012-02-27 20:18:03 +01:00