Commit graph

52 commits

Author SHA1 Message Date
Christian Clason
e7f9160867
Revert "feat: add build sha to parser.c header comment" (#4475)
This reverts commit dc4e232e6e.

Reason: The sha in the generated output (which most distro builds of
tree-sitter, including `cargo install`, strip) produces too many
conflicts when verifying via CI that parsers are regenerated on every
grammar change.
2025-05-29 11:47:06 -07:00
Amaan Qureshi
3056dc5be4 fix(generate): mark url as a Windows-only dependency 2025-04-28 18:31:09 -04:00
Jon Shea
92c5d3b8e2 fix(rust): clarify error message for non-token reserved words
Improve the `NonTokenReservedWord` error message by including the
specific reserved word that was not used as a token.
2025-04-09 18:15:48 -04:00
Edgar Onghena
52d2865365
chore(generate): add @generated to parser.c header (#4338)
This makes `parser.c` follow the https://generated.at/ convention for generated files. This potentially allows any compatible IDE to discourage editing it directly.
2025-04-08 10:52:37 +02:00
WillLillis
11071ed682 fix(rust): adapt to new nightly lint 2025-03-06 09:32:21 +01:00
polazarus
8138dba800
fix(generate): mark TSCharacterRange as static (#4255)
Problem: Linking different parsers into one executable fails due to duplicate symbols.

Solution: Mark `TSCharacterRange` as `static` when generating parsers.

fixes #4209
2025-03-04 15:26:13 +01:00
Yuri Astrakhan
b749c02eb5 Mark all format-like macros for Clippy
See https://doc.rust-lang.org/nightly/clippy/attribs.html#clippyformat_args

Ensure that usage of the macros with `format!`-like parameters will be validated by Clippy
2025-03-03 02:16:23 -05:00
WillLillis
cb30ec5b17 fix(rust): adapt to some new nightly lints 2025-03-02 16:37:03 -05:00
Amaan Qureshi
74d7ca8582 fix(rust): adapt to new clippy lints 2025-02-08 13:15:56 -05:00
Amaan Qureshi
959f096a89 feat(generate): defer to ABI 14 if tree-sitter.json doesn't exist, rather than hard failing 2025-01-26 13:12:58 -05:00
Amaan Qureshi
8bb1448a6f feat: add the semantic version to TSLanguage, and expose an API for retrieving it 2025-01-25 01:14:30 -05:00
Yuri Astrakhan
3e7721e554 chore: a few more minor lints 2025-01-23 00:10:16 -05:00
Yuri Astrakhan
9dbe165296 chore: a few minor lints
* do not use `&` for the format args as it cannot (yet) be optimized by the compiler
* a few format inlining
2025-01-21 00:57:58 -05:00
Yuri Astrakhan
48059b72a8 feat: remove lazy_static in favor of LazyLock
This switches to the built-in `std::sync::LazyLock`
2025-01-21 00:21:35 -05:00
WillLillis
23e0891cd5 fix(cli): improve error message for nonterminals used in token rule 2025-01-13 01:12:20 -05:00
Amaan Qureshi
b26adf4265 feat(generate): add an extra field for extra nodes in node-types.json 2025-01-12 18:41:25 -05:00
Amaan Qureshi
ac8bb1b777 build: bump other crates' MSRV to 1.82 2025-01-12 04:47:59 -05:00
Amaan Qureshi
52ef2992aa feat(generate): properly filter out unused rules 2025-01-12 04:47:59 -05:00
Amaan Qureshi
9d9c76e693 feat(generate): explicitly disallow non-terminals in non-terminals 2025-01-12 04:47:59 -05:00
WillLillis
329dcc92a1 fix(rust): adapt to a few new nightly lints 2025-01-10 22:00:23 -05:00
Amaan Qureshi
d38aa596e1 fix(generate): improve error message when a duplicate token is used as the word token 2025-01-10 02:58:38 -05:00
Amaan Qureshi
4d6740980c fix(generate): improve display of token sets with escape characters 2025-01-10 02:58:38 -05:00
Amaan Qureshi
68e707eb4f feat: support passing in a Rust regex in the grammar dsl 2025-01-06 20:52:19 -05:00
WillLillis
867433afd7 feat(rust): use thiserror for generate crate
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2025-01-05 00:27:12 -05:00
Riley Bruins
19482834bd feat: add Supertype API
Introduces a new function that takes in a supertype symbol and returns
all associated subtypes. Can be used by query.c to give better errors
for invalid subtypes, as well as downstream applications like the query
LSP to give better diagnostics.
2025-01-05 00:14:09 -05:00
Owen Shepherd
77f74a05c7
chore(generate): remove unused fields 2025-01-02 22:11:04 -05:00
Max Brunsfeld
201b41cf11
feat: add 'reserved word' construct
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-12-23 03:06:32 -05:00
Amaan Qureshi
8744a4e3f2 feat(lib): use const for TSCharacterRanges 2024-12-23 01:19:10 -05:00
Amaan Qureshi
274e60a523
fix: clippy lints 2024-11-16 03:20:59 -05:00
Amaan Qureshi
05b2f443ba
fix: clippy lint 2024-11-15 23:54:18 -05:00
Riley Bruins
bcf82da55c refactor: reuse symbol variable in subtype map generator
Tiny change to prevent redundant creation of a symbol value in
`node_types.rs`.
2024-11-13 20:54:57 -05:00
Amaan Qureshi
998d2c9d8c fix(generate): do not set the unit reduction symbol if it's in the extras array 2024-11-02 04:20:40 -04:00
Amaan Qureshi
310a9f0704 fix: disallow tokens that match the empty string 2024-11-02 03:36:11 -04:00
Amaan Qureshi
7baefa8609 fix(cli): use contains over is in warning 2024-11-02 01:31:46 -04:00
dundargoc
a3de650024 fix: make sha generation work with submodules
More specifically, change `is_dir` to `exists` as `.git` is a file when
in a submodule.
2024-10-28 12:16:48 +01:00
dundargoc
dc4e232e6e feat: add build sha to parser.c header comment 2024-10-28 12:16:48 +01:00
ObserverOfTime
c5ee0ac070 feat(lib): add the language name 2024-10-26 23:53:58 +00:00
Amaan Qureshi
42dd32d184 build: remove unicode files and script, move cliff.toml 2024-10-26 23:25:12 +00:00
Amaan Qureshi
c8cf75fd30 feat(generate)!: use regex_syntax::Hir for expanding regexes
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-10-26 23:25:12 +00:00
Amaan Qureshi
ce93d8fd9b feat!: bump internal abi to 15 2024-10-26 17:02:00 +00:00
ObserverOfTime
7f0c5f928a feat(generate): add a comment with the tree-sitter version 2024-10-24 17:07:15 +00:00
ObserverOfTime
881c54e462 fix(lib): handle compiler warnings 2024-10-19 02:57:08 +00:00
Owen Shepherd
e87181ec9c
fix(cli): remove unnecessary referencing/dereferencing in build_parse_table
These were probably optimized away, and in any case are only run once,
per CLI run, but may as well remove them.
2024-10-17 15:25:44 -04:00
Amaan Qureshi
9c08edb066 build: configure clippy lints at the workspace level 2024-10-08 21:07:41 -04:00
Will Lillis
5c6445edea
chore: misc clippy lints 2024-10-06 17:55:00 -04:00
JCWasmx86
099fd4efb7 feat: allow setting the output directory for generated source files 2024-10-05 21:52:07 -04:00
Amaan Qureshi
2047b22ae5
fix(generate): move generated header files into the generate crate 2024-10-04 00:47:30 -04:00
Amaan Qureshi
49bda0e2c5 fix(generate): filter out unused rules in other spots 2024-10-03 19:32:09 -04:00
Amaan Qureshi
99a0ddc4c2 fix(generate): remove unused rules 2024-10-03 16:40:51 -04:00
Amaan Qureshi
ea3846a2c5
feat: move tree-sitter configuration to dedicated file (#3700) 2024-09-30 11:11:23 -04:00