Max Brunsfeld
a1eee4a193
Catch missing precedence values in JS
...
Fixes #305
2019-04-05 13:04:12 -07:00
Max Brunsfeld
df76aef067
CLI: In lex function, merge branches with the same body
2019-04-04 16:02:50 -07:00
Max Brunsfeld
6490b1e4f2
Fix non-deterministic conflict message order
2019-03-29 17:36:19 -07:00
Max Brunsfeld
a133afe9ac
Clean up ParseItem::cmp
2019-03-29 12:49:51 -07:00
Max Brunsfeld
9bdac0e693
CLI: Account for field names when comparing parse items
2019-03-29 12:13:24 -07:00
Max Brunsfeld
09b902f6a0
cli: require node-types.json in generated index.js files
2019-03-29 09:07:32 -07:00
Max Brunsfeld
eb96dd6ddb
node types: Preserve all supertypes in field type lists
2019-03-27 16:32:02 -07:00
Max Brunsfeld
451478c620
Include tokens in node-types.json
2019-03-26 16:57:55 -07:00
Max Brunsfeld
e9afdd72b4
node-types: Fix incorrect named value for subclasses
2019-03-26 15:27:07 -07:00
Max Brunsfeld
af09e65efc
Move node types code to its own module
2019-03-26 14:42:32 -07:00
Max Brunsfeld
6c65d74810
Restructure node-types.json output
2019-03-26 13:43:10 -07:00
Max Brunsfeld
5035e194ff
Merge branch 'master' into node-fields
2019-03-26 11:58:21 -07:00
Max Brunsfeld
b79bd8693b
Start work on handling node supertypes
2019-03-26 11:51:02 -07:00
Max Brunsfeld
5a59f19b69
Use explicit syntax for functions with no parameters
2019-03-21 16:06:06 -07:00
Max Brunsfeld
2de54c101e
cli: put a newline character at the end of grammar.json files
2019-03-12 11:54:31 -07:00
Max Brunsfeld
f52271352b
Merge branch 'master' into node-fields
2019-03-05 08:08:05 -08:00
Max Brunsfeld
a20fc3c111
Remove unnecessary character escape processing for regexes
...
Fixes #289
2019-03-04 10:10:04 -08:00
Max Brunsfeld
405c200786
Merge branch 'master' into node-fields
2019-02-14 16:27:22 -08:00
Max Brunsfeld
5debf3cbcc
cli: Create src directory before writing grammar.json
...
Fixes #278
2019-02-14 10:57:33 -08:00
Max Brunsfeld
56309a1c28
Generate node-fields.json file
2019-02-12 11:06:18 -08:00
Max Brunsfeld
b7e38ccc96
Allow using fields in inlined rules
2019-02-08 17:12:08 -08:00
Max Brunsfeld
eb1e7af5ec
Normalize rule argument to field function
2019-02-08 17:11:58 -08:00
Max Brunsfeld
e579e09569
Ensure interpretations are in a predictable order in conflict messages
2019-02-08 17:11:44 -08:00
Max Brunsfeld
79d90f0d3e
Restore naming of alias sequence lengths
...
Fields aren't stored in sequences now, so the max length
is back to being just for aliases.
2019-02-08 16:14:18 -08:00
Max Brunsfeld
d8a2c0dda2
Use a separate type for storing field map headers
2019-02-08 16:06:29 -08:00
Max Brunsfeld
51a9f14f7d
Ensure symbols are written in a predictable order in conflict messages
2019-02-08 15:16:56 -08:00
Max Brunsfeld
1d1674811c
Fully implement ts_node_child_by_field_id
2019-02-08 15:16:56 -08:00
Max Brunsfeld
18a13b457d
Get basic field API working
2019-02-08 15:16:56 -08:00
Max Brunsfeld
108ca989ea
Start work on including child refs in generated parsers
2019-02-08 15:16:56 -08:00
Max Brunsfeld
bf4e1304f8
Start work on new ref API, for giving names to nodes' children
...
Co-Authored-By: Ayman Nadeem <aymannadeem@gmail.com>
2019-02-08 15:16:56 -08:00
Max Brunsfeld
dac13af206
cli: Always write parser.h in generate command
2019-02-08 15:16:38 -08:00
Max Brunsfeld
acd30d4693
Write grammar.json file when generating based on grammar.js
2019-02-08 15:15:47 -08:00
Max Brunsfeld
9b8bf8dfe2
cli: Compute fragile tokens *after* merging compatibile parse states
...
Previously, we failed to mark as fragile some tokens that *should* be
fragile because of tokens that were introduced during parse state
merging.
2019-02-06 16:18:49 -08:00
Max Brunsfeld
4badd7cc40
Disable compiler optimizations for lex functions in more cases
...
* Reduce the lexer state count threshold from 500 to 300
* Disable optimizations on clang and gcc in addition to MSVC
Optimizations in these source files don't seem to make any impact on
parsing performance, but they slow down compile time substantially.
2019-02-06 11:50:37 -08:00
Max Brunsfeld
5c925b3868
cli: Check that extra rules aren't passed to functions like 'optional'
...
Fixes #247
2019-02-06 09:31:32 -08:00
Max Brunsfeld
d7bc61cada
Include parser header content in library crate
2019-02-05 11:59:34 -08:00
Max Brunsfeld
4a98f0b87e
Port unit test for missing tokens and included ranges
2019-02-04 14:44:06 -08:00
Max Brunsfeld
e143710f4a
Move properties module out of generate
2019-02-01 19:57:00 -08:00
Max Brunsfeld
4cac85fec4
Add benchmark script
...
* Structure `cli` crate as both a library and an executable, so that
benchmarks can import code from the crate.
* Import macros in the Rust 2018 style.
2019-02-01 15:17:35 -08:00
Max Brunsfeld
f6d014f3f4
Write tree_sitter/parser.h file in generate command
2019-01-28 14:23:41 -08:00
Max Brunsfeld
e305012b31
Loosen keyword identification criteria slightly
2019-01-21 15:33:43 -08:00
Max Brunsfeld
f6cdd5e3d4
Loosen criteria for identifying conflict-free tokens for error recovery
2019-01-20 16:58:31 -08:00
Max Brunsfeld
ff41f05a20
Fix computation of following tokens
2019-01-18 15:16:20 -08:00
Max Brunsfeld
31bdf5eb97
Fix handling of JavaScript errors
...
Refs #258
2019-01-18 09:40:09 -08:00
Max Brunsfeld
ed195de8b6
rustfmt
2019-01-17 17:16:04 -08:00
Max Brunsfeld
c27f776d41
Fix word token index issue in a different way
...
Refs https://github.com/tree-sitter/tree-sitter/issues/258
2019-01-17 13:18:59 -08:00
Max Brunsfeld
8f4096e5cb
Give more informative error messages when failing to write files
2019-01-17 12:52:05 -08:00
Max Brunsfeld
bb5dedfb1e
Fix another token conflict detection bug
2019-01-17 12:44:35 -08:00
Max Brunsfeld
9f7079c9c5
Ensure that the word token has a low numerical index
...
Fixes https://github.com/tree-sitter/tree-sitter/issues/258
2019-01-17 12:44:14 -08:00
Max Brunsfeld
d52a11fd03
Avoid using a string literal to pass grammar path to JS
...
Backslashes in windows path were getting interpeted as escape characters.
2019-01-17 10:09:03 -08:00