Commit graph

2868 commits

Author SHA1 Message Date
Max Brunsfeld
9ffcb16392 Fix tree-balancing logic
Remove incorrect condition that would prevent balancing of repeating 
structures containing only tokens (nodes w/ no children).

Co-Authored-By: Rob Rix <robrix@github.com>
Co-Authored-By: Patrick Thomson <patrickt@users.noreply.github.com>
2020-01-23 10:26:53 -08:00
Max Brunsfeld
70e2a2c025 Add PHP parser to web playground 2020-01-17 13:30:02 -08:00
Max Brunsfeld
9f63139a10 Fix error when set_included_ranges is called with an invalid range list 2020-01-17 10:31:28 -08:00
Max Brunsfeld
de8877db35 0.16.3 2020-01-16 16:18:25 -08:00
Max Brunsfeld
7421836ee4 Improve cli error message on invalid glob 2020-01-16 16:17:33 -08:00
Max Brunsfeld
9d460e6d01
Merge pull request #525 from SKalt/add-field-rule-to-grammar-json-schema
added field-rule to grammar-schema.json
2020-01-16 16:06:48 -08:00
Max Brunsfeld
42407b5ea4
Merge pull request #526 from tree-sitter/change-highlight-injection-api
Tweak the query API for specifying *combined injections* for syntax highlighting
2020-01-16 14:47:19 -08:00
Max Brunsfeld
cf5a6c0b9f Test against branches of language repos w/ new injection queries 2020-01-16 12:49:00 -08:00
Max Brunsfeld
9dfd03e79a highlight: Sipmlify injection API w/ new injection.combined property 2020-01-16 12:43:31 -08:00
Max Brunsfeld
f3747863df Add ts_query_disable_pattern API 2020-01-15 17:08:55 -08:00
Max Brunsfeld
58617cfa0c Improve output format for query subcommand 2020-01-15 17:08:31 -08:00
Max Brunsfeld
3c4a24752b Tweak naming of TSQuery's pattern map variables 2020-01-15 17:08:07 -08:00
Steven Kalt
619d7cd65a
added field-rule to grammar-schema.json 2020-01-12 19:40:21 -05:00
Steven Kalt
e69430ae7d removed duplicate key (#521)
The key "required" was duplicated on "symbol-rule". I removed the more permissive copy.
2020-01-09 17:34:07 -08:00
Patrick Thomson
39bfcdf595 Fix build with MinGW tooling. (#514)
Courtesy of @Eli-Zaretskii, these fixes should unblock people from
building tree-sitter with MinGW.

I don't think this is an unreasonable maintenance burden, especially
given the Emacs project's interest in using tree-sitter, but
@maxbrunsfeld gets the final call.
2020-01-06 09:21:40 -08:00
Max Brunsfeld
9a73277389 web-ui: Load static files from disk if TREE_SITTER_BASE_DIR var is set 2019-12-19 11:23:14 -08:00
Max Brunsfeld
f53e7377dc Allow highlight to command to take glob patterns 2019-12-17 15:49:05 -08:00
Max Brunsfeld
6c5adb7072 0.16.2 2019-12-17 15:06:21 -08:00
Max Brunsfeld
f0e4d630d5 Reliably avoid duplicate subtypes in node-types.json 2019-12-17 14:55:51 -08:00
Max Brunsfeld
3ac047679c Fix children.required when multiple nodes are aliased as the same 2019-12-16 12:39:57 -08:00
Max Brunsfeld
7c711c5537 Move the private functions in node_types.rs to the end of the file 2019-12-16 12:38:40 -08:00
Max Brunsfeld
5edf97bca9 Remove accidentally-commited garbage line in arg parsing config 2019-12-16 11:59:26 -08:00
Maxim Sukharev
edb5693100 include language.h in query.c (#507)
Building `query.c` requires `TREE_SITTER_LANGUAGE_VERSION_WITH_SYMBOL_DEDUPING` which is defined in `language.h`.

It produces an error:
```
query.c:744:40: error: use of undeclared identifier 'TREE_SITTER_LANGUAGE_VERSION_WITH_SYMBOL_DEDUPING'
```

when building with cgo.
2019-12-16 09:38:18 -08:00
Max Brunsfeld
9a0cfa2376 Fix 'required' field when rules with diff fields are aliased to look the same 2019-12-12 11:26:58 -08:00
Max Brunsfeld
fc19312913 Fix node-types bugs involving aliases and external tokens 2019-12-12 10:06:18 -08:00
Max Brunsfeld
1b5ae380ce
Don't attempt to extract keywords that don't entirely match word token (#505) 2019-12-11 17:18:15 -08:00
Max Brunsfeld
e313f981a2 wasm: 0.16.0 2019-12-10 16:26:20 -08:00
Max Brunsfeld
80a4304956 lib: 0.6.0 2019-12-10 16:24:39 -08:00
Max Brunsfeld
d25b71182e Update bash unit test to reflect field additions 2019-12-10 14:12:45 -08:00
Max Brunsfeld
c2e253a4c8 Update unit test to reflect javascript query change 2019-12-10 13:24:36 -08:00
Max Brunsfeld
9f77afcd1f 0.16.1 2019-12-09 13:26:26 -08:00
Max Brunsfeld
a5a9000e29 generate: Ensure that field_map_slices array is long enough 2019-12-09 11:46:32 -08:00
Steven Kalt
09fb24c03d add encoding to web_ui.html (#504)
addressing #503 .
2019-12-06 19:28:08 -08:00
Max Brunsfeld
0cb2ef1082 Fix code paths that still conflated null characters with EOF 2019-12-06 15:29:03 -08:00
Han BAO
47a926067d Update README.md (#502)
configure the recognized names for highlighting
2019-12-06 14:00:27 -08:00
Han BAO
acc5f092c8 FIxing the README in highlight (#501)
* Correct README.md in /highlight

correct the lifetime in highlighter.highlight and correct the cases in match so that the demo in README could work.

* Update README.md

another small fix

* Update highlight/README.md

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@github.com>
2019-12-06 13:05:28 -08:00
Max Brunsfeld
2758103646 0.16.0 2019-12-06 12:48:11 -08:00
Max Brunsfeld
d426f46087 Add unit test for symbols respecting simple aliases 2019-12-06 12:47:27 -08:00
Max Brunsfeld
6d1d8cc217 query: Skip workaround code path when using new symbol map field 2019-12-06 12:11:45 -08:00
Max Brunsfeld
7032dae4f6 Include alias symbols in unique symbol map 2019-12-06 12:11:09 -08:00
Max Brunsfeld
bea6e0e28b cli: Generate parseres with the new ABI by default 2019-12-06 11:51:55 -08:00
Max Brunsfeld
bd49fbab12 cli: Allow globs and exclusions (via '!' prefix) as args to parse 2019-12-06 11:41:21 -08:00
Max Brunsfeld
1c8aed790d
Merge pull request #500 from tree-sitter/dedup-symbols
Store a mapping to ensure no two symbols map to the same metadata
2019-12-06 09:51:28 -08:00
Max Brunsfeld
56c620c005 Store a mapping to ensure no two symbols map to the same metadata 2019-12-05 17:21:46 -08:00
Max Brunsfeld
d6c7b243a7
Merge pull request #499 from tree-sitter/highlight-test
Add a system for testing syntax highlighting queries
2019-12-05 15:55:24 -08:00
Max Brunsfeld
4b9feccd13 Run syntax highlighting tests as part of the main test command
Also, allow `corpus` to be in the `test/corpus` directory, and expect 
highlighting tests to be in the `test/highlight` directory.
2019-12-05 15:28:16 -08:00
Max Brunsfeld
6dbfbaed07 Start work on a system for testing syntax highlighting 2019-12-05 09:45:54 -08:00
Max Brunsfeld
82a8b15714 docs: Add C# parser to the playground 2019-12-02 14:00:26 -08:00
Max Brunsfeld
7ee65222d3 docs: Consider C# to be fairly complete 2019-12-02 13:54:24 -08:00
Max Brunsfeld
388511dbc9
Merge pull request #496 from kramred/patch-1
Fix small typo in docs
2019-12-02 09:06:45 -08:00