Skip to content

Commit

Permalink
Merge pull request #245 from calebdw/string_content
Browse files Browse the repository at this point in the history
fix: repeated string_content nodes
  • Loading branch information
calebdw committed May 19, 2024
2 parents 17cca5f + 2b0575b commit 053cf2b
Show file tree
Hide file tree
Showing 8 changed files with 130,883 additions and 130,738 deletions.
2 changes: 1 addition & 1 deletion common/define-grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ module.exports = function defineGrammar(dialect) {
'\'',
),

string_content: _ => token.immediate(prec(1, /\\?[^'\\]+/)),
string_content: _ => prec.right(repeat1(token.immediate(prec(1, /\\?[^'\\]+/)))),

heredoc_body: $ => seq(
$._new_line,
Expand Down
17 changes: 12 additions & 5 deletions php/src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -7294,13 +7294,20 @@
]
},
"string_content": {
"type": "IMMEDIATE_TOKEN",
"type": "PREC_RIGHT",
"value": 0,
"content": {
"type": "PREC",
"value": 1,
"type": "REPEAT1",
"content": {
"type": "PATTERN",
"value": "\\\\?[^'\\\\]+"
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "PREC",
"value": 1,
"content": {
"type": "PATTERN",
"value": "\\\\?[^'\\\\]+"
}
}
}
}
},
Expand Down
13 changes: 7 additions & 6 deletions php/src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -4455,6 +4455,11 @@
]
}
},
{
"type": "string_content",
"named": true,
"fields": {}
},
{
"type": "subscript_expression",
"named": true,
Expand Down Expand Up @@ -5506,11 +5511,11 @@
},
{
"type": "float",
"named": false
"named": true
},
{
"type": "float",
"named": true
"named": false
},
{
"type": "fn",
Expand Down Expand Up @@ -5676,10 +5681,6 @@
"type": "string",
"named": false
},
{
"type": "string_content",
"named": true
},
{
"type": "switch",
"named": false
Expand Down
Loading

0 comments on commit 053cf2b

Please sign in to comment.