Commit graph

559 commits

Author SHA1 Message Date
Arthur Baars
f07dda692e Ensure "extras" symbols are included in the node-types.json file
The symbols marked as "extras" are the start symbols of secondary
languages. These should be included in the aliases map just as done
for start symbol of the main language to ensure their node type and
field information is included in the node-types.json file.
2020-10-29 18:05:24 +01:00
Max Brunsfeld
1992734195 0.17.2 2020-10-28 14:12:56 -07:00
Max Brunsfeld
c2c63baf5b query: Fix escape sequence parsing in anonymous node patterns
Fixes #776
Fixes #760
2020-10-28 13:55:13 -07:00
Max Brunsfeld
071f4e40f1 Fix generate error when there are aliases in unused rules 2020-10-28 12:34:16 -07:00
Max Brunsfeld
a2d760e426 Ensure nodes are aliased consistently within syntax error nodes
Co-Authored-By: Rick Winfrey <rewinfrey@github.com>
2020-10-27 15:46:09 -07:00
Max Brunsfeld
b972a7158d Tweak cancellation logic for CLI commands
In 'parse' and 'highlight' cancel on stdin if stdin is a tty.
2020-10-23 12:15:44 -07:00
Max Brunsfeld
8bb8e9b8b3 Initialize TSLanguage fields in order of their declaration
This makes parser.c valid under the C++20 standard
2020-10-15 07:20:12 -07:00
Max Brunsfeld
0a46033391 Remove duplication of LossyUtf8 helper 2020-10-14 11:35:50 -07:00
Max Brunsfeld
857a9ed07b query: Handle captured wildcard nodes at the root of patterns 2020-10-08 12:34:08 -07:00
Patrick Thomson
1f3248a3e0
Merge pull request #749 from tree-sitter/ensure-extras-is-array
Fix crash when extras function doesn't return an array.
2020-10-05 16:57:27 -04:00
Patrick Thomson
b9b478873a
Merge pull request #748 from tree-sitter/fix-nonexistent-file-crash
Fix crash when nonexistent files were passed to `parse`.
2020-10-05 16:14:09 -04:00
Patrick Thomson
adce3cb8e2 Merge remote-tracking branch 'origin/master' into ensure-extras-is-array 2020-10-05 16:12:37 -04:00
Max Brunsfeld
d1c95193c1 query: Fix invalid use of slice::from_raw_parts 2020-10-05 12:08:53 -07:00
Max Brunsfeld
08356f79c7 Bump sibling cargo deps 2020-09-30 21:19:32 -07:00
Patrick Thomson
683a2da055 Fix crash when extras function doesn't return an array.
Fixes #745, which failed due to attempting to call `map` on a
non-array. This bails out at the same spot, but with a more
illuminating error message.
2020-09-30 16:21:20 -04:00
Patrick Thomson
470733b323 Fix crash when nonexistent files were passed to parse.
We were unwrapping the result of counting the characters in the vector
returned by collect_files(), which, if that vector is empty, returns
None. The most correct behavior is to halt if a nonexistent filename
was provided or a glob failed.
2020-09-30 15:52:21 -04:00
Patrick Thomson
33435f43c0 Take Max's suggestions. 2020-09-30 09:28:58 -04:00
Patrick Thomson
16bd061b33 Have the caller track stats here. 2020-09-29 15:43:30 -04:00
Patrick Thomson
939cdf12b9 Add --stats flag for reporting parse information. 2020-09-29 12:34:25 -04:00
Max Brunsfeld
5080de496a 0.17.1 2020-09-24 15:08:19 -07:00
Max Brunsfeld
ba239ce4ab Make query error line numbers consistently display 1-indexed 2020-09-24 15:03:51 -07:00
Max Brunsfeld
518916f221 Return correct path and line in query errors from the CLI 2020-09-24 13:47:27 -07:00
Max Brunsfeld
297e2bcb28 static query analysis: Fix handling of fields in hidden nodes 2020-09-23 16:55:48 -07:00
Max Brunsfeld
b6fba7ca4c 0.17.0 2020-09-23 13:09:19 -07:00
Max Brunsfeld
ffd3bdc4c1 Escape ? in C string literals
Fixes #714
2020-09-23 13:06:06 -07:00
Max Brunsfeld
cb343cad5e Avoid reusing the root node during incremental parsing
Fixes #712
2020-09-23 12:59:27 -07:00
Max Brunsfeld
21c3bbc4b4 Account for supertypes during query analysis 2020-09-23 10:55:31 -07:00
Max Brunsfeld
5003064da7 Make supertypes automatically hidden, without underscore prefix 2020-09-23 09:35:14 -07:00
Max Brunsfeld
8835dfda99 Fix test for supertypes in queries 2020-09-21 13:11:54 -07:00
Max Brunsfeld
b5a9adb555 Allow queries to match on supertypes
Co-authored-by: Ayman Nadeem <aymannadeem@github.com>
2020-09-21 12:34:48 -07:00
Max Brunsfeld
f10a8448ed
Merge pull request #723 from tree-sitter/comprehensive-wasm-help
Conditionally handle the presence/absence of build-wasm files.
2020-09-15 11:54:57 -07:00
Patrick Thomson
931d0c2600 fix warning and use implicit return here 2020-09-15 13:22:22 -04:00
Patrick Thomson
71f5908806 Max's suggestions. 2020-09-15 13:08:03 -04:00
Max Brunsfeld
ff488f89c9 Make the --prev-abi flag work w/ the newest abi change 2020-09-08 10:58:20 -07:00
Patrick Thomson
2a1bd3dbc2 Better naming. 2020-09-08 09:25:38 -04:00
Patrick Thomson
865f59ad74 No need for platformish logic in build.rs. 2020-09-08 09:23:54 -04:00
Patrick Thomson
660fe86300 web_ui and playground.js are always there. 2020-09-08 09:15:00 -04:00
Patrick Thomson
92a17e782f Conditionally compile with a cfg variable instead. 2020-09-02 15:32:12 -04:00
Max Brunsfeld
36a8821f3e Fix behavior of the last child operator in tree queries 2020-09-02 12:10:04 -07:00
Patrick Thomson
6256110bd2 simplest changes, just error in the build 2020-09-02 13:31:29 -04:00
Max Brunsfeld
4aba684d66 Control recursion depth explicitly during query analysis 2020-08-24 16:55:56 -07:00
Max Brunsfeld
2eb04094f8 Handle aliased parent nodes in query analysis 2020-08-21 14:12:04 -07:00
Max Brunsfeld
456b1f6771 Fix handling of alternations and optional nodes in query analysis 2020-08-20 16:28:54 -07:00
Max Brunsfeld
9daec9cb22 Tweak impossible pattern error messages 2020-08-20 13:35:11 -07:00
Max Brunsfeld
4301110c12 query: Indicate specific step that's impossible 2020-08-20 13:06:38 -07:00
Max Brunsfeld
bd42729a41 query: Avoid early-returning captures due to predicates 2020-08-18 13:01:45 -07:00
Max Brunsfeld
604f9e8148 query: Assign is_definite correctly for steps within nested sub-patterns 2020-08-18 10:55:03 -07:00
Max Brunsfeld
91fc9f5399 Use is_definite flag in ts_query_cursor_next_capture 2020-08-17 16:50:59 -07:00
Max Brunsfeld
228a9e28e1 Add tests for impossible queries 2020-08-17 13:27:17 -07:00
Max Brunsfeld
c3f9b2b377 Fix query analysis bugs found in ruby tags query 2020-08-17 09:57:06 -07:00