Skip to content

Commit

Permalink
chore: update tree-sitter-c
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Feb 18, 2024
1 parent 3d98832 commit bbde8cd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,20 @@ module.exports = grammar(C, {
field('body', choice(e.content, $.try_statement))),
}),

declaration: $ => seq(
$._declaration_specifiers,
commaSep1(field('declarator', choice(
seq(
// C uses _declaration_declarator here for some nice macro parsing in function declarators,
// but this causes a world of pain for C++ so we'll just stick to the normal _declarator here.
$._declarator,
optional($.gnu_asm_expression),
),
$.init_declarator,
))),
';',
),

virtual_specifier: _ => choice(
'final', // the only legal value here for classes
'override', // legal for functions in addition to final, plus permutations.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"devDependencies": {
"eslint": "^8.56.0",
"eslint-config-google": "^0.14.0",
"tree-sitter-c": "^0.20.7",
"tree-sitter-c": "^0.20.8",
"tree-sitter-cli": "^0.20.8",
"node-gyp": "^10.0.1"
},
Expand Down

0 comments on commit bbde8cd

Please sign in to comment.