diff --git a/grammars/tree-sitter-ejs.cson b/grammars/tree-sitter-ejs.cson index 4af1983..08e623d 100644 --- a/grammars/tree-sitter-ejs.cson +++ b/grammars/tree-sitter-ejs.cson @@ -24,13 +24,14 @@ comments: scopes: 'comment_directive': 'comment.block' - 'comment_directive > "%>"': 'comment.block' - '"<%#"': 'keyword.control.directive' - '"<%"': 'keyword.control.directive' - '"<%="': 'keyword.control.directive' - '"<%_"': 'keyword.control.directive' - '"<%-"': 'keyword.control.directive' - '"%>"': 'keyword.control.directive' - '"-%>"': 'keyword.control.directive' - '"_%>"': 'keyword.control.directive' + '"<%#"': 'punctuation.definition.comment' + 'comment_directive > "%>"': 'punctuation.definition.comment' + + '"<%"': 'punctuation.delimiter.embedded.ejs' + '"<%="': 'punctuation.delimiter.embedded.ejs' + '"<%_"': 'punctuation.delimiter.embedded.ejs' + '"<%-"': 'punctuation.delimiter.embedded.ejs' + '"%>"': 'punctuation.delimiter.embedded.ejs' + '"-%>"': 'punctuation.delimiter.embedded.ejs' + '"_%>"': 'punctuation.delimiter.embedded.ejs' diff --git a/grammars/tree-sitter-erb.cson b/grammars/tree-sitter-erb.cson index c754cae..8cc2219 100644 --- a/grammars/tree-sitter-erb.cson +++ b/grammars/tree-sitter-erb.cson @@ -24,13 +24,14 @@ comments: scopes: 'comment_directive': 'comment.block' - 'comment_directive > "%>"': 'comment.block' - '"<%#"': 'keyword.control.directive' - '"<%"': 'keyword.control.directive' - '"<%="': 'keyword.control.directive' - '"<%_"': 'keyword.control.directive' - '"<%-"': 'keyword.control.directive' - '"%>"': 'keyword.control.directive' - '"-%>"': 'keyword.control.directive' - '"_%>"': 'keyword.control.directive' + '"<%#"': 'punctuation.definition.comment' + 'comment_directive > "%>"': 'punctuation.definition.comment' + + '"<%"': 'punctuation.delimiter.embedded.erb' + '"<%="': 'punctuation.delimiter.embedded.erb' + '"<%_"': 'punctuation.delimiter.embedded.erb' + '"<%-"': 'punctuation.delimiter.embedded.erb' + '"%>"': 'punctuation.delimiter.embedded.erb' + '"-%>"': 'punctuation.delimiter.embedded.erb' + '"_%>"': 'punctuation.delimiter.embedded.erb' diff --git a/grammars/tree-sitter-html.cson b/grammars/tree-sitter-html.cson index 1a0b422..9c211e9 100644 --- a/grammars/tree-sitter-html.cson +++ b/grammars/tree-sitter-html.cson @@ -28,29 +28,41 @@ comments: scopes: 'fragment': 'source.html' - 'tag_name': 'entity.name.tag' - 'erroneous_end_tag_name': 'invalid.illegal' - 'doctype': 'meta.tag.doctype.html' - 'attribute_name': 'entity.other.attribute-name' - 'attribute_value': 'string.html' - 'comment': 'comment.block.html' - - ' - start_tag > "<", - end_tag > " ">", - end_tag > ">" - ': 'punctuation.definition.tag.end' - - 'attribute > "="': 'punctuation.separator.key-value.html' - - # quoted_attribute_value has three child nodes: ", attribute_value, and ". - # Target the first and last. - # Single quotes and double quotes are targeted in separate selectors because - # of quote-escaping difficulties. - "quoted_attribute_value > '\"':nth-child(0)": 'punctuation.definition.string.begin' - 'quoted_attribute_value > "\'":nth-child(0)': 'punctuation.definition.string.begin' - "quoted_attribute_value > '\"':nth-child(2)": 'punctuation.definition.string.end' - 'quoted_attribute_value > "\'":nth-child(2)': 'punctuation.definition.string.end' + + # Entity + 'tag_name': 'entity.tag' + 'erroneous_end_tag_name': 'entity.tag.invalid.illegal' + 'attribute_name': 'entity.attribute' + + # String + 'attribute > attribute_value': 'string.unquoted.attribute-value' + 'attribute > quoted_attribute_value': 'string.quoted.attribute-value' + + # Text + 'text': 'text' + + # Comment + 'comment': 'comment.block' + + # Punctuation + '"<"': 'punctuation.definition.tag' + '""': 'punctuation.definition.tag' + '"/>"': 'punctuation.definition.tag' + '" ">"': 'punctuation.definition.tag.doctype' + '"="': 'punctuation.delimiter.pair' + '"\\""': 'punctuation.definition.string.quoted' + '"\'"': 'punctuation.definition.string.quoted' + + 'ERROR > "<"': 'punctuation.definition.tag.invalid.illegal' + 'ERROR > " ">"': 'punctuation.definition.tag.invalid.illegal' + 'ERROR > "/>"': 'punctuation.definition.tag.invalid.illegal' + 'ERROR > " "="': 'punctuation.delimiter.pair.invalid.illegal' + 'ERROR > "\\""': 'punctuation.definition.string.quoted.invalid.illegal' + 'ERROR > "\'"': 'punctuation.definition.string.quoted.invalid.illegal' + + # Meta + 'doctype': 'meta.doctype'