@willbooster/tree-sitter-c-sharp 10.0.0 → 10.0.1
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/grammar.js +16 -2
- package/package.json +1 -1
- package/src/node-types.json +4 -0
- package/tree-sitter-c_sharp.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
const { alias, choice, field, grammar, optional, prec, repeat, repeat1, seq, sym, token } =
|
|
12
12
|
/** @type {typeof globalThis & import('@willbooster/web-tree-sitter/dsl').DSL} */ (globalThis);
|
|
13
13
|
|
|
14
|
-
/** @typedef {'_preproc_expression' | '_top_level_item_no_statement' | '_base_list_mixed_type' | '_base_list_mixed_suffix' | '_base_list_trivia' | '_base_list' | '_base_list_type' | '_base_list_suffix' | '_base_list_prefix' | '_base_list_separator' | '_base_list_separator_path' | '_enum_base_clause' | '_enum_base_type' | 'attribute_list' | 'declaration' | 'enum_member_declaration' | 'expression' | 'method_signature' | 'statement'} PreprocContentRule */
|
|
14
|
+
/** @typedef {'_preproc_expression' | '_top_level_item_no_statement' | '_namespace_body_item' | '_base_list_mixed_type' | '_base_list_mixed_suffix' | '_base_list_trivia' | '_base_list' | '_base_list_type' | '_base_list_suffix' | '_base_list_prefix' | '_base_list_separator' | '_base_list_separator_path' | '_enum_base_clause' | '_enum_base_type' | 'attribute_list' | 'declaration' | 'enum_member_declaration' | 'expression' | 'method_signature' | 'statement'} PreprocContentRule */
|
|
15
15
|
|
|
16
16
|
const PREC = {
|
|
17
17
|
GENERIC: 19,
|
|
@@ -421,7 +421,20 @@ module.exports = grammar({
|
|
|
421
421
|
_namespace_member_declaration: ($) => choice($.namespace_declaration, $.type_declaration),
|
|
422
422
|
|
|
423
423
|
namespace_declaration: ($) =>
|
|
424
|
-
seq(
|
|
424
|
+
seq(
|
|
425
|
+
'namespace',
|
|
426
|
+
field('name', $._name),
|
|
427
|
+
field('body', alias($._namespace_body, $.declaration_list)),
|
|
428
|
+
sym('_optional_semi')
|
|
429
|
+
),
|
|
430
|
+
|
|
431
|
+
_namespace_body: ($) => seq('{', repeat($._namespace_body_item), blockEnd()),
|
|
432
|
+
|
|
433
|
+
_namespace_body_item: ($) =>
|
|
434
|
+
prec(
|
|
435
|
+
1,
|
|
436
|
+
choice($.extern_alias_directive, $.declaration, alias(sym('preproc_if_in_namespace'), sym('preproc_if')))
|
|
437
|
+
),
|
|
425
438
|
|
|
426
439
|
file_scoped_namespace_declaration: ($) =>
|
|
427
440
|
prec.right(seq('namespace', field('name', $._name), statementEnd(), repeat($._top_level_item_no_statement))),
|
|
@@ -2450,6 +2463,7 @@ module.exports = grammar({
|
|
|
2450
2463
|
false,
|
|
2451
2464
|
true
|
|
2452
2465
|
),
|
|
2466
|
+
...preprocIf('_in_namespace', ($) => $._namespace_body_item, 1),
|
|
2453
2467
|
...preprocIfWithMixedContent(
|
|
2454
2468
|
'_in_mixed_base_type',
|
|
2455
2469
|
($) => $._base_list_type,
|
package/package.json
CHANGED
package/src/node-types.json
CHANGED
package/tree-sitter-c_sharp.wasm
CHANGED
|
Binary file
|