Browse Source

fix: allow preproc calls in enumerator list items

pull/189/head
Amaan Qureshi 2 years ago
parent
commit
34f4c7e751
No known key found for this signature in database GPG Key ID: E67890ADC4227273
4 changed files with 51627 additions and 51587 deletions
  1. +2
    -0
      grammar.js
  2. +17
    -0
      src/grammar.json
  3. +4
    -0
      src/node-types.json
  4. +51604
    -51587
      src/parser.c

+ 2
- 0
grammar.js View File

@ -624,12 +624,14 @@ module.exports = grammar({
seq($.enumerator, ','), seq($.enumerator, ','),
alias($.preproc_if_in_enumerator_list, $.preproc_if), alias($.preproc_if_in_enumerator_list, $.preproc_if),
alias($.preproc_ifdef_in_enumerator_list, $.preproc_ifdef), alias($.preproc_ifdef_in_enumerator_list, $.preproc_ifdef),
seq($.preproc_call, ','),
)), )),
optional(seq( optional(seq(
choice( choice(
$.enumerator, $.enumerator,
alias($.preproc_if_in_enumerator_list_no_comma, $.preproc_if), alias($.preproc_if_in_enumerator_list_no_comma, $.preproc_if),
alias($.preproc_ifdef_in_enumerator_list_no_comma, $.preproc_ifdef), alias($.preproc_ifdef_in_enumerator_list_no_comma, $.preproc_ifdef),
$.preproc_call,
), ),
)), )),
'}', '}',

+ 17
- 0
src/grammar.json View File

@ -4805,6 +4805,19 @@
}, },
"named": true, "named": true,
"value": "preproc_ifdef" "value": "preproc_ifdef"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "preproc_call"
},
{
"type": "STRING",
"value": ","
}
]
} }
] ]
} }
@ -4839,6 +4852,10 @@
}, },
"named": true, "named": true,
"value": "preproc_ifdef" "value": "preproc_ifdef"
},
{
"type": "SYMBOL",
"name": "preproc_call"
} }
] ]
} }

+ 4
- 0
src/node-types.json View File

@ -1439,6 +1439,10 @@
"type": "enumerator", "type": "enumerator",
"named": true "named": true
}, },
{
"type": "preproc_call",
"named": true
},
{ {
"type": "preproc_if", "type": "preproc_if",
"named": true "named": true

+ 51604
- 51587
src/parser.c
File diff suppressed because it is too large
View File


Loading…
Cancel
Save