File tree Expand file tree Collapse file tree 6 files changed +52072
-44283
lines changed
Expand file tree Collapse file tree 6 files changed +52072
-44283
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,12 @@ module.exports = grammar({
7676 word : $ => $ . identifier ,
7777
7878 rules : {
79- program : $ => repeat ( $ . statement ) ,
79+ program : $ => repeat ( $ . _toplevel_statement ) ,
80+
81+ _toplevel_statement : $ => choice (
82+ $ . statement ,
83+ $ . method_declaration ,
84+ ) ,
8085
8186 // Literals
8287
Original file line number Diff line number Diff line change 66 "type" : " REPEAT" ,
77 "content" : {
88 "type" : " SYMBOL" ,
9- "name" : " statement "
9+ "name" : " _toplevel_statement "
1010 }
1111 },
12+ "_toplevel_statement" : {
13+ "type" : " CHOICE" ,
14+ "members" : [
15+ {
16+ "type" : " SYMBOL" ,
17+ "name" : " statement"
18+ },
19+ {
20+ "type" : " SYMBOL" ,
21+ "name" : " method_declaration"
22+ }
23+ ]
24+ },
1225 "_literal" : {
1326 "type" : " CHOICE" ,
1427 "members" : [
Original file line number Diff line number Diff line change 29412941 "multiple" : true ,
29422942 "required" : false ,
29432943 "types" : [
2944+ {
2945+ "type" : " method_declaration" ,
2946+ "named" : true
2947+ },
29442948 {
29452949 "type" : " statement" ,
29462950 "named" : true
You can’t perform that action at this time.
0 commit comments