@@ -86,7 +86,7 @@ module.exports = grammar({
8686 [ $ . _record_field_name , $ . record_pattern ] ,
8787 [ $ . decorator ] ,
8888 [ $ . _statement , $ . _one_or_more_statements ] ,
89- [ $ . _simple_extension ] ,
89+ [ $ . extension_expression ] ,
9090 [ $ . _inline_type , $ . function_type_parameters ] ,
9191 [ $ . primary_expression , $ . parameter , $ . _pattern ] ,
9292 [ $ . parameter , $ . _pattern ] ,
@@ -1137,63 +1137,11 @@ module.exports = grammar({
11371137
11381138 extension_expression : $ => prec ( 'call' , seq (
11391139 repeat1 ( '%' ) ,
1140- choice (
1141- $ . _raw_js_extension ,
1142- $ . _raw_gql_extension ,
1143- $ . _simple_extension ,
1144- ) ,
1145- ) ) ,
1146-
1147- _simple_extension : $ => seq (
11481140 $ . extension_identifier ,
1149- optional ( $ . _extension_expression_payload ) ,
1150- ) ,
1151-
1152- _raw_js_extension : $ => seq (
1153- alias ( token ( 'raw' ) , $ . extension_identifier ) ,
1154- '(' ,
1155- alias ( $ . _raw_js , $ . expression_statement ) ,
1156- ')' ,
1157- ) ,
1158-
1159- _raw_js : $ => choice (
1160- alias ( $ . _raw_js_template_string , $ . template_string ) ,
1161- alias ( $ . _raw_js_string , $ . string ) ,
1162- ) ,
1163-
1164- _raw_js_string : $ => alias ( $ . string , $ . raw_js ) ,
1165-
1166- _raw_js_template_string : $ => seq (
1167- token ( seq (
1168- optional ( choice (
1169- 'j' ,
1170- 'js' ,
1171- ) ) ,
1172- '`' ,
1173- ) ) ,
1174- alias ( repeat ( $ . _template_string_content ) , $ . raw_js ) ,
1175- '`' ,
1176- ) ,
1177-
1178- _raw_gql_extension : $ => seq (
1179- alias ( token ( 'graphql' ) , $ . extension_identifier ) ,
1180- '(' ,
1181- alias ( $ . _raw_gql , $ . expression_statement ) ,
1182- ')' ,
1183- ) ,
1184-
1185- _raw_gql : $ => choice (
1186- alias ( $ . _raw_gql_template_string , $ . template_string ) ,
1187- alias ( $ . _raw_gql_string , $ . string ) ,
1188- ) ,
1189-
1190- _raw_gql_string : $ => alias ( $ . string , $ . raw_gql ) ,
1191-
1192- _raw_gql_template_string : $ => seq (
1193- '`' ,
1194- alias ( repeat ( $ . _template_string_content ) , $ . raw_gql ) ,
1195- '`' ,
1196- ) ,
1141+ optional (
1142+ $ . _extension_expression_payload ,
1143+ )
1144+ ) ) ,
11971145
11981146 _extension_expression_payload : $ => seq (
11991147 '(' ,
@@ -1430,18 +1378,21 @@ module.exports = grammar({
14301378 ) ) ,
14311379 '`' ,
14321380 ) ) ,
1433- repeat ( $ . _template_string_content ) ,
1381+ $ . template_string_content ,
14341382 '`'
14351383 ) ,
14361384
1437- _template_string_content : $ => choice (
1438- $ . _template_chars ,
1439- $ . template_substitution ,
1440- choice (
1441- alias ( '\\`' , $ . escape_sequence ) ,
1442- $ . escape_sequence ,
1385+ template_string_content : $ =>
1386+ repeat1 (
1387+ choice (
1388+ $ . _template_chars ,
1389+ $ . template_substitution ,
1390+ choice (
1391+ alias ( '\\`' , $ . escape_sequence ) ,
1392+ $ . escape_sequence ,
1393+ )
1394+ ) ,
14431395 ) ,
1444- ) ,
14451396
14461397 template_substitution : $ => choice (
14471398 seq ( '$' , $ . value_identifier ) ,
0 commit comments