Amaan Qureshi
d8ab779df4
fix(generate): do not generate large character sets for unused variables
2024-09-08 15:42:18 -04:00
Amaan Qureshi
5e46fef0d7
chore: clippy lints
2024-09-07 20:31:20 -04:00
Amaan Qureshi
fc4d7bd995
fix(cli): dedup preceding_auxiliary_symbols
2024-08-26 09:03:08 -04:00
Amaan Qureshi
26fa3a76a5
fix(generate): take AsRef<Path> for the path parameter to avoid clones
2024-04-27 17:09:36 -04:00
Max Brunsfeld
3498498449
Merge branch 'master' into simpler-large-char-set-code
2024-04-12 10:03:46 -07:00
Amaan Qureshi
abc7910381
refactor(rust): misc fixes & tidying
2024-04-11 22:35:43 -04:00
Amaan Qureshi
5825e24d56
style: wrap comments
2024-04-11 22:35:43 -04:00
Amaan Qureshi
b35efa8f33
style: format imports
2024-04-11 22:35:43 -04:00
Max Brunsfeld
1f0707e1ac
Fix clippy warnings
2024-04-11 16:29:59 -07:00
Max Brunsfeld
3d088888f5
Derive large character sets from lex states for individual tokens
2024-04-10 16:53:39 -07:00
Max Brunsfeld
be34bc9430
Identify large char sets for lexer using NFA transitions
2024-04-09 17:53:37 -07:00
Amaan Qureshi
754aa62e89
chore: turbofish styling
2024-03-17 05:36:30 -04:00
geekvest
b43e8ce902
docs: remove duplicate the's
...
Signed-off-by: geekvest <cuimoman@sohu.com>
2024-03-03 10:30:21 -05:00
Amaan Qureshi
b40839cd72
style: prefer turbofish syntax where possible
2024-02-19 16:00:50 -05:00
dundargoc
df1fe842eb
docs: various fixes
...
Closes https://github.com/tree-sitter/tree-sitter/issues/1317 .
Closes https://github.com/tree-sitter/tree-sitter/issues/1752 .
Closes https://github.com/tree-sitter/tree-sitter/issues/2439 .
Co-authored-by: Simon Hengel <sol@typeful.net>
Co-authored-by: Akash Yadav <itsaky01@gmail.com>
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Co-authored-by: Laytan Laats <laytanlaats@hotmail.com>
2024-02-08 00:08:59 +01:00
Amaan Qureshi
59be1edaa1
refactor: swap &Vec[T] with &[T] where appropriate
2024-02-07 02:50:31 -05:00
dundargoc
c8bd6705cf
chore: clippy
2024-02-06 23:34:14 -05:00
Amaan Qureshi
04ff704bca
chore(cli): apply clippy fixes
2024-02-04 04:18:48 -05:00
Amaan Qureshi
f35752e3ac
feat!: support the case-insensitive regex flag
2023-08-06 23:40:29 -04:00
Amaan Qureshi
f4e788b28e
feat: warn when unused conflicts are present in a grammar
2023-07-28 00:23:28 -04:00
Kian-Meng Ang
b8552ec6c4
Fix typos
2022-06-28 19:57:42 +08:00
Paul Gey
a533e4d7bb
Remove unnecessary borrows
...
This produces an `unused_must_use` warning on nightly:
https://github.com/rust-lang/rust/pull/86426
2021-08-14 15:44:24 +02:00
Paul Gey
cf69a2c94c
Use IndexMap and FxHash for some hot hash maps
2021-08-08 21:45:43 +02:00
Douglas Creager
d2d01e77e3
cli: Use anyhow and thiserror for errors
...
This patch updates the CLI to use anyhow and thiserror for error
management. The main feature that our custom `Error` type was providing
was a _list_ of messages, which would allow us to annotate "lower-level"
errors with more contextual information. This is exactly what's
provided by anyhow's `Context` trait.
(This is setup work for a future PR that will pull the `config` and
`loader` modules out into separate crates; by using `anyhow` we wouldn't
have to deal with a circular dependency between with the new crates.)
2021-06-09 16:17:23 -04:00
Andrew Hlynskyi
b856f7e1bd
Remove unneeded dead_code annotations
2021-04-30 06:55:00 +03:00
Max Brunsfeld
c3eb5daa31
Include has_preceding_inherited_fields in Item's hash impl
2021-03-27 10:08:24 -07:00
Max Brunsfeld
7300249d20
Fix incorrect merging of states with different inherited fields
...
Co-authored-by: Douglas Creager <dcreager@dcreager.net>
2021-03-05 14:49:28 -08:00
Max Brunsfeld
dd4cba2625
Allow symbols to be used in precedence lists
2021-03-03 13:11:05 -08:00
Max Brunsfeld
344797c110
Implement named precedence comparison
2021-02-24 16:02:56 -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
Max Brunsfeld
29bc26ecd5
Fix test failure after non-terminal extras change
2021-02-18 15:43:01 -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
2b0de9dfec
Fix small bugs in conflict reporting
...
* Negative precedence values were not displayed
* Rule names were repeated in resolution suggestions
2021-02-01 13:30:06 -08:00
Max Brunsfeld
ab78ab3f9b
Represent CharacterSet internally as a vector of ranges
2021-01-28 16:10:39 -08: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
81bbdf19f4
Fix handling of non-terminal extras that share non-extra rules
...
Fixes #701
2020-07-29 09:50:13 -07: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
d3b7caa565
Add a TSLexer.eof() API, use it in generated parsers
2019-10-31 14:11:52 -07:00
Max Brunsfeld
0cceca7b4e
Rename extra_tokens -> extra_symbols
2019-10-21 17:26:01 -07:00
Max Brunsfeld
fcaabea0cf
Allow non-terminal extras
2019-10-21 16:08:59 -07:00
Max Brunsfeld
c9f46b8242
Fix false negative in token conflict detection
...
Co-Authored-By: Timothy Clem <timothy.clem@gmail.com>
2019-09-19 11:50:38 -07:00
Max Brunsfeld
aeb2f895b4
Add --report-states flag for reporting state counts for each rule
2019-08-29 17:36:39 -07:00
Max Brunsfeld
48a883c1d4
Move external token state id computation out of render module
2019-08-29 15:48:22 -07:00
Max Brunsfeld
759c1d6e65
Reorder parse states by descending symbol count
2019-08-29 15:28:29 -07:00
Max Brunsfeld
2430733ee8
Avoid iterating hashmaps in places where order matters
2019-08-29 15:26:05 -07:00
Max Brunsfeld
f371507d39
Move TokenSet to rules module
2019-08-29 15:25:45 -07:00
Max Brunsfeld
5e04daf483
Avoid non-deterministic set iteration order when handling conflicts
2019-08-13 15:57:42 -07:00
Max Brunsfeld
56ce4e5d50
Upgrade rsass, remove hashbrown
2019-08-13 10:08:58 -07:00
Max Brunsfeld
5f369a5870
Fix another empty array literal for MSVC compatibility
2019-08-12 15:13:41 -07:00
Max Brunsfeld
f4740a1beb
Make properties generation aware of which nodes are leaves
2019-07-22 09:30:05 -07:00