Commit graph

6118 commits

Author SHA1 Message Date
Max Brunsfeld
9c9311ccd7 Merge pull request #90 from tree-sitter/rename-rules
Add an API for renaming nodes based on their context
2017-07-14 10:51:22 -07:00
Max Brunsfeld
c21d3653e8 Add inline property to grammar JSON schema 2017-07-14 10:46:33 -07:00
Max Brunsfeld
99885788bc 🎨 2017-07-14 10:41:09 -07:00
Max Brunsfeld
a22386e408 Fix compiler warnings in flatten_grammar_test 2017-07-14 10:26:34 -07:00
Max Brunsfeld
4b40a1ed6c Support anonymous tokens inside of RENAME rules 2017-07-14 10:19:58 -07:00
Max Brunsfeld
b3a72954ff Introduce RENAME rule type 2017-07-13 17:17:22 -07:00
Max Brunsfeld
0b94e9d814 Don't include preceding production steps in ParseItem hash 2017-07-13 13:42:28 -07:00
Max Brunsfeld
561821d011 Remove precedence and associativity methods from ParseAction 2017-07-13 13:41:56 -07:00
Max Brunsfeld
d646889922 Simplify flatten_rule function 2017-07-13 09:59:23 -07:00
Max Brunsfeld
7293e6f0cc Fix compile warnings 2017-07-12 22:08:36 -07:00
Max Brunsfeld
62c577af33 Remove unnecessary using statements 2017-07-12 21:41:37 -07:00
Max Brunsfeld
2659b15542 Only build master and PRs on travis 2017-07-12 21:40:57 -07:00
Max Brunsfeld
8f30b259f1 Merge pull request #89 from tree-sitter/inline-rules
Add a way to automatically inline rules
2017-07-12 17:16:47 -07:00
Max Brunsfeld
a3006bc2b5 Represent LookaheadSet using vectors of bool 2017-07-12 16:02:01 -07:00
Max Brunsfeld
e4f57d6fee Test more cases in fixture grammar with inline rules 2017-07-12 10:12:42 -07:00
Max Brunsfeld
5c8f7c035e Add stream operator for ParseItemSet 2017-07-12 09:42:56 -07:00
Max Brunsfeld
65bf1389e1 Add a way to automatically inline rules 2017-07-11 23:13:44 -07:00
Max Brunsfeld
26a25278cd When comparing parse items, ignore consumed part of their productions
This speeds up parser generation by increasing the likelihood that we'll recognize
parse item sets as equivalent in advance, rather than having to merge their states
after the fact.
2017-07-11 17:30:32 -07:00
Max Brunsfeld
a199b217f3 Optimize ParseTableBuilder for non-terminals w/ many productions 2017-07-11 12:54:29 -07:00
Max Brunsfeld
68c3ba1b8b 🎨 merge_parse_state 2017-07-10 16:46:11 -07:00
Max Brunsfeld
43d347c225 Merge pull request #87 from tree-sitter/dynamic-precedence
Introduce rule for resolving runtime ambiguities
2017-07-10 16:43:58 -07:00
Max Brunsfeld
5bd5b4bb05 Replace <cctype> -> <cwctype> 2017-07-10 14:35:14 -07:00
Max Brunsfeld
bf4b8bf55b Use my fork of crypto-algorithms 2017-07-10 14:29:14 -07:00
Max Brunsfeld
59236d2ed1 Avoid redundant character comparisons in generated lex function 2017-07-10 14:09:31 -07:00
Max Brunsfeld
2755b07222 Don't store unfinished item signature on ParseStates 2017-07-10 10:47:38 -07:00
Max Brunsfeld
1586d70cbe Compute conflicting tokens more precisely
While generating the parse table, keep track of which tokens can follow one another.
Then use this information to evaluate token conflicts more precisely. This will
result in a smaller parse table than the previous, overly-conservative approach.
2017-07-07 17:54:24 -07:00
Max Brunsfeld
a98abde529 Provide all preceding symbols as context when reporting conflicts 2017-07-07 14:52:56 -07:00
Max Brunsfeld
c91ceaaa8d 🎨 build_parse_table 2017-07-07 14:52:45 -07:00
Max Brunsfeld
0de93b3bf2 Allow negative dynamic precedences 2017-07-06 22:21:59 -07:00
Max Brunsfeld
107feb7960 Bump the language version number after adding dynamic precedences 2017-07-06 15:58:29 -07:00
Max Brunsfeld
08bb365f6c Allow PREC_DYNAMIC in JSON schema 2017-07-06 15:51:03 -07:00
Max Brunsfeld
d8e9d04fe7 Add PREC_DYNAMIC rule for resolving runtime ambiguities 2017-07-06 15:24:45 -07:00
Max Brunsfeld
cb652239f6 Add missing semicolons in flatten_grammar test 2017-07-06 12:48:50 -07:00
Max Brunsfeld
31f827945a Merge pull request #86 from tree-sitter/benchmarks
Add a benchmark command
2017-07-06 12:38:00 -07:00
Max Brunsfeld
21bc50377e Run make with the right target when building benchmarks on CI 2017-07-06 12:36:57 -07:00
Max Brunsfeld
96068bbacb Represent all speeds as size_t in benchmarks 2017-07-06 12:24:41 -07:00
Max Brunsfeld
2b73a30fba Build benchmarks in release mode 2017-07-06 11:49:32 -07:00
Max Brunsfeld
a64db98218 Rename lib.sh -> scan-build.sh 2017-07-06 10:32:41 -07:00
Max Brunsfeld
78333b70c0 Build benchmarks with scan-build on CI 2017-07-06 10:22:14 -07:00
Max Brunsfeld
8c005cddc6 Print average and worst speeds in benchmark command 2017-07-06 10:12:22 -07:00
Max Brunsfeld
8f028ebf68 Avoid deep tree comparison when both trees have errors 2017-07-05 17:33:35 -07:00
Max Brunsfeld
c53f9bcbd9 Build benchmarks in Test mode for now 2017-07-05 17:27:50 -07:00
Max Brunsfeld
782bf48772 Don't do skip_preceding_subtrees recovery when there are lots of versions 2017-07-05 15:34:19 -07:00
Max Brunsfeld
17bc3dfaf7 Add a benchmark command
This command measures the speed of parsing each grammar's examples.
It also uses each grammar to parse all of the *other* grammars' examples
in order to measure error recovery performance with fairly large files.
2017-07-05 14:14:38 -07:00
Max Brunsfeld
298228d8de Clean up test_grammars file 2017-07-05 11:39:33 -07:00
Max Brunsfeld
69500c9dd7 Merge pull request #85 from tree-sitter/fuzzing-examples
Fix more performance problems found by fuzzing
2017-07-05 09:48:56 -07:00
Max Brunsfeld
d322f0b6a7 🎨 2017-07-04 21:59:54 -07:00
Max Brunsfeld
e7ccd9c17c Put back check for better existing versions during recover action
When checking for better existing versions, only kill the current
version if there is a better version earlier in the rotation.
2017-07-03 12:27:23 -07:00
Max Brunsfeld
f93f78ef2d Remove version-pruning criteria based on pushed node count 2017-07-02 23:42:23 -07:00
Max Brunsfeld
fcffd4b732 Add test for an example found during fuzzing 2017-06-30 21:55:50 -07:00