Commit graph

1339 commits

Author SHA1 Message Date
Max Brunsfeld
7f6ec0131d Remove duplication between parser_destroy and parser_set_language 2016-12-06 10:12:49 -08:00
Max Brunsfeld
83514293b5 Allow external tokens to be either visible or hidden 2016-12-05 17:26:11 -08:00
Max Brunsfeld
1251ff2e30 Consider externals to be named, not anonymous 2016-12-05 17:09:22 -08:00
Max Brunsfeld
505fe6d382 Add externals to grammar JSON schema 2016-12-05 17:09:09 -08:00
Max Brunsfeld
a09409900f Silence missing intializer warnings in compiler unit tests 2016-12-05 16:37:06 -08:00
Max Brunsfeld
6073d9c0e8 Restore all languages in corpus specs 2016-12-05 16:36:50 -08:00
Max Brunsfeld
c4fe8ded95 Remove state argument to Lexer advance method 2016-12-05 16:36:34 -08:00
Max Brunsfeld
c16b6b2059 Run external scanners during error recovery 2016-12-05 11:50:24 -08:00
Max Brunsfeld
49d25bd0f8 Remove EXTERNAL_TOKEN grammar rule type 2016-12-04 15:02:32 -08:00
Max Brunsfeld
cf0d8abea1 Destroy external scanner when destroying Parser 2016-12-04 14:18:30 -08:00
Max Brunsfeld
d72b49316b Handle external tokens in apply_transitive_closure 2016-12-04 10:40:32 -08:00
Max Brunsfeld
0f8e130687 Call external scanner functions when lexing 2016-12-02 22:03:48 -08:00
Max Brunsfeld
c966af0412 Start work on external tokens 2016-12-02 16:24:19 -08:00
Max Brunsfeld
46854cc274 Compile and link test grammars in one step 2016-12-02 16:23:42 -08:00
Max Brunsfeld
269ee1c120 Merge pull request #53 from tree-sitter/precedence-fix
Avoid incorrect application of precedence
2016-12-01 10:33:20 -08:00
Max Brunsfeld
be9e79db1b Avoid incorrect application of precedence 2016-12-01 10:24:06 -08:00
Josh Vera
ffb55cc2a1 Merge pull request #52 from tree-sitter/empty-rules
Disallow syntax rules that match the empty string (for now)
2016-12-01 13:12:50 -05:00
Max Brunsfeld
996ca91e70 Disallow syntax rules that match the empty string (for now) 2016-11-30 23:19:54 -08:00
Max Brunsfeld
d627042fa6 Fix javascript error test
A single line with two function declarations now parses
successfully, so to create the desired error recovery
scenario, wrap the two functions in an assignment
2016-11-30 23:19:34 -08:00
Max Brunsfeld
cfef576a9f Remove google perftools dependency 2016-11-30 17:23:44 -08:00
Rick Winfrey
b06d2c80de Revert "Bump bandit"
This reverts commit ee8456fa71.
2016-11-30 18:28:04 -06:00
Rick Winfrey
ee8456fa71 Bump bandit 2016-11-30 18:23:05 -06:00
Max Brunsfeld
e6fd165670 Merge pull request #50 from tree-sitter/optimize-transitive-closure
Partially precompute item set transitive closures
2016-11-20 23:41:24 -08:00
Max Brunsfeld
101e304a8a Avoid unnecessary lookahead set mutations in ParseItemSetBuilder 2016-11-20 21:41:36 -08:00
Max Brunsfeld
06215607d1 Precompute transitive closure contributions by grammar symbol 2016-11-20 11:49:55 -08:00
Max Brunsfeld
5332fd3418 Fix build warnings 2016-11-19 20:47:43 -08:00
Max Brunsfeld
6cf4ccb840 Represent rule metadata as a struct, not a map 2016-11-19 13:59:34 -08:00
Max Brunsfeld
cac4f5d5bc Merge pull request #49 from tree-sitter/better-conflict-handling
Improve conflict handling
2016-11-18 17:11:34 -08:00
Max Brunsfeld
cab1bd3ac5 Make conflict messages explicit about precedence combinations 2016-11-18 17:05:16 -08:00
Max Brunsfeld
42ba70a5a0 🎨 2016-11-18 16:16:51 -08:00
Max Brunsfeld
5924285e69 🎨 2016-11-18 16:14:05 -08:00
Max Brunsfeld
a39b5109c9 Ensure out/tmp directory exists in specs 2016-11-18 14:49:56 -08:00
Max Brunsfeld
c0fb0c12a8 Don't use boost regex lib on travis 2016-11-18 14:46:53 -08:00
Max Brunsfeld
60593d13f4 Use a newer gcc on travis 2016-11-18 14:41:02 -08:00
Max Brunsfeld
32387400c6 Rework LR conflict resolution
* Unify precedence/associativity-based resolution with the
  search for a whitelisted conflict
* Improve conflict error messages
2016-11-18 13:50:55 -08:00
Max Brunsfeld
7968da672f Upgrade bandit test framework 2016-11-18 13:50:34 -08:00
Max Brunsfeld
4c60141b63 Merge pull request #48 from tree-sitter/optimize-state-deduping
Optimize parse state deduping
2016-11-16 12:02:16 -08:00
Max Brunsfeld
6935f1d26f Use hash_combine everywhere 2016-11-16 11:46:22 -08:00
Max Brunsfeld
6cfd009503 Compute parse state group signature based on the item set 2016-11-16 10:21:30 -08:00
Max Brunsfeld
42d37656ea Optimize remove_duplicate_parse_states method
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-11-15 17:51:52 -08:00
Max Brunsfeld
e7217f1bac Clean up some methods in parser.c 2016-11-14 17:25:55 -08:00
Max Brunsfeld
6fd0b5557d Merge pull request #47 from tree-sitter/32-bit-numbers
Represent byte, char and tree counts as 32 bit numbers
2016-11-14 12:32:27 -08:00
Max Brunsfeld
535879a2bd Represent byte, char and tree counts as 32 bit numbers
The parser spends the majority of its time allocating and freeing trees and stack nodes.
Also, the memory footprint of the AST is a significant concern when using tree-sitter
with large files. This library is already unlikely to work very well with source files
larger than 4GB, so representing rows, columns, byte lengths and child indices as
unsigned 32 bit integers seems like the right choice.
2016-11-14 12:19:13 -08:00
Max Brunsfeld
11e767bd81 Merge pull request #46 from tree-sitter/no-reductions-on-nonterminal-lookaheads
Don't include reduce actions for nonterminal lookaheads
2016-11-14 10:53:37 -08:00
Max Brunsfeld
8edb8df530 Remove extraneous Language methods 2016-11-14 10:35:33 -08:00
Max Brunsfeld
1118a9142a Introduce Symbol::Index type alias 2016-11-14 10:25:26 -08:00
Max Brunsfeld
1fddb124b3 Remove stray LOG_STACK() call 2016-11-14 09:32:05 -08:00
Max Brunsfeld
a89f8c086b Remove stray #include 2016-11-14 09:31:32 -08:00
Max Brunsfeld
fad7294ba4 Store shift states for non-terminals directly in the main parse table 2016-11-14 08:36:06 -08:00
Max Brunsfeld
8d9c261e3a Don't include reduce actions for nonterminal lookaheads 2016-11-10 11:33:37 -08:00