Skip to content

Commit

Permalink
Use strings for ruby output block markers
Browse files Browse the repository at this point in the history
  • Loading branch information
kolen committed Feb 22, 2024
1 parent 07ee566 commit 9028219
Show file tree
Hide file tree
Showing 4 changed files with 3,231 additions and 3,015 deletions.
6 changes: 4 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,16 @@ module.exports = grammar({
),

ruby_block_output: $ => seq(
/[ \t]*=/,
optional($._space),
'=',
optional($._output_modifiers),
$.ruby,
optional(field('nested', $.nested))
),

ruby_block_output_noescape: $ => seq(
/[ \t]*==/,
optional($._space),
'==',
optional($._output_modifiers),
$.ruby,
optional(field('nested', $.nested))
Expand Down
33 changes: 28 additions & 5 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1194,8 +1194,20 @@
"type": "SEQ",
"members": [
{
"type": "PATTERN",
"value": "[ \\t]*="
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_space"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "="
},
{
"type": "CHOICE",
Expand Down Expand Up @@ -1235,8 +1247,20 @@
"type": "SEQ",
"members": [
{
"type": "PATTERN",
"value": "[ \\t]*=="
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_space"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "=="
},
{
"type": "CHOICE",
Expand Down Expand Up @@ -1806,4 +1830,3 @@
"inline": [],
"supertypes": []
}

8 changes: 8 additions & 0 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,14 @@
"type": ":",
"named": false
},
{
"type": "=",
"named": false
},
{
"type": "==",
"named": false
},
{
"type": "[",
"named": false
Expand Down
Loading

0 comments on commit 9028219

Please sign in to comment.