File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,16 @@ module.exports = grammar({
2525 externals : $ => [ $ . llvm_ir ] ,
2626
2727 rules : {
28- trans_unit : $ => repeat ( $ . _decl_stmt ) ,
28+ trans_unit : $ => repeat ( $ . _global_stmt ) ,
29+
30+ _global_stmt : $ => choice (
31+ $ . asm_block ,
32+ $ . _decl_stmt ,
33+ $ . empty_stmt ,
34+ ) ,
2935
3036 decl_stmt : $ => $ . _decl_stmt ,
3137 _decl_stmt : $ => choice (
32- prec ( 1 , $ . asm_block ) ,
3338 $ . fn_def ,
3439 $ . binding_decl ,
3540 ) ,
@@ -141,12 +146,13 @@ module.exports = grammar({
141146
142147 stmt : $ => $ . _stmt ,
143148 _stmt : $ => choice (
144- $ . asm_block ,
145149 $ . expr_stmt ,
146- $ . _decl_stmt ,
147- alias ( ';' , $ . empty_stmt ) ,
150+ $ . _global_stmt ,
148151 ) ,
149152
153+ empty_stmt : $ => $ . _empty_stmt ,
154+ _empty_stmt : _ => ';' ,
155+
150156 asm_block : $ => $ . _asm_block ,
151157 _asm_block : $ => seq (
152158 'asm' ,
You can’t perform that action at this time.
0 commit comments