@willbooster/tree-sitter-c 45.0.3 → 46.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/scanner.c +1 -1
- package/tree-sitter-c.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ and starter characters before `scan_c_token_slow` or token-specific lookahead ru
|
|
|
85
85
|
external token the derived grammar adds (including unspaced tokens, error-recovery slots, and spaced punctuation or identifier starters), or
|
|
86
86
|
those filters will reject the derived tokens before their scanner runs. When the scanner is ready and only extras, conditional markers,
|
|
87
87
|
`_trailing_object_declaration_start`, or external directive tokens are valid, dispatch to `scan_extras` first. Otherwise check null-directive consumption before directive-body tokens,
|
|
88
|
-
then reject external scans at `empty_directives_at_line_end`
|
|
88
|
+
then reject external scans at `empty_directives_at_line_end` unless `PREPROC_NEWLINE` is valid. Pass `empty_directives_skip` and its state through `ConditionalMacroSymbols.skip_empty` and
|
|
89
89
|
`empty_context` so declaration lookahead ignores null directives without moving the opening token's range.
|
|
90
90
|
Keep preprocessor argument/newline handling ahead of annotation lookahead.
|
|
91
91
|
Port `preproc_argument_mode` selection together with `scan_preproc_arg` so tokenized pragmas retain raw bodies.
|
package/package.json
CHANGED
package/src/scanner.c
CHANGED
|
@@ -164,7 +164,7 @@ static bool scan_error_recovery_tokens(EmptyDirectives *state, TSLexer *lexer, c
|
|
|
164
164
|
|
|
165
165
|
static bool scan_active_tokens(CScanner *scanner, TSLexer *lexer, const bool *valid_symbols) {
|
|
166
166
|
EmptyDirectives *state = scanner_directives(scanner);
|
|
167
|
-
if (empty_directives_at_line_end(state, lexer)) return false;
|
|
167
|
+
if (!valid_symbols[PREPROC_NEWLINE] && empty_directives_at_line_end(state, lexer)) return false;
|
|
168
168
|
if (any_preproc_body_valid(valid_symbols)) return scan_non_declaration_tokens(state, lexer, valid_symbols);
|
|
169
169
|
int32_t peeked = peek_after_ascii_spaces(lexer);
|
|
170
170
|
if (peeked >= 0) {
|
package/tree-sitter-c.wasm
CHANGED
|
Binary file
|