diff --git a/org.eclipse.wildwebdeveloper.xml/grammars/dtd/dtd.tmLanguage.json b/org.eclipse.wildwebdeveloper.xml/grammars/dtd/dtd.tmLanguage.json index f6df471ead..b299abca96 100644 --- a/org.eclipse.wildwebdeveloper.xml/grammars/dtd/dtd.tmLanguage.json +++ b/org.eclipse.wildwebdeveloper.xml/grammars/dtd/dtd.tmLanguage.json @@ -1,47 +1,294 @@ -{ - "name": "DTD", - "scopeName": "text.xml.dtd", - "fileTypes": [ - "dtd" - ], - "patterns": [ - { - "begin": "()", - "name": "meta.tag.type.dtd", - "patterns": [ - { - "match": "\\s+(CDATA|IDREFS|IDREF|ID|NMTOKENS|NMTOKEN|ENTITY|ENTITIES|NOTATION|SYSTEM|NDATA)", - "name": "keyword.other.data-type.dtd" - }, - { - "match": "(#[A-Z]+)|(ANY)|(EMPTY)", - "name": "constant.language.dtd" - }, - { - "begin": "'|\"", - "end": "'|\"", - "name": "string.quoted.double.dtd" - }, - { - "begin": "(%[a-zA-Z][a-zA-Z0-9_-])", - "end": ";", - "name": "variable.language.dtd" - } - ] - }, - { - "begin": "()", - "name": "comment.block.dtd" - } - ] -} \ No newline at end of file +{ + "name": "DTD", + "scopeName": "text.xml.dtd", + "fileTypes": [ + "dtd" + ], + "patterns": [ + { "include": "#comment" }, + { "include": "#processing-instruction" }, + { "include": "#conditional-section" }, + { "include": "#element-declaration" }, + { "include": "#attlist-declaration" }, + { "include": "#entity-declaration" }, + { "include": "#notation-declaration" }, + { "include": "#parameter-entity-ref" } + ], + "repository": { + "comment": { + "begin": "", + "endCaptures": { + "0": { "name": "punctuation.definition.comment.end.dtd" } + }, + "name": "comment.block.dtd" + }, + "processing-instruction": { + "begin": "<\\?", + "beginCaptures": { + "0": { "name": "punctuation.definition.processing-instruction.begin.dtd" } + }, + "end": "\\?>", + "endCaptures": { + "0": { "name": "punctuation.definition.processing-instruction.end.dtd" } + }, + "name": "meta.processing-instruction.dtd", + "patterns": [ + { + "match": "\\G[\\p{L}_:][\\p{L}\\p{N}._:-]*", + "name": "entity.name.processing-instruction.dtd" + } + ] + }, + "conditional-section": { + "patterns": [ + { + "begin": "", + "patterns": [ + { + "begin": "(INCLUDE)\\s*\\[", + "beginCaptures": { + "1": { "name": "keyword.other.dtd" } + }, + "end": "(?=\\]\\]>)", + "name": "meta.conditional.include.dtd", + "patterns": [{ "include": "$self" }] + }, + { + "begin": "(IGNORE)\\s*\\[", + "beginCaptures": { + "1": { "name": "keyword.other.dtd" } + }, + "end": "(?=\\]\\]>)", + "name": "meta.conditional.ignore.dtd", + "contentName": "comment.block.ignored.dtd", + "patterns": [{ "include": "#ignored-content" }] + }, + { "include": "#parameter-entity-ref" }, + { + "begin": "\\[", + "end": "(?=\\]\\]>)", + "name": "meta.conditional.dtd", + "patterns": [{ "include": "$self" }] + } + ] + } + ] + }, + "ignored-content": { + "begin": "", + "patterns": [{ "include": "#ignored-content" }] + }, + "parameter-entity-ref": { + "match": "%[\\p{L}_:][\\p{L}\\p{N}._:-]*;", + "name": "variable.other.parameter-entity.dtd" + }, + "entity-ref": { + "patterns": [ + { + "match": "&#x[0-9a-fA-F]+;", + "name": "constant.character.entity.hexadecimal.dtd" + }, + { + "match": "&#[0-9]+;", + "name": "constant.character.entity.decimal.dtd" + }, + { + "match": "&[\\p{L}_:][\\p{L}\\p{N}._:-]*;", + "name": "constant.character.entity.named.dtd" + } + ] + }, + "string-double": { + "begin": "\"", + "beginCaptures": { + "0": { "name": "punctuation.definition.string.begin.dtd" } + }, + "end": "\"", + "endCaptures": { + "0": { "name": "punctuation.definition.string.end.dtd" } + }, + "name": "string.quoted.double.dtd", + "patterns": [ + { "include": "#entity-ref" }, + { "include": "#parameter-entity-ref" } + ] + }, + "string-single": { + "begin": "'", + "beginCaptures": { + "0": { "name": "punctuation.definition.string.begin.dtd" } + }, + "end": "'", + "endCaptures": { + "0": { "name": "punctuation.definition.string.end.dtd" } + }, + "name": "string.quoted.single.dtd", + "patterns": [ + { "include": "#entity-ref" }, + { "include": "#parameter-entity-ref" } + ] + }, + "string": { + "patterns": [ + { "include": "#string-double" }, + { "include": "#string-single" } + ] + }, + "element-declaration": { + "begin": "()", + "endCaptures": { + "1": { "name": "punctuation.definition.tag.dtd" } + }, + "name": "meta.declaration.element.dtd", + "patterns": [ + { + "begin": "(%[\\p{L}_:][\\p{L}\\p{N}._:-]*;|[\\p{L}_:][\\p{L}\\p{N}._:-]*)", + "beginCaptures": { + "1": { "name": "entity.name.tag.dtd" } + }, + "end": "(?=>)", + "patterns": [ + { + "match": "#PCDATA|\\b(ANY|EMPTY)\\b", + "name": "constant.language.dtd" + }, + { + "match": "[|,?*+()]", + "name": "keyword.operator.dtd" + }, + { "include": "#parameter-entity-ref" }, + { + "match": "[\\p{L}_:][\\p{L}\\p{N}._:-]*", + "name": "entity.name.element.ref.dtd" + } + ] + }, + { "include": "#parameter-entity-ref" } + ] + }, + "attlist-declaration": { + "begin": "()", + "endCaptures": { + "1": { "name": "punctuation.definition.tag.dtd" } + }, + "name": "meta.declaration.attlist.dtd", + "patterns": [ + { + "begin": "(%[\\p{L}_:][\\p{L}\\p{N}._:-]*;|[\\p{L}_:][\\p{L}\\p{N}._:-]*)", + "beginCaptures": { + "1": { "name": "entity.name.element.dtd" } + }, + "end": "(?=>)", + "patterns": [ + { + "match": "\\b(CDATA|IDREFS|IDREF|ID|NMTOKENS|NMTOKEN|ENTITIES|ENTITY|NOTATION)\\b", + "name": "keyword.other.data-type.dtd" + }, + { + "match": "#REQUIRED|#IMPLIED|#FIXED", + "name": "constant.language.dtd" + }, + { "include": "#string" }, + { + "begin": "\\(", + "beginCaptures": { "0": { "name": "keyword.operator.dtd" } }, + "end": "\\)", + "endCaptures": { "0": { "name": "keyword.operator.dtd" } }, + "patterns": [ + { "match": "\\|", "name": "keyword.operator.dtd" }, + { "include": "#parameter-entity-ref" }, + { + "match": "[\\p{L}\\p{N}._:-]+", + "name": "constant.other.enum-value.dtd" + } + ] + }, + { "include": "#parameter-entity-ref" }, + { + "match": "[\\p{L}_:][\\p{L}\\p{N}._:-]*", + "name": "variable.other.attribute-name.dtd" + } + ] + }, + { "include": "#parameter-entity-ref" } + ] + }, + "entity-declaration": { + "begin": "()", + "endCaptures": { + "1": { "name": "punctuation.definition.tag.dtd" } + }, + "name": "meta.declaration.entity.dtd", + "patterns": [ + { + "match": "%(?![\\p{L}_:])", + "name": "punctuation.definition.entity.dtd" + }, + { + "begin": "([\\p{L}_:][\\p{L}\\p{N}._:-]*)", + "beginCaptures": { + "1": { "name": "entity.name.entity.dtd" } + }, + "end": "(?=>)", + "patterns": [ + { + "match": "\\b(SYSTEM|PUBLIC|NDATA)\\b", + "name": "keyword.other.dtd" + }, + { "include": "#string" }, + { "include": "#parameter-entity-ref" } + ] + } + ] + }, + "notation-declaration": { + "begin": "()", + "endCaptures": { + "1": { "name": "punctuation.definition.tag.dtd" } + }, + "name": "meta.declaration.notation.dtd", + "patterns": [ + { + "begin": "([\\p{L}_:][\\p{L}\\p{N}._:-]*)", + "beginCaptures": { + "1": { "name": "entity.name.notation.dtd" } + }, + "end": "(?=>)", + "patterns": [ + { + "match": "\\b(SYSTEM|PUBLIC)\\b", + "name": "keyword.other.dtd" + }, + { "include": "#string" } + ] + } + ] + } + } +} diff --git a/org.eclipse.wildwebdeveloper.xml/plugin.xml b/org.eclipse.wildwebdeveloper.xml/plugin.xml index 92445cabe3..ae6aa85e83 100644 --- a/org.eclipse.wildwebdeveloper.xml/plugin.xml +++ b/org.eclipse.wildwebdeveloper.xml/plugin.xml @@ -51,7 +51,7 @@ file-extensions="dtd" id="org.eclipse.wildwebdeveloper.dtd" name="DTD" - priority="low"> + priority="medium"> + + + + + + + + + + + + + + + + + + + + +%common; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + ]]> +]]> + + + + + + + + + +]]> + + +]]>