Commit graph

305 commits

Author SHA1 Message Date
Amaan Qureshi
eb332ffa4d style(bindings): consistent wording 2024-02-27 16:07:38 -05:00
ObserverOfTime
502dacf220 refactor: rename TS_REUSE_ALLOCATOR flag
TREE_SITTER_REUSE_ALLOCATOR is more consistent
2024-02-27 15:54:38 -05:00
ObserverOfTime
46520eda58 build(bindings): metadata improvements 2024-02-27 15:54:38 -05:00
Amaan Qureshi
f7c13406c9 build: add uninstall command 2024-02-27 15:54:38 -05:00
ObserverOfTime
799833f9cf build: use c11 everywhere
And improve the makefiles
2024-02-27 15:54:38 -05:00
ObserverOfTime
412a6a774e refactor(bindings): remove npmignore
Replace with package.json files
2024-02-27 06:22:00 -05:00
Amaan Qureshi
8ae3870b51 fix(generate): add .npmignore, populate Swift's exclude list 2024-02-26 14:30:48 -05:00
ObserverOfTime
721eca2394 fix(bindings): editorconfig and setup.py fixes 2024-02-26 12:00:16 -05:00
Amaan Qureshi
f1eecf9786 feat: expose the allocator and array header files for external scanners 2024-02-26 09:43:13 -05:00
Amaan Qureshi
9e5bf6591f feat: improve language bindings
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2024-02-25 19:06:01 -05:00
Max Brunsfeld
29d3583bdf Use workspace dependencies for internal crates 2024-02-25 11:14:29 -08:00
Amaan Qureshi
32c23b6c90 fix: wrap || comparison in parenthesis when && is used 2024-02-24 01:35:40 -05:00
Max Brunsfeld
1f751bbd5f
Merge pull request #2841 from segevfiner/patch-1
Make Node.js language bindings context aware
2024-02-23 11:23:11 -08:00
Amaan Qureshi
b40839cd72 style: prefer turbofish syntax where possible 2024-02-19 16:00:50 -05:00
Amaan Qureshi
d95fcc83b9 fix: remove redundant imports 2024-02-19 06:36:48 -05:00
Amaan Qureshi
5b299eafe5
fix: don't throw an error if the user uses map in the grammar 2024-02-18 00:26:14 -05:00
Amaan Qureshi
da1f890752 chore: error out when multiple arguments are passed to token/token.immediate 2024-02-17 01:26:44 -05:00
Amaan Qureshi
8dd65ccbc0 refactor: &PathBuf -> &Path 2024-02-17 00:45:28 -05:00
Amin Yahyaabadi
51c147053e
feat: error out if an empty string is in the extras array
This prevents never-ending loops in the parser
2024-02-13 15:00:48 -05:00
Amaan Qureshi
5ea0dbf77a chore: some more clippy lints 2024-02-13 03:33:07 -05:00
Amaan Qureshi
3da79ba2b6 fix: update schema for regex flags 2024-02-12 15:39:14 -05:00
Amaan Qureshi
ce5f5fffc1 chore(generate): dedup and warn about duplicate or invalid rules 2024-02-11 01:28:31 -05:00
Amaan Qureshi
78ccc39ca9
fix: properly error out when the word property is an invalid rule 2024-02-11 00:37:23 -05:00
Amaan Qureshi
3d68ca4583 fix: inherited grammar generation 2024-02-10 18:25:35 -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
767db31114
fix: remove redundant code 2024-02-07 07:13:03 -05:00
Amaan Qureshi
993ee75d8c
fix: don't add extraneous exports to the json and add missing rules to the schema 2024-02-07 07:10:51 -05: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
root
b7d48b48fd
chore(cli): update to regex-syntax 0.8
regex-syntax has restructured the Ast enum a bit, rather than having a Class
member it now has seperate members for different types of Class.
2024-02-05 01:22:09 -05:00
Amaan Qureshi
000c2f4dec
feat: allow the grammar to log to stdout 2024-02-05 00:46:34 -05:00
Amaan Qureshi
04ff704bca
chore(cli): apply clippy fixes 2024-02-04 04:18:48 -05:00
Segev Finer
4a42c6d5f1
Make Node.js language bindings context aware
They don't have any dynamic global data, so all it takes is just declaring them as such
2023-12-28 16:39:19 +02:00
Andrew Hlynskyi
d56b51a11d
Revert "Alt #2454" 2023-11-29 11:20:05 +02:00
Andrew Hlynskyi
60779cc1ac fix(gen): parser.c should include parser.h relatively 2023-08-26 20:57:08 +03:00
Amaan Qureshi
6d41d99990
Merge pull request #2559 from amaanq/silent-ignore-u
fix: ignore regex u flag
2023-08-25 19:25:15 -04:00
Amaan Qureshi
6969766664 fix: ignore regex u flag
It's needed for certain regex patterns in JS, and we can just silently ignore it.
2023-08-25 19:23:08 +03:00
Andrew Hlynskyi
b3fef28a10 chore(gen): add parser.c enum names to be better discoverable 2023-08-25 19:11:42 +03:00
Andrew Hlynskyi
fbfa58edc8 chore(gen): move external scanner stuff closer to the end of parser.c 2023-08-25 19:11:42 +03:00
Andrew Hlynskyi
683fe442e4 fix(gen): cycle between aliases and anonymous symbols
An example of an error cycle in a `parser.c`:

```
static const TSSymbol ts_symbol_map[] = {
  ...
  [anon_sym_RBRACE] = anon_sym_RBRACE2,
  [anon_sym_RBRACE2] = anon_sym_RBRACE,
  ...
};
```
2023-08-23 16:51:05 +03:00
Amaan Qureshi
e0434327d0
fix(render): only output SPACE for strings that are just a space 2023-08-16 13:44:44 -04:00
Amaan Qureshi
2d0a3d647b
Merge pull request #2491 from amaanq/sanitize
fix: replace & sanitize more characters
2023-08-13 20:15:20 -04:00
Amaan Qureshi
0b1b0d2fb7
fix: replace & sanitize more characters 2023-08-13 19:29:37 -04:00
Amaan Qureshi
318d4a705a fix: don't add flags if they're not present 2023-08-13 16:28:03 -04:00
Amaan Qureshi
dee98e06e9
Merge pull request #2474 from amaanq/case-insensitive
feat!: support the case-insensitive regex flag
2023-08-11 23:12:15 -04:00
Andrew Hlynskyi
4a007259fc Fix warning from #2454 in more clear way 2023-08-10 03:59:34 +03:00
Amaan Qureshi
f35752e3ac
feat!: support the case-insensitive regex flag 2023-08-06 23:40:29 -04:00
Amaan Qureshi
96919cae5d
fix(generate): add Vertical Tab and Form Feed to the whitespace class 2023-08-06 20:41:09 -04:00
Jake Sarjeant
61b70943b1 feat(cli): add option to select JS runtime other than node 2023-08-03 21:34:47 +03:00
Amaan Qureshi
b8fe5fe21b fix: do not allow eof to advance states if the new state is the same state 2023-08-02 10:47:27 +01:00