Max Brunsfeld
201b41cf11
feat: add 'reserved word' construct
...
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-12-23 03:06:32 -05:00
ObserverOfTime
c5ee0ac070
feat(lib): add the language name
2024-10-26 23:53:58 +00:00
Amaan Qureshi
ce93d8fd9b
feat!: bump internal abi to 15
2024-10-26 17:02:00 +00:00
Amaan Qureshi
50eaf0b6cd
style(lib): add parameter names in declarations that are missing them
2024-09-27 13:38:08 -04:00
Max Brunsfeld
8dded3ab60
Fix crash when attempting to load ancient languages via wasm
2024-02-23 11:48:14 -08:00
Amaan Qureshi
f4c40f6098
fix: do not install parser.h
2024-02-02 11:30:24 -05:00
Andrew Hlynskyi
26c3ae7b98
Rename: ts_lookahead_iterator_advance -> ts_lookahead_iterator_next
2023-08-09 14:40:29 +03:00
Daumantas Kavolis
c47e217e73
API extensions
2023-08-02 00:02:33 +03:00
Amaan Qureshi
13f6ec2b0c
fix: rename shadowed variables from -Wshadow warnings and apply some useful clang-tidy warnings
2023-07-19 18:12:26 -04:00
Max Brunsfeld
3ac36b0cbe
Handle backslashes in token names when printing DOT debug graphs
2022-06-25 17:13:11 -07:00
Max Brunsfeld
516fd6f6de
Add --abi flag to generate command, generate version 13 by default
2022-01-17 14:50:47 -08:00
Alex Pinkus
eaf9b170f1
Don't start with duplicate states in ts_query__analyze_patterns
...
This change exposes a new `primary_state_ids` field on the `TSLanguage`
struct, and populates it by tracking the first encountered state with a
given `core_id`. (For posterity: the initial change just exposed
`core_id` and deduplicated within `ts_analyze_query`).
With this `primary_state_ids` field in place, the
`ts_query__analyze_patterns` function only needs to populate its
subgraphs with starting states that are _primary_, since non-primary
states behave identically to primary ones. This leads to large savings
across the board, since most states are not primary.
2022-01-16 11:17:47 -08:00
Max Brunsfeld
e710a14244
Simplify ts_language_has_actions so it allows non-terminals
...
Fixes #933
2021-02-26 14:52:41 -08:00
Max Brunsfeld
774ae5e3d5
In parse tables, store production ids as 16 bits
...
Also remove the use of bitfields from the parse table format.
In all cases, bitfields were not necessary to achieve the
current binary sizes. Avoiding them makes the binaries more
portable.
There was no way to make this change backward-compatible,
so we have finally dropped support for parsers generated
with an earlier version of Tree-sitter.
At some point, when Atom adopts this version of Tree-sitter,
this change will affect Atom users who have installed packages
using third-party Tree-sitter parsers. The packages will need
to be updated to use a regenerated version of the parsers.
2021-02-25 16:12:31 -08:00
Max Brunsfeld
2eb04094f8
Handle aliased parent nodes in query analysis
2020-08-21 14:12:04 -07:00
Max Brunsfeld
aac75e35b1
Optimize iteration over state successors during query analysis
2020-08-19 14:56:57 -07:00
Max Brunsfeld
4c2f36a07b
Mark steps as definite on query construction
...
* Add a ts_query_pattern_is_definite API, just for debugging this
* Store state_count on TSLanguage structs, to allow for scanning parse tables
2020-06-25 15:06:27 -07:00
Max Brunsfeld
6a46dff89a
Add ts_language_alias_at helper function
2020-06-25 15:06:26 -07:00
Riccardo Schirone
780e9cecc9
Do not use multiple unnamed structs inside of unions
2020-04-29 20:42:45 +02:00
Max Brunsfeld
096014cb3e
Clean up ts_language_next_state
2020-02-07 14:06:14 -08:00
Max Brunsfeld
ee7c29346a
Small cleanup
2020-01-29 16:48:36 -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
69ab405325
In next ABI, group symbols by action in small parse state table
...
This is a more compact representation because in most states, many
symbols share the same actions.
2019-08-30 20:29:55 -07:00
Max Brunsfeld
09a2755399
Store parse states with few lookahead symbols in a more compact way
2019-08-29 15:52:23 -07:00
Max Brunsfeld
9f608435ee
Fix errors in when languages have no fields
2019-02-12 17:20:12 -08:00
Max Brunsfeld
56309a1c28
Generate node-fields.json file
2019-02-12 11:06:18 -08:00
Max Brunsfeld
79d90f0d3e
Restore naming of alias sequence lengths
...
Fields aren't stored in sequences now, so the max length
is back to being just for aliases.
2019-02-08 16:14:18 -08:00
Max Brunsfeld
d8a2c0dda2
Use a separate type for storing field map headers
2019-02-08 16:06:29 -08:00
Max Brunsfeld
1d1674811c
Fully implement ts_node_child_by_field_id
2019-02-08 15:16:56 -08:00
Max Brunsfeld
18a13b457d
Get basic field API working
2019-02-08 15:16:56 -08:00
Max Brunsfeld
0f2347b318
Just call the C lib 'the library' everywhere, don't call it a 'runtime'
2019-01-10 15:22:39 -08:00
Max Brunsfeld
dd416b0955
Update include paths to not reference 'runtime' directory
2019-01-04 17:33:34 -08:00
Max Brunsfeld
47607cecf4
Reorganize repo, add rust CLI and binding code,
2019-01-04 17:31:49 -08:00