@@ -12,6 +12,7 @@ module.exports = grammar(C, {
1212 . concat ( [
1313 [ $ . template_function , $ . _expression_not_binary ] ,
1414 [ $ . _declaration_modifiers , $ . ms_call_modifier ] ,
15+ [ $ . expression , $ . template_function ]
1516 ] ) ,
1617
1718 rules : {
@@ -62,7 +63,7 @@ module.exports = grammar(C, {
6263 '>'
6364 ) ,
6465
65- _type_specifier : ( $ , original ) => choice (
66+ type_specifier : ( $ , original ) => choice (
6667 original ,
6768 $ . short_vector ,
6869 ) ,
@@ -128,7 +129,7 @@ module.exports = grammar(C, {
128129 type_definition : $ => seq (
129130 'typedef' ,
130131 repeat ( $ . type_qualifier ) ,
131- field ( 'type' , $ . _type_specifier ) ,
132+ field ( 'type' , $ . type_specifier ) ,
132133 repeat ( $ . type_qualifier ) ,
133134 commaSep1 ( field ( 'declarator' , $ . _type_declarator ) ) ,
134135 ';' ,
@@ -193,19 +194,19 @@ module.exports = grammar(C, {
193194 if_statement : $ => prec . right ( seq (
194195 choice ( 'if' , 'cif' ) ,
195196 field ( 'condition' , $ . parenthesized_expression ) ,
196- field ( 'consequence' , $ . _statement ) ,
197+ field ( 'consequence' , $ . statement ) ,
197198 optional ( field ( 'alternative' , $ . else_clause ) ) ,
198199 ) ) ,
199200
200201 while_statement : $ => seq (
201202 choice ( 'while' , 'cwhile' ) ,
202203 field ( 'condition' , $ . parenthesized_expression ) ,
203- field ( 'body' , $ . _statement )
204+ field ( 'body' , $ . statement )
204205 ) ,
205206
206207 do_statement : $ => seq (
207208 choice ( 'do' , 'cdo' ) ,
208- field ( 'body' , $ . _statement ) ,
209+ field ( 'body' , $ . statement ) ,
209210 'while' ,
210211 field ( 'condition' , $ . parenthesized_expression ) ,
211212 ';'
@@ -216,40 +217,40 @@ module.exports = grammar(C, {
216217 '(' ,
217218 choice (
218219 field ( 'initializer' , $ . declaration ) ,
219- seq ( field ( 'initializer' , optional ( choice ( $ . _expression , $ . comma_expression ) ) ) , ';' )
220+ seq ( field ( 'initializer' , optional ( choice ( $ . expression , $ . comma_expression ) ) ) , ';' )
220221 ) ,
221- field ( 'condition' , optional ( choice ( $ . _expression , $ . comma_expression ) ) ) , ';' ,
222- field ( 'update' , optional ( choice ( $ . _expression , $ . comma_expression ) ) ) ,
222+ field ( 'condition' , optional ( choice ( $ . expression , $ . comma_expression ) ) ) , ';' ,
223+ field ( 'update' , optional ( choice ( $ . expression , $ . comma_expression ) ) ) ,
223224 ')' ,
224- field ( 'body' , $ . _statement )
225+ field ( 'body' , $ . statement )
225226 ) ,
226227
227228 foreach_statement : $ => seq (
228229 choice ( 'foreach' , 'foreach_tiled' ) ,
229230 '(' ,
230231 $ . _foreach_range , repeat ( seq ( ',' , $ . _foreach_range ) ) ,
231232 ')' ,
232- field ( 'body' , $ . _statement )
233+ field ( 'body' , $ . statement )
233234 ) ,
234235
235236 foreach_instance_statement : $ => seq (
236237 choice ( 'foreach_active' , 'foreach_unique' ) ,
237238 '(' ,
238- field ( 'initializer' , $ . _expression ) ,
239+ field ( 'initializer' , $ . expression ) ,
239240 optional (
240241 seq (
241242 field ( 'in_operator' , 'in' ) ,
242- field ( 'condition' , $ . _expression ) ,
243+ field ( 'condition' , $ . expression ) ,
243244 )
244245 ) ,
245246 ')' ,
246- field ( 'body' , $ . _statement )
247+ field ( 'body' , $ . statement )
247248 ) ,
248249
249250 _foreach_range : $ => seq (
250- field ( 'range_start' , $ . _expression ) ,
251+ field ( 'range_start' , $ . expression ) ,
251252 field ( 'range_operator' , '...' ) ,
252- field ( 'range_end' , $ . _expression ) ,
253+ field ( 'range_end' , $ . expression ) ,
253254 ) ,
254255
255256 unmasked_statement : $ => seq (
@@ -274,7 +275,7 @@ module.exports = grammar(C, {
274275 'new' ,
275276 field ( 'placement' , optional ( $ . argument_list ) ) ,
276277 optional ( repeat ( field ( "ispc" , $ . _ispc_qualifier ) ) ) ,
277- field ( 'type' , $ . _type_specifier ) ,
278+ field ( 'type' , $ . type_specifier ) ,
278279 field ( 'declarator' , optional ( $ . new_declarator ) ) ,
279280 field ( 'arguments' , optional ( choice (
280281 $ . argument_list ,
@@ -284,24 +285,24 @@ module.exports = grammar(C, {
284285
285286 new_declarator : $ => prec . right ( seq (
286287 '[' ,
287- field ( 'length' , $ . _expression ) ,
288+ field ( 'length' , $ . expression ) ,
288289 ']' ,
289290 optional ( $ . new_declarator )
290291 ) ) ,
291292
292293 delete_expression : $ => seq (
293294 'delete' ,
294295 optional ( seq ( '[' , ']' ) ) ,
295- $ . _expression
296+ $ . expression
296297 ) ,
297298
298299 launch_expression : $ => prec . left ( 1 , seq (
299300 'launch' ,
300301 field ( 'launch_config' , optional ( choice (
301- repeat1 ( seq ( '[' , $ . _expression , ']' ) ) ,
302- seq ( '[' , $ . _expression , repeat ( seq ( ',' , $ . _expression ) ) , ']' ) ,
302+ repeat1 ( seq ( '[' , $ . expression , ']' ) ) ,
303+ seq ( '[' , $ . expression , repeat ( seq ( ',' , $ . expression ) ) , ']' ) ,
303304 ) ) ) ,
304- $ . _expression ,
305+ $ . expression ,
305306 ) ) ,
306307
307308 sync_expression : $ => 'sync' ,
@@ -393,7 +394,7 @@ module.exports = grammar(C, {
393394 '<' ,
394395 commaSep ( choice (
395396 prec . dynamic ( 3 , $ . type_descriptor ) ,
396- prec . dynamic ( 1 , $ . _expression )
397+ prec . dynamic ( 1 , $ . expression )
397398 ) ) ,
398399 alias ( token ( prec ( 1 , '>' ) ) , '>' )
399400 ) ,
0 commit comments