Commit graph

179 commits

Author SHA1 Message Date
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
1e64985f1f 0.15.0 2019-03-29 09:14:13 -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
82358d3f2f
Merge pull request #307 from tree-sitter/pointer-sized-cancellation-flag
Make the cancellation flag a size_t, not a uint32_t
2019-03-22 12:30:39 -07:00
Max Brunsfeld
5a59f19b69 Use explicit syntax for functions with no parameters 2019-03-21 16:06:06 -07:00
Max Brunsfeld
0ccb910922 Use a size_t instead of a uint32_t for cancellation flag 2019-03-21 11:26:05 -07:00
Max Brunsfeld
2fd9ffa8e5 Add --cancel flag to parse command to allow command-line testing 2019-03-21 10:56:32 -07:00
Max Brunsfeld
3340168097 Fix backwards logic for cancellation flag 2019-03-20 17:02:07 -07:00
Max Brunsfeld
8941dc1dda Add cancellation flag parameter to highlight API 2019-03-18 09:52:02 -07:00
Max Brunsfeld
0ae304f582 Lib: Rework the API for cancelling a parse
Also, use beta on CI until atomic::AtomicU32 lands in stable.
2019-03-18 09:51:21 -07:00
Jacob Mitchell
15b096d695 Extract graph log validation into a specialized test 2019-03-14 22:21:19 -07:00
Jacob Mitchell
c8d040ca26 Use 1-indexed rows in CLI and log output (resolves #287) 2019-03-14 22:21:19 -07:00
Max Brunsfeld
1aaad66a03
Merge pull request #301 from tree-sitter/clock-based-timeouts
Replace operation limit API with a clock-based timeout API
2019-03-14 16:50:44 -07:00
Max Brunsfeld
9ae594a507 Be more loose with timeout unit test assertions 2019-03-14 15:53:45 -07:00
Max Brunsfeld
006a931ab8 Tests: Prevent array reallocations during ts_stack_print_dot_graph
When debugging a test with 'script/test -D', the DOT-graph generation
code was sometimes causing reallocations that were not captured by the
allocation tracker, because we explicitly disable allocation-tracking
for that method in order to reduce noise when debugging memory leaks.

By growing the relevant array *prior* to turning off allocation
tracking, we can ensure that it is not reallocated within that function,
avoiding false positive memory leak errors.

Fixes #302
2019-03-14 13:59:12 -07:00
Max Brunsfeld
88e3907cc0 Use QueryPerformanceFrequency as clock on windows 2019-03-14 13:42:31 -07:00
Max Brunsfeld
e30e827c5f CLI: Add timeout flag to parse command 2019-03-14 11:52:50 -07:00
Max Brunsfeld
cddb3e416d Replace operation limit API with a clock-based timeout API 2019-03-14 11:13:38 -07:00
Max Brunsfeld
abcac40f2d cli: Add a --time flag to highlight subcommand 2019-03-13 15:52:29 -07:00
Max Brunsfeld
083e813218 Highlight: fix handling of root node injections like in ERB, EJS 2019-03-13 15:51:50 -07:00
Max Brunsfeld
b89348e7fe Merge branch 'master' into c-highlight 2019-03-12 15:27:12 -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
d19c875134 cli: ⬆️ rsass 2019-03-12 11:50:16 -07:00
Max Brunsfeld
98e4fd22ef Start work on a C API for syntax highlighting 2019-03-08 13:13:02 -08: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
08ac66a656 Don't generate prop sheets when a specific grammar path is passed 2019-03-03 18:53:24 -08:00
Max Brunsfeld
363079bf3e Re-enable HTML language in benchmarks
Made possible by this error recovery performance fix:
4c7d5fe26c
2019-03-03 18:23:01 -08:00
Max Brunsfeld
4e059e18cb 0.14.5 2019-02-25 12:55:28 -08:00
Max Brunsfeld
1bad6dc41e Add ~/.tree-sitter/config.json file, init-config command
Right now this is just used for two things:
* Specifying folders for locarting parsers to use with `tree-sitter 
parse` and `tree-sitter highlight`
* Specifying colors to use for `tree-sitter-highlight`
2019-02-25 12:33:24 -08:00
Max Brunsfeld
858b4ba8ac cli: Fix handling of import chains in property sheets 2019-02-22 16:15:36 -08:00
Max Brunsfeld
14b7af3436 highlight: Fix HTML rendering of empty lines 2019-02-22 11:48:29 -08:00
Max Brunsfeld
e239aa8229 highlight: don't include scope in ScopeEnd events
When there are embedded documents, multiple scopes can start or
end at the same position. Previously, there was no guarantee that
the ScopeEnd events would always occur in the reverse order of the
ScopeStart events. The easiest way to avoid exposing inconsistency
is to not surface the scopes being ended.
2019-02-20 16:45:51 -08:00
Max Brunsfeld
d2264d597f cli: Add --scope flag to highlight command 2019-02-20 14:38:19 -08:00
Max Brunsfeld
2ee5cbbc1d highlight: take callback parameters by value 2019-02-20 10:27:08 -08:00
Max Brunsfeld
a46515b80f Replace LanguageRegistry trait with a simple callback 2019-02-19 17:07:12 -08:00
Max Brunsfeld
e89b6b2402 Add a highlight subcommand 2019-02-19 12:32:03 -08:00
Max Brunsfeld
0dd15e2b02 Ensure deterministic order of values in property sheet JSON files 2019-02-19 10:40:34 -08:00
Max Brunsfeld
9185f6c168 Clarify parse command error message when failing to read source file 2019-02-19 10:40:27 -08:00
Max Brunsfeld
4db132ff94 In property sheets, avoid converting numeric values to strings 2019-02-15 20:48:36 -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