Skip to content

Commit c090cb6

Browse files
committed
Add obsolescent alternate return
1 parent 545b2ea commit c090cb6

File tree

5 files changed

+494444
-494121
lines changed

5 files changed

+494444
-494121
lines changed

grammar.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,11 @@ module.exports = grammar({
10981098
)
10991099
)
11001100
),
1101-
caseInsensitive('return'),
1101+
seq(
1102+
caseInsensitive('return'),
1103+
// Obsolescent alternate return
1104+
optional($._expression),
1105+
)
11021106
),
11031107

11041108
include_statement: $ => seq(

src/grammar.json

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13230,13 +13230,30 @@
1323013230
]
1323113231
},
1323213232
{
13233-
"type": "ALIAS",
13234-
"content": {
13235-
"type": "PATTERN",
13236-
"value": "[rR][eE][tT][uU][rR][nN]"
13237-
},
13238-
"named": false,
13239-
"value": "return"
13233+
"type": "SEQ",
13234+
"members": [
13235+
{
13236+
"type": "ALIAS",
13237+
"content": {
13238+
"type": "PATTERN",
13239+
"value": "[rR][eE][tT][uU][rR][nN]"
13240+
},
13241+
"named": false,
13242+
"value": "return"
13243+
},
13244+
{
13245+
"type": "CHOICE",
13246+
"members": [
13247+
{
13248+
"type": "SYMBOL",
13249+
"name": "_expression"
13250+
},
13251+
{
13252+
"type": "BLANK"
13253+
}
13254+
]
13255+
}
13256+
]
1324013257
}
1324113258
]
1324213259
},

src/node-types.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14290,11 +14290,11 @@
1429014290
},
1429114291
{
1429214292
"type": "none",
14293-
"named": true
14293+
"named": false
1429414294
},
1429514295
{
1429614296
"type": "none",
14297-
"named": false
14297+
"named": true
1429814298
},
1429914299
{
1430014300
"type": "nopass",

0 commit comments

Comments
 (0)