Skip to content

Commit 640d956

Browse files
committed
Unhide _string_literal
1 parent 813d49d commit 640d956

File tree

11 files changed

+717565
-730859
lines changed

11 files changed

+717565
-730859
lines changed

codee/patches/0023-Unhide-_string_literal.patch

Lines changed: 1011 additions & 0 deletions
Large diffs are not rendered by default.

grammar.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module.exports = grammar({
6262
$._integer_literal,
6363
$._float_literal,
6464
$._boz_literal,
65-
$._string_literal,
65+
$.string_literal,
6666
$._string_literal_kind,
6767
$._external_end_of_statement,
6868
$._preproc_unary_operator,
@@ -110,6 +110,7 @@ module.exports = grammar({
110110
[$.inline_if_statement, $.arithmetic_if_statement, $.block_if_statement, $.identifier],
111111
[$.cray_pointer_declaration, $.identifier],
112112
[$.unit_identifier, $.identifier],
113+
[$._preproc_expression, $.prefixed_string_literal],
113114
],
114115

115116
supertypes: $ => [
@@ -1284,7 +1285,7 @@ module.exports = grammar({
12841285
choice(
12851286
$.number_literal,
12861287
$.complex_literal,
1287-
$.string_literal,
1288+
$.prefixed_string_literal,
12881289
$.boolean_literal,
12891290
$.unary_expression,
12901291
$.null_literal,
@@ -1837,14 +1838,14 @@ module.exports = grammar({
18371838
),
18381839

18391840
// Deleted feature -- not quite file position statement
1840-
seq(caseInsensitive('pause'), optional($.string_literal)),
1841+
seq(caseInsensitive('pause'), optional($.prefixed_string_literal)),
18411842
),
18421843

18431844
// This is a limited set of expressions that can be used in IO statements
18441845
// precedence is used to override a conflict with the complex literal
18451846
_io_expressions: $ => prec(1, choice(
18461847
'*',
1847-
$.string_literal,
1848+
$.prefixed_string_literal,
18481849
$.identifier,
18491850
$.derived_type_member_expression,
18501851
$.concatenation_expression,
@@ -1930,7 +1931,7 @@ module.exports = grammar({
19301931
_expression: $ => choice(
19311932
$.number_literal,
19321933
$.complex_literal,
1933-
$.string_literal,
1934+
$.prefixed_string_literal,
19341935
$.boolean_literal,
19351936
$.array_literal,
19361937
$.null_literal,
@@ -2183,7 +2184,7 @@ module.exports = grammar({
21832184
')',
21842185
)),
21852186

2186-
string_literal: $ => seq(
2187+
prefixed_string_literal: $ => seq(
21872188
// Having a kind _prefix_, with an underscore and no whitespace,
21882189
// is _really_ hard to parse without breaking other things, so
21892190
// we have to rely on an external scanner
@@ -2196,7 +2197,7 @@ module.exports = grammar({
21962197
// also need to *capture* it here
21972198
token.immediate('_'),
21982199
)),
2199-
$._string_literal,
2200+
$.string_literal,
22002201
),
22012202

22022203
// Coarrays

src/grammar.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14885,7 +14885,7 @@
1488514885
},
1488614886
{
1488714887
"type": "SYMBOL",
14888-
"name": "string_literal"
14888+
"name": "prefixed_string_literal"
1488914889
},
1489014890
{
1489114891
"type": "SYMBOL",
@@ -14974,7 +14974,7 @@
1497414974
},
1497514975
{
1497614976
"type": "SYMBOL",
14977-
"name": "string_literal"
14977+
"name": "prefixed_string_literal"
1497814978
},
1497914979
{
1498014980
"type": "SYMBOL",
@@ -18672,7 +18672,7 @@
1867218672
"members": [
1867318673
{
1867418674
"type": "SYMBOL",
18675-
"name": "string_literal"
18675+
"name": "prefixed_string_literal"
1867618676
},
1867718677
{
1867818678
"type": "BLANK"
@@ -18695,7 +18695,7 @@
1869518695
},
1869618696
{
1869718697
"type": "SYMBOL",
18698-
"name": "string_literal"
18698+
"name": "prefixed_string_literal"
1869918699
},
1870018700
{
1870118701
"type": "SYMBOL",
@@ -19274,7 +19274,7 @@
1927419274
},
1927519275
{
1927619276
"type": "SYMBOL",
19277-
"name": "string_literal"
19277+
"name": "prefixed_string_literal"
1927819278
},
1927919279
{
1928019280
"type": "SYMBOL",
@@ -21059,7 +21059,7 @@
2105921059
]
2106021060
}
2106121061
},
21062-
"string_literal": {
21062+
"prefixed_string_literal": {
2106321063
"type": "SEQ",
2106421064
"members": [
2106521065
{
@@ -21111,7 +21111,7 @@
2111121111
},
2111221112
{
2111321113
"type": "SYMBOL",
21114-
"name": "_string_literal"
21114+
"name": "string_literal"
2111521115
}
2111621116
]
2111721117
},
@@ -22310,6 +22310,10 @@
2231022310
[
2231122311
"unit_identifier",
2231222312
"identifier"
22313+
],
22314+
[
22315+
"_preproc_expression",
22316+
"prefixed_string_literal"
2231322317
]
2231422318
],
2231522319
"precedences": [],
@@ -22332,7 +22336,7 @@
2233222336
},
2233322337
{
2233422338
"type": "SYMBOL",
22335-
"name": "_string_literal"
22339+
"name": "string_literal"
2233622340
},
2233722341
{
2233822342
"type": "SYMBOL",

0 commit comments

Comments
 (0)