Commit graph

3420 commits

Author SHA1 Message Date
Max Brunsfeld
e49a56ea4c
Merge pull request #939 from tree-sitter/partial-order-precedence
Allow precedences to be specified using strings and a partial ordering relation
2021-02-25 13:16:01 -08:00
Max Brunsfeld
d8a235faa1 Add further static validation of named precedences 2021-02-25 11:54:21 -08:00
Max Brunsfeld
344797c110 Implement named precedence comparison 2021-02-24 16:02:56 -08:00
Himujjal Upadhyaya
225e15cb9f
Updated docs for tree-sitter-svelte (#936)
* updated docs & tests for tree-sitter-svelte

* added svelte to official docs

* final commit before adding svelte to the docs
2021-02-24 09:35:42 -08:00
Max Brunsfeld
d40f118370 Generalize precedence datatype to include strings
Right now, the strings are not used in comparisons, but they
are passed through the grammar processing pipeline, and are
available to the parse table construction algorithm.

This also cleans up a confusing aspect of the parse table
construction, in which precedences and associativities were
temporarily stored in the parse table data structure itself.
2021-02-23 20:48:39 -08:00
Patrick Thomson
84a34f46bc
Merge pull request #935 from fwouts/patch-1
Fix broken link to Ruby's Percent Strings
2021-02-23 17:03:42 -05:00
François Wouts
b7f99d45f0
Revert back to 2.5.0 to minimise changes 2021-02-24 07:56:26 +11:00
François Wouts
86d4be4ea7
Link to Ruby 3 docs instead 2021-02-24 07:55:48 +11:00
François Wouts
9437973b3e
Fix broken link to Ruby's Percent Strings
The current link fails with a 404.
2021-02-24 07:52:24 +11:00
Douglas Creager
85847b936a
Merge pull request #934 from tree-sitter/move-allocation-tracking
Move allocation tracking into lib crate
2021-02-23 12:45:45 -05:00
Douglas Creager
a7e2b6a8b2 Remove allocations_stubs
These were used to provide the `ts_record_*` functions regardless of
whether the `allocation-tracking` feature is enabled.  The allocation
tracking code is now implemented entirely in the `lib` crate, and only
when the feature is enabled, and so these stubs are no longer needed.
2021-02-23 09:39:39 -05:00
Douglas Creager
a29c8d9264 Move allocation tracking into lib crate
We have several test cases defined in the `cli` crate that depend on the
`lib` crate's `allocation-tracking` feature.  The implementation of the
actual allocation tracker used to live in the `cli` crate, close to the
test cases that use it.  The `allocation-tracking` feature in the `lib`
crate was just used to tell the tree-sitter implementation to expect
that the allocation tracker exists, and to use it.

That pattern meant that we had a circular dependency: `cli` depends on
`lib`, but `lib` required some code that was implemented in `cli`.
That, in turn, caused linker errors — but only when compiling in certain
configurations! [1]

This patch moves all of the allocation tracking implementation into the
`lib` crate, gated on the existing `allocation-tracking` feature, which
fixes the circular dependency.

Note that this patch does **not** fix the fact that feature unification
causes the `lib` crate to be built with the `allocation-tracking`
feature enabled, even though it's not a default.  Fixing that depends on
the forthcoming version 2 feature resolver [2], or using the `dev_dep`
workaround [3] in the meantime.

[1] https://github.com/tree-sitter/tree-sitter/issues/919
[2] https://doc.rust-lang.org/nightly/cargo/reference/features.html#feature-resolver-version-2
[3] https://github.com/tree-sitter/tree-sitter/issues/919#issuecomment-777107086
2021-02-23 09:16:37 -05:00
Max Brunsfeld
2f28a35e1b Handle unicode property escapes inside bracketed char classes
Refs #906
2021-02-18 22:27:44 -08:00
Max Brunsfeld
29bc26ecd5 Fix test failure after non-terminal extras change 2021-02-18 15:43:01 -08:00
Max Brunsfeld
796f655b03 0.18.2 2021-02-18 14:33:03 -08:00
Max Brunsfeld
86a891fa63 Fix bugs in parser generation for non-terminal extras
Previously, we attempted to completely separate the parse states
for item sets with non-terminal extras from the parse states
for other rules. But there was not a complete separation.

It actually isn't necessary to separate the parse states in this way.
The only special behavior for parse states with non-terminal extra rules
is what happens at the *end* of the rule: these parse states need to
perform an unconditional reduction.

Luckily, it's possible to distinguish these *non-terminal extra ending*
states from other states just based on their normal structure, with
no additional state.
2021-02-18 14:14:22 -08:00
Max Brunsfeld
b46d51f224 Add a unit test for all unicode character escape forms 2021-02-17 17:49:01 -08:00
Max Brunsfeld
5b630054c6 Handle negated unicode property escapes in regexes
Refs #380
2021-02-17 17:22:33 -08:00
Max Brunsfeld
6ae04051e7 Tweak whitespace in generated character set functions 2021-02-17 16:32:49 -08:00
Max Brunsfeld
9d9eb2234f
Merge pull request #906 from tree-sitter/unicode-property-escapes
Handle simple unicode property escapes in regexes
2021-02-17 16:14:42 -08:00
Max Brunsfeld
dad8546776 Generate more compact code for character set binary search 2021-02-17 13:52:23 -08:00
Max Brunsfeld
9abad258c3 Expand tests for unicode property escapes 2021-02-17 13:29:30 -08:00
Max Brunsfeld
6132a10b1c Use binary search in generated character set functions 2021-02-17 13:08:56 -08:00
Max Brunsfeld
f5a4c14dbe Add some doc comments to CharacterSet 2021-02-16 21:37:52 -08:00
Max Brunsfeld
699af84259 Don't rely on bash 4.0 to lowercase platform name on CI 2021-02-11 17:08:14 -08:00
Max Brunsfeld
86814ee4d7 In install script, expect 'v' prefix in release name 2021-02-11 16:39:34 -08:00
Max Brunsfeld
894357d1d1 In version script, add 'v' prefix to version tags 2021-02-11 16:16:19 -08:00
Max Brunsfeld
f32c7821ba Change expected mac release asset name osx -> macos 2021-02-11 16:15:03 -08:00
Max Brunsfeld
457c565266 Lowercase the OS in release asset filenames 2021-02-11 16:14:28 -08:00
Max Brunsfeld
0943dc27a2 Run CI for version tags 2021-02-11 15:21:04 -08:00
Max Brunsfeld
f51026dff1 0.18.1 2021-02-11 14:59:17 -08:00
Max Brunsfeld
28fd8b3371 web: 0.18.1 2021-02-10 16:22:51 -08:00
Max Brunsfeld
73e252e39b Add unit test for child_by_field_name w/ hidden nodes 2021-02-10 16:14:24 -08:00
Max Brunsfeld
038f4fcef8
Merge pull request #890 from wkordalski/fix-child-by-field
Fix getting node by field name or ID.
2021-02-10 15:58:31 -08:00
Max Brunsfeld
bf1854cb1b
Merge pull request #917 from ahlinc/contrib/master
parser.c - added LOG_LOOKAHEAD macro to escape \n in logging
2021-02-08 22:17:09 -08:00
Andrew Hlynskyi
6448053efa parser.c - added backslash escaping in LOG_LOOKAHEAD to make it clear in case of \n 2021-02-08 13:33:54 +02:00
Andrew Hlynskyi
51f8b16bb0 parser.c - make LOG_LOKAHEAD simpler according to disscussion in PR #917 2021-02-08 13:32:15 +02:00
Andrew Hlynskyi
f92ad04824 parser.c - added LOG_LOOKAHEAD macro to escape \n in logging 2021-02-08 06:23:55 +02:00
Max Brunsfeld
23b41862ab Put GH actions badge in the README 2021-02-05 12:22:46 -08:00
Max Brunsfeld
b2ab2e7175
Merge pull request #801 from tree-sitter/actions-ci
Switch to GitHub Actions CI.
2021-02-05 12:20:02 -08:00
Max Brunsfeld
242ad90770 Only build the CLI crate when running benchmarks 2021-02-05 11:57:34 -08:00
Max Brunsfeld
9857438d9b Revert "Print out tar version in CI"
This reverts commit 9c480bee23.
2021-02-05 11:26:40 -08:00
Max Brunsfeld
cd2c571f72 Restore the appveyor config file 2021-02-05 11:09:37 -08:00
Max Brunsfeld
9c480bee23 Print out tar version in CI 2021-02-05 10:35:13 -08:00
Max Brunsfeld
4c93178488 Revert "Revert "Remove emscripten caching again""
This reverts commit 82dad76b98.
2021-02-05 10:27:18 -08:00
Max Brunsfeld
6dbe6a3a90 Merge branch 'master' into actions-ci 2021-02-05 10:19:05 -08:00
Max Brunsfeld
f462f0d09d Fix small issues with new wasm bindings 2021-02-05 10:18:37 -08:00
Max Brunsfeld
82dad76b98 Revert "Remove emscripten caching again"
This reverts commit 94eeb0662f.
2021-02-05 09:44:32 -08:00
Max Brunsfeld
8050c4026c ci: Use gnu tar on macOS 2021-02-05 09:44:29 -08:00
Max Brunsfeld
f65b499a7c
Merge pull request #911 from michalmuskala/cursor-clone
Implement Clone for TreeCursor
2021-02-03 10:38:53 -08:00