Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,011 changes: 1,011 additions & 0 deletions codee/patches/0023-Unhide-_string_literal.patch

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module.exports = grammar({
$._integer_literal,
$._float_literal,
$._boz_literal,
$._string_literal,
$.string_literal,
$._string_literal_kind,
$._external_end_of_statement,
$._preproc_unary_operator,
Expand Down Expand Up @@ -110,6 +110,7 @@ module.exports = grammar({
[$.inline_if_statement, $.arithmetic_if_statement, $.block_if_statement, $.identifier],
[$.cray_pointer_declaration, $.identifier],
[$.unit_identifier, $.identifier],
[$._preproc_expression, $.prefixed_string_literal],
],

supertypes: $ => [
Expand Down Expand Up @@ -1284,7 +1285,7 @@ module.exports = grammar({
choice(
$.number_literal,
$.complex_literal,
$.string_literal,
$.prefixed_string_literal,
$.boolean_literal,
$.unary_expression,
$.null_literal,
Expand Down Expand Up @@ -1837,14 +1838,14 @@ module.exports = grammar({
),

// Deleted feature -- not quite file position statement
seq(caseInsensitive('pause'), optional($.string_literal)),
seq(caseInsensitive('pause'), optional($.prefixed_string_literal)),
),

// This is a limited set of expressions that can be used in IO statements
// precedence is used to override a conflict with the complex literal
_io_expressions: $ => prec(1, choice(
'*',
$.string_literal,
$.prefixed_string_literal,
$.identifier,
$.derived_type_member_expression,
$.concatenation_expression,
Expand Down Expand Up @@ -1930,7 +1931,7 @@ module.exports = grammar({
_expression: $ => choice(
$.number_literal,
$.complex_literal,
$.string_literal,
$.prefixed_string_literal,
$.boolean_literal,
$.array_literal,
$.null_literal,
Expand Down Expand Up @@ -2183,7 +2184,7 @@ module.exports = grammar({
')',
)),

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

// Coarrays
Expand Down
20 changes: 12 additions & 8 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -14885,7 +14885,7 @@
},
{
"type": "SYMBOL",
"name": "string_literal"
"name": "prefixed_string_literal"
},
{
"type": "SYMBOL",
Expand Down Expand Up @@ -14974,7 +14974,7 @@
},
{
"type": "SYMBOL",
"name": "string_literal"
"name": "prefixed_string_literal"
},
{
"type": "SYMBOL",
Expand Down Expand Up @@ -18672,7 +18672,7 @@
"members": [
{
"type": "SYMBOL",
"name": "string_literal"
"name": "prefixed_string_literal"
},
{
"type": "BLANK"
Expand All @@ -18695,7 +18695,7 @@
},
{
"type": "SYMBOL",
"name": "string_literal"
"name": "prefixed_string_literal"
},
{
"type": "SYMBOL",
Expand Down Expand Up @@ -19274,7 +19274,7 @@
},
{
"type": "SYMBOL",
"name": "string_literal"
"name": "prefixed_string_literal"
},
{
"type": "SYMBOL",
Expand Down Expand Up @@ -21059,7 +21059,7 @@
]
}
},
"string_literal": {
"prefixed_string_literal": {
"type": "SEQ",
"members": [
{
Expand Down Expand Up @@ -21111,7 +21111,7 @@
},
{
"type": "SYMBOL",
"name": "_string_literal"
"name": "string_literal"
}
]
},
Expand Down Expand Up @@ -22310,6 +22310,10 @@
[
"unit_identifier",
"identifier"
],
[
"_preproc_expression",
"prefixed_string_literal"
]
],
"precedences": [],
Expand All @@ -22332,7 +22336,7 @@
},
{
"type": "SYMBOL",
"name": "_string_literal"
"name": "string_literal"
},
{
"type": "SYMBOL",
Expand Down
Loading
Loading