Skip to content

Commit

Permalink
Add supertypes
Browse files Browse the repository at this point in the history
  • Loading branch information
kolen committed Feb 25, 2024
1 parent 582b934 commit 4b8b4cf
Show file tree
Hide file tree
Showing 4 changed files with 2,545 additions and 2,448 deletions.
9 changes: 8 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,5 +338,12 @@ module.exports = grammar({
[$._attrs_plain],
],

extras: $ => []
extras: $ => [],

supertypes: $ => [
$._line,
$._ruby_block,
$._attr_shortcut,
$._output_modifier
]
});
7 changes: 6 additions & 1 deletion src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1872,5 +1872,10 @@
}
],
"inline": [],
"supertypes": []
"supertypes": [
"_line",
"_ruby_block",
"_attr_shortcut",
"_output_modifier"
]
}
220 changes: 104 additions & 116 deletions src/node-types.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,96 @@
[
{
"type": "_attr_shortcut",
"named": true,
"subtypes": [
{
"type": "attr_shortcut_class",
"named": true
},
{
"type": "attr_shortcut_custom",
"named": true
},
{
"type": "attr_shortcut_id",
"named": true
}
]
},
{
"type": "_line",
"named": true,
"subtypes": [
{
"type": "_ruby_block",
"named": true
},
{
"type": "code_comment",
"named": true
},
{
"type": "doctype",
"named": true
},
{
"type": "element",
"named": true
},
{
"type": "embedded_engine",
"named": true
},
{
"type": "html_comment",
"named": true
},
{
"type": "html_comment_conditional",
"named": true
},
{
"type": "verbatim_text",
"named": true
}
]
},
{
"type": "_output_modifier",
"named": true,
"subtypes": [
{
"type": "output_modifier_leading_whitespace",
"named": true
},
{
"type": "output_modifier_legacy_trailing_whitespace",
"named": true
},
{
"type": "output_modifier_trailing_whitespace",
"named": true
}
]
},
{
"type": "_ruby_block",
"named": true,
"subtypes": [
{
"type": "ruby_block_control",
"named": true
},
{
"type": "ruby_block_output",
"named": true
},
{
"type": "ruby_block_output_noescape",
"named": true
}
]
},
{
"type": "attr",
"named": true,
Expand Down Expand Up @@ -112,15 +204,7 @@
"required": true,
"types": [
{
"type": "attr_shortcut_class",
"named": true
},
{
"type": "attr_shortcut_custom",
"named": true
},
{
"type": "attr_shortcut_id",
"type": "_attr_shortcut",
"named": true
}
]
Expand Down Expand Up @@ -249,27 +333,19 @@
"required": false,
"types": [
{
"type": "element_text",
"named": true
},
{
"type": "nested",
"named": true
},
{
"type": "nested_inline",
"type": "_output_modifier",
"named": true
},
{
"type": "output_modifier_leading_whitespace",
"type": "element_text",
"named": true
},
{
"type": "output_modifier_legacy_trailing_whitespace",
"type": "nested",
"named": true
},
{
"type": "output_modifier_trailing_whitespace",
"type": "nested_inline",
"named": true
}
]
Expand Down Expand Up @@ -346,46 +422,10 @@
"fields": {},
"children": {
"multiple": true,
"required": false,
"required": true,
"types": [
{
"type": "code_comment",
"named": true
},
{
"type": "doctype",
"named": true
},
{
"type": "element",
"named": true
},
{
"type": "embedded_engine",
"named": true
},
{
"type": "html_comment",
"named": true
},
{
"type": "html_comment_conditional",
"named": true
},
{
"type": "ruby_block_control",
"named": true
},
{
"type": "ruby_block_output",
"named": true
},
{
"type": "ruby_block_output_noescape",
"named": true
},
{
"type": "verbatim_text",
"type": "_line",
"named": true
}
]
Expand Down Expand Up @@ -464,15 +504,7 @@
"required": true,
"types": [
{
"type": "output_modifier_leading_whitespace",
"named": true
},
{
"type": "output_modifier_legacy_trailing_whitespace",
"named": true
},
{
"type": "output_modifier_trailing_whitespace",
"type": "_output_modifier",
"named": true
},
{
Expand Down Expand Up @@ -502,15 +534,7 @@
"required": true,
"types": [
{
"type": "output_modifier_leading_whitespace",
"named": true
},
{
"type": "output_modifier_legacy_trailing_whitespace",
"named": true
},
{
"type": "output_modifier_trailing_whitespace",
"type": "_output_modifier",
"named": true
},
{
Expand All @@ -529,43 +553,7 @@
"required": false,
"types": [
{
"type": "code_comment",
"named": true
},
{
"type": "doctype",
"named": true
},
{
"type": "element",
"named": true
},
{
"type": "embedded_engine",
"named": true
},
{
"type": "html_comment",
"named": true
},
{
"type": "html_comment_conditional",
"named": true
},
{
"type": "ruby_block_control",
"named": true
},
{
"type": "ruby_block_output",
"named": true
},
{
"type": "ruby_block_output_noescape",
"named": true
},
{
"type": "verbatim_text",
"type": "_line",
"named": true
}
]
Expand Down Expand Up @@ -716,11 +704,11 @@
},
{
"type": "ruby",
"named": false
"named": true
},
{
"type": "ruby",
"named": true
"named": false
},
{
"type": "ruby_expr",
Expand Down
Loading

0 comments on commit 4b8b4cf

Please sign in to comment.