@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 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` before the other token dispatch. Pass `empty_directives_skip` and its state through `ConditionalMacroSymbols.skip_empty` and
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-c",
3
- "version": "45.0.3",
3
+ "version": "46.0.0",
4
4
  "description": "C grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "c",
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) {
Binary file
package/tree-sitter.json CHANGED
@@ -28,7 +28,7 @@
28
28
  }
29
29
  ],
30
30
  "metadata": {
31
- "version": "45.0.3",
31
+ "version": "46.0.0",
32
32
  "license": "MIT",
33
33
  "description": "C grammar for tree-sitter",
34
34
  "authors": [