Max Brunsfeld
f7c9989b48
Fix crash when parser's wasm store is taken before its language is changed
2023-01-23 15:26:54 -08:00
Max Brunsfeld
6d34e5cb5c
Refactor storage of wasm stdlib function indices
2023-01-23 15:19:42 -08:00
Max Brunsfeld
555277a102
Allow testing highlight and tag queries when testing wasm build
...
Replace non-mutating `ts_parser_wasm_store` function with
`ts_parser_take_wasm_store`, which removes and returns the wasm
store, in order to facilitate single ownership.
2023-01-23 11:46:59 -08:00
Phil Freeman
eb549a89ad
fix: possible rollover of nanoseconds in clock.h
2022-12-14 09:43:58 -08:00
Max Brunsfeld
51720beeb0
Start work on a --wasm flag for the test subcommand
2022-11-15 17:14:33 -08:00
Max Brunsfeld
9cbeaf27da
Get wasm.c compiling when wasm feature is disabled
2022-11-15 17:14:33 -08:00
Max Brunsfeld
98ccfcffb0
Provide minimal C/C++ std library to wasm external scanners
2022-11-15 17:14:33 -08:00
Max Brunsfeld
7dc81303f6
Get wasm store working with parser with stateless external scanners
2022-11-15 17:14:33 -08:00
Max Brunsfeld
ef1e3fb133
Use an unchecked function call for running the lex functions
2022-11-15 17:14:33 -08:00
Max Brunsfeld
3869878530
Use unchecked host functions for lexer callbacks
2022-11-15 17:14:33 -08:00
Max Brunsfeld
042e6f9d57
Restucture wasm module, return a normal TSLanguage from load_language
2022-11-15 17:14:33 -08:00
Max Brunsfeld
3f1a7f9cd4
Start work on ability to load wasm languages from native lib, via wasmtime
2022-11-15 17:14:33 -08:00
Max Brunsfeld
efd22e452b
Fix suppression of empty tokens during error handling at included range boundaries
2022-11-14 12:20:39 -08:00
Max Brunsfeld
d07f864815
Fix parse error when reusing a node at the end of an included range
2022-11-11 16:34:57 -08:00
Max Brunsfeld
da6e24de17
Fix adjustment of trees' included ranges on edits
...
Previously, when an included range started or ended *inside* of
an edit, that range did not get updated correctly.
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2022-11-07 16:52:19 -08:00
Max Brunsfeld
1848d0bc36
Add tree included ranges getter
...
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-11-04 15:24:07 -07:00
Logan Collins
5337a678fa
Resolving a potential crash freeing a null pointer when cancelling parses.
2022-10-31 11:35:52 -07:00
Matt
98b8226c70
Remove unnecessary cast
2022-09-21 20:17:30 -04:00
Matt
8751fa0853
Add explicit casting for array capacities
2022-09-21 15:52:44 -04:00
Max Brunsfeld
70cfc55e58
Merge pull request #1879 from mattmassicotte/fix/sizes
...
change integer type in ts_parser__set_cached_token
2022-09-21 10:25:38 -07:00
Matt
af6611e530
matching integer types
2022-09-21 08:50:01 -04:00
Max Brunsfeld
67d13cf50b
Fix integer size of subtree's child count field
...
Fixes tree-sitter/tree-sitter-cpp#175
2022-09-08 11:02:42 -07:00
Max Brunsfeld
1b86ccecc8
Merge pull request #1845 from tree-sitter/root-node-with-offset
...
Add API for applying a positional offset when accessing a tree's nodes
2022-08-25 10:51:20 -07:00
Max Brunsfeld
6b87326470
Merge pull request #1787 from kianmeng/fix-typos
...
Fix typos
2022-08-25 10:25:39 -07:00
Max Brunsfeld
53ed4cf037
Tolerate tree edits whose old range extends beyond the end of the tree
2022-08-25 10:20:40 -07:00
Max Brunsfeld
477b667753
Add ts_tree_root_node_with_offset API
2022-08-18 13:48:47 -07:00
Sebastian Lackner
1245d54fb8
Fix crash in ts_node_field_name_for_child when no children are present
2022-07-27 12:26:35 +02:00
Sebastian Lackner
2174288e30
query: Use uint16_t for production_id in AnalysisSubgraphNode struct
2022-07-26 21:50:38 +02:00
Max Brunsfeld
79eaa68793
Don't match nested wildcard patterns against error nodes
2022-07-07 18:11:52 -07:00
Max Brunsfeld
254edb0ec8
Include captured summary information in stack debug graphs
2022-07-07 17:53:54 -07:00
Max Brunsfeld
548c12fb88
Fix bug where patterns with top-level alternatives were not considered 'rooted'
2022-07-07 17:53:54 -07:00
Max Brunsfeld
1401767689
query: Don't attempt to match top-level sibling patterns directly in ERROR nodes
...
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-07-07 15:27:00 -07:00
Kian-Meng Ang
b8552ec6c4
Fix typos
2022-06-28 19:57:42 +08:00
Max Brunsfeld
3ac36b0cbe
Handle backslashes in token names when printing DOT debug graphs
2022-06-25 17:13:11 -07:00
Max Brunsfeld
5aa2f4dc8c
Log when ignoring an empty external token after an error
2022-06-24 19:07:27 -07:00
Max Brunsfeld
d223a81b50
Allow empty external tokens during err recovery if they change the scanner's state
2022-06-24 15:58:13 -07:00
Max Brunsfeld
c0e1991f6b
🎨 ts_parser__lex
2022-06-24 14:24:21 -07:00
Max Brunsfeld
ca902065cb
Fix bug when stack versions merge after reducing a non-terminal extra
2022-06-24 14:24:21 -07:00
Max Brunsfeld
58b719541b
Fix failure to match queries with wildcard at root with range restrictions
2022-06-22 15:54:06 -07:00
Rich Siegel
150eb2966b
Fixed warning/error when compiling with clang -Os.
...
DISCUSSION:
When compiling with `-Os` for "smallest, fastest", an error is reported in `parser.c`:
```
/Users/siegel/git/tree-sitter/lib/src/./parser.c:1368:10: error: unused variable 'did_merge' [-Werror,-Wunused-variable]
bool did_merge = ts_stack_merge(self->stack, version, previous_version_count);
^
1 error generated.
```
This is because with `NDEBUG` set, `assert(e)` collapses to `(void)0`,
which in turn means that `did_merge` does not actually get consumed.
This seems to get caught when compiling with `-Os`, but not otherwise.
Compiler version:
```
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: arm64-apple-darwin21.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
```
2022-03-04 18:00:16 -05:00
Max Brunsfeld
8decec3774
Properly incorporate lookahead bytes when recovering via missing token
2022-03-02 17:12:25 -08:00
Max Brunsfeld
0fb864c1a0
Retain information about the lexer's lookahead for the token where an error was detected
2022-02-22 09:45:26 -08:00
Max Brunsfeld
0bdd9b640c
Store the lookahead subtree of paused stack versions, not just the lookahead symbol
2022-02-22 09:45:26 -08:00
Max Brunsfeld
d08f1af15c
🎨
2022-02-22 09:43:57 -08:00
Max Brunsfeld
cb4317ba8e
Change goto_first_child_for_{byte,point} to compare nodes' ranges inclusively
...
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-02-04 12:38:33 -08:00
Amin Yahyaabadi
94ffcdadf3
Mark stack__iter as static
...
Fixes
```
warning: In file included from src\lib.c:14:
warning: src/./stack.c:311:9: warning: static function 'ts_stack__add_slice' is used in an inline function with external linkage [-Wstatic-in-inline]
warning: ts_stack__add_slice(
warning: ^
warning: src/./stack.c:274:1: note: use 'static' to give inline function 'stack__iter' internal linkage
warning: inline StackSliceArray stack__iter(Stack *self, StackVersion version,
warning: ^
warning: static
warning: src/./stack.c:15:16: note: expanded from macro 'inline'
warning: #define inline __forceinline
warning: ^
warning: src/./stack.c:258:13: note: 'ts_stack__add_slice' declared here
warning: static void ts_stack__add_slice(Stack *self, StackVersion original_version,
warning: ^
warning: 1 warning generated.
Finished dev [unoptimized + debuginfo] target(s) in 2.01s
```
2022-01-21 22:39:38 -08:00
Amin Yahyaabadi
6e0c49305e
Use ISO C and C++ conformant name: _fdopen on windows
...
Fixes
```
warning: In file included from src\lib.c:12:
warning: src/./parser.c:1781:28: warning: 'fdopen' is deprecated: The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _fdopen. See online help for details. [-Wdeprecated-declarations]
warning: self->dot_graph_file = fdopen(fd, "a");
warning: ^
warning: C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\stdio.h:2431:28: note: 'fdopen' has been explicitly marked deprecated here
warning: _Check_return_ _CRT_NONSTDC_DEPRECATE(_fdopen) _ACRTIMP FILE* __cdecl fdopen(_In_ int _FileHandle, _In_z_ char const* _Format);
warning: ^
warning: C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt.h:414:50: note: expanded from macro '_CRT_NONSTDC_DEPRECATE'
warning: #define _CRT_NONSTDC_DEPRECATE(_NewName) _CRT_DEPRECATE_TEXT( \
warning: ^
warning: C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.29.30133\include\vcruntime.h:310:47: note: expanded from macro '_CRT_DEPRECATE_TEXT'
warning: #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
```
2022-01-21 22:39:24 -08:00
Max Brunsfeld
584b55df8d
Delete unused code, tweak whitespace
2022-01-19 16:54:57 -08:00
Max Brunsfeld
fce23d63b3
Merge pull request #1602 from the-mikedavis/md-ignore-future-matches-for-non-local-patterns
...
prevent future captures for `#is-not? local` matches
2022-01-19 16:40:30 -08:00
Michael Davis
716ef24578
remove unfinished queries from 'ts_query_cursor_remove_match'
2022-01-18 17:01:07 -06:00