Constant tree_sitter_embedded_template::GRAMMAR [−][src]
pub const GRAMMAR: &'static str = "module.exports = grammar({\n name: \'embedded_template\',\n\n rules: {\n template: $ => repeat(choice(\n $.directive,\n $.output_directive,\n $.comment_directive,\n $.graphql_directive,\n $.content\n )),\n\n code: $ => repeat1(choice(/[^%=_-]+|[%=_-]/, \'%%>\')),\n\n content: $ => prec.right(repeat1(choice(/[^<]+|</, \'<%%\'))),\n\n directive: $ => seq(\n choice(\'<%\', \'<%_\'),\n $.code,\n choice(\'%>\', \'-%>\', \'_%>\')\n ),\n\n output_directive: $ => seq(\n choice(\'<%=\', \'<%-\'),\n $.code,\n choice(\'%>\', \'-%>\', \'=%>\')\n ),\n\n comment_directive: $ => seq(\n \'<%#\',\n alias($.code, $.comment),\n \'%>\'\n ),\n\n graphql_directive: $ => seq(\n \'<%graphql\',\n $.code,\n \'%>\'\n )\n }\n});\n";
The source of the ERB/EJS tree-sitter grammar description.