Skip to content

Commit

Permalink
adding new attribute keywords to handle scope name parsing
Browse files Browse the repository at this point in the history
adding new attribute keywords to handle scope name parsing (__read_mostly, __must_hold, __ro_after_init, __init and __aligned)
  • Loading branch information
edogrigqv2 authored and Sergey Reshetnikov committed Jun 6, 2024
1 parent 7d6db63 commit ed5c86f
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
5 changes: 5 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ module.exports = grammar({
choice(
seq('__attribute__','(',$.argument_list,')'),
seq(choice('__scanf', '__printf'), '(', commaSep($.number_literal), ')'),
'__read_mostly',
seq(choice('__must_hold'), '(', $.argument_list, ')'),
'__ro_after_init',
'__init'
),
),

Expand Down Expand Up @@ -702,6 +706,7 @@ module.exports = grammar({
field('body', $.field_declaration_list),
),
optional($.attribute_specifier),
optional(seq('__aligned', '(', $.argument_list, ')')),
)),

union_specifier: $ => prec.right(seq(
Expand Down
67 changes: 67 additions & 0 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ed5c86f

Please sign in to comment.