Skip to content

Instantly share code, notes, and snippets.

@jocopa3
Created June 21, 2017 13:07
Show Gist options
  • Save jocopa3/25107afa41fa51e8dd655daef684f12e to your computer and use it in GitHub Desktop.
Save jocopa3/25107afa41fa51e8dd655daef684f12e to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array/>
<key>name</key>
<string>Minecraft Addon</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#value</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>array</key>
<dict>
<key>begin</key>
<string>\[</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.array.begin.json</string>
</dict>
</dict>
<key>end</key>
<string>\]</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.array.end.json</string>
</dict>
</dict>
<key>name</key>
<string>meta.structure.array.json</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#value</string>
</dict>
<dict>
<key>include</key>
<string>#strings</string>
</dict>
<dict>
<key>match</key>
<string>,</string>
<key>name</key>
<string>punctuation.separator.array.json</string>
</dict>
<dict>
<key>match</key>
<string>[^\s\]]</string>
<key>name</key>
<string>invalid.illegal.expected-array-separator.json</string>
</dict>
</array>
</dict>
<key>comments</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>/\*\*</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.json</string>
</dict>
</dict>
<key>end</key>
<string>\*/</string>
<key>name</key>
<string>comment.block.documentation.json</string>
</dict>
<dict>
<key>begin</key>
<string>/\*</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.json</string>
</dict>
</dict>
<key>end</key>
<string>\*/</string>
<key>name</key>
<string>comment.block.json</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.json</string>
</dict>
</dict>
<key>match</key>
<string>(//).*$\n?</string>
<key>name</key>
<string>comment.line.double-slash.js</string>
</dict>
</array>
</dict>
<key>constant</key>
<dict>
<key>match</key>
<string>\b(?:true|false|null)\b</string>
<key>name</key>
<string>constant.language.json</string>
</dict>
<key>mcaddon</key>
<dict>
<key>begin</key>
<string>\"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.json</string>
</dict>
</dict>
<key>end</key>
<string>\"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.json</string>
</dict>
</dict>
<key>patterns</key>
<array>
<dict>
<key>comment</key>
<string>UI Inherit Type</string>
<key>match</key>
<string>(?&lt;=\.)([a-zA-Z0-9_]+)(?=\")</string>
<key>name</key>
<string>support.function.uitype.mcaddon</string>
</dict>
<dict>
<key>match</key>
<string>(\-)?\d+(\.\d+)?(\%)?(c|x|px)?(?=[\"\s-+])</string>
<key>name</key>
<string>constant.numeric.json</string>
</dict>
<dict>
<key>comment</key>
<string>Minecraft Keyword</string>
<key>match</key>
<string>(\b(minecraft)\b)</string>
<key>name</key>
<string>keyword.other.minecraft.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Minecraft Keyword</string>
<key>match</key>
<string>(\b(format_version)\b)</string>
<key>name</key>
<string>keyword.other.formatversion.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Minecraft Object Parameter</string>
<key>match</key>
<string>(?&lt;=minecraft:)([^"]+)(?=")(?!"\s*[,\n])</string>
<key>name</key>
<string>entity.name.minecraftParam.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Minecraft Object Parameter</string>
<key>match</key>
<string>(?&lt;=minecraft:)([0-9a-zA-Z_\.]+)</string>
<key>name</key>
<string>variable.parameter.minecraftParam.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Invalid Minecraft Parameter</string>
<key>match</key>
<string>(?&lt;=minecraft:)([0-9a-zA-Z_\.]+(?!["]))</string>
<key>name</key>
<string>invalid.illegal.minecraft.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Definitions</string>
<key>match</key>
<string>(\b(items|family)\b)</string>
<key>name</key>
<string>support.function.definition.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Definitions</string>
<key>match</key>
<string>(\b(and|not|or)\b)</string>
<key>name</key>
<string>keyword.control.uilogic.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>UI Definition</string>
<key>match</key>
<string>(?&lt;=\")([a-zA-Z0-9_]+)(?=\@)</string>
<key>name</key>
<string>keyword.other.uidefinition.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>UI Controls</string>
<key>match</key>
<string>([@$#|])</string>
<key>name</key>
<string>constant.numeric.uicontrol.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Parenthesis</string>
<key>match</key>
<string>([\(\)])</string>
<key>name</key>
<string>meta.parenthesis.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Hyperlink</string>
<key>match</key>
<string>(http|www)[^"]+</string>
<key>name</key>
<string>meta.hyperlink.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>File Path</string>
<key>match</key>
<string>(([a-zA-Z0-9_]+)\/)+[a-zA-Z0-9_\.]+</string>
<key>name</key>
<string>meta.filepath.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>UI Namespace</string>
<key>match</key>
<string>(\bnamespace\b)</string>
<key>name</key>
<string>keyword.other.uinamespace</string>
</dict>
<dict>
<key>comment</key>
<string>UI Namespace Type</string>
<key>match</key>
<string>(?&lt;=\@)([a-zA-Z0-9_]+)(?=[\.\"])</string>
<key>name</key>
<string>entity.name.namespae.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>UI Variable</string>
<key>match</key>
<string>(?&lt;=\$)([a-zA-Z0-9_]+)</string>
<key>name</key>
<string>entity.name.uivar.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>UI Type</string>
<key>match</key>
<string>(?&lt;=\#)([a-zA-Z0-9_]+)</string>
<key>name</key>
<string>variable.parameter.uitype.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>UI Default</string>
<key>match</key>
<string>(?&lt;=\|)(\b(default)\b)</string>
<key>name</key>
<string>keyword.other.uidefault.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Event Functions</string>
<key>match</key>
<string>(\b(randomize|add|remove|sequence)\b)</string>
<key>name</key>
<string>support.function.eventFunction.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Loot Functions</string>
<key>match</key>
<string>(\b(functions|levels|count|rolls)\b)</string>
<key>name</key>
<string>support.function.loot.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Trade Parameters</string>
<key>match</key>
<string>(\b(wants|gives|quantity)\b)</string>
<key>name</key>
<string>support.function.trades.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Item Definitions</string>
<key>match</key>
<string>(\b(effects|enchanted_effects|food|seed)\b)</string>
<key>name</key>
<string>support.function.items.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Item camera definition</string>
<key>match</key>
<string>(?&lt;=")(camera)(?="\s*:)</string>
<key>name</key>
<string>support.function.items.camera.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Components and Component Groups</string>
<key>match</key>
<string>(\b(component(s|_groups)\b))</string>
<key>name</key>
<string>keyword.control.components.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Trade Object Definitions</string>
<key>match</key>
<string>(\b(pools|entries|function|tiers|trades)\b)</string>
<key>name</key>
<string>entity.name.stuff.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Entity type</string>
<key>match</key>
<string>(\b(entity_types)\b)</string>
<key>name</key>
<string>entity.name.section.entityType.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Filters</string>
<key>match</key>
<string>(\b(filters)\b)</string>
<key>name</key>
<string>entity.name.section.filter.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Event keyword</string>
<key>match</key>
<string>(\b(event)\b)</string>
<key>name</key>
<string>entity.name.type.events.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Events keyword</string>
<key>match</key>
<string>(\b(events)\b)</string>
<key>name</key>
<string>keyword.control.events.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Json File Path</string>
<key>match</key>
<string>(?i)(?&lt;=")[a-zA-Z0-9_/\\\.]+\.(json)(?=")</string>
<key>name</key>
<string>variable.other.filepath.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Array Definition</string>
<key>match</key>
<string>(?&lt;=")([a-zA-Z0-9_:\+]+)(?="\s*:\s*\[)</string>
<key>name</key>
<string>storage.type.arrayDefinition.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Object Definition</string>
<key>match</key>
<string>(?&lt;=")([a-zA-Z0-9_:\+]+)(?="\s*:\s*\{)</string>
<key>name</key>
<string>entity.name.objectDefinition.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Object Parameters</string>
<key>match</key>
<string>(?&lt;=\")([^"])+(?=\" *\:)</string>
<key>name</key>
<string>variable.parameter.object.mcaddon</string>
</dict>
<dict>
<key>comment</key>
<string>Strings</string>
<key>match</key>
<string>(?&lt;=\")[^"]+(?=")</string>
<key>name</key>
<string>string.quoted.double.mcaddon</string>
</dict>
</array>
</dict>
<key>number</key>
<dict>
<key>match</key>
<string>(?x) # turn on extended mode
-? # an optional minus
(?:
0 # a zero
| # ...or...
[1-9] # a 1-9 character
\d* # followed by zero or more digits
)
(?:
(?:
\. # a period
\d+ # followed by one or more digits
)?
(?:
[eE] # an e character
[+-]? # followed by an option +/-
\d+ # followed by one or more digits
)? # make exponent optional
(?:
(px|%(c|x)?) # % or px
)?
)? # make decimal portion optional</string>
<key>name</key>
<string>constant.numeric.json</string>
</dict>
<key>object</key>
<dict>
<key>begin</key>
<string>\{</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.dictionary.begin.json</string>
</dict>
</dict>
<key>end</key>
<string>\}</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.dictionary.end.json</string>
</dict>
</dict>
<key>name</key>
<string>meta.structure.dictionary.json</string>
<key>patterns</key>
<array>
<dict>
<key>comment</key>
<string>the JSON object key</string>
<key>include</key>
<string>#mcaddon</string>
</dict>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>begin</key>
<string>:</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.separator.dictionary.key-value.json</string>
</dict>
</dict>
<key>end</key>
<string>(,)|(?=\})</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.separator.dictionary.pair.json</string>
</dict>
</dict>
<key>name</key>
<string>meta.structure.dictionary.value.json</string>
<key>patterns</key>
<array>
<dict>
<key>comment</key>
<string>the JSON object value</string>
<key>include</key>
<string>#value</string>
</dict>
<dict>
<key>match</key>
<string>[^\s,]</string>
<key>name</key>
<string>invalid.illegal.expected-dictionary-separator.json</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>[^\s\}]</string>
<key>name</key>
<string>invalid.illegal.expected-dictionary-separator.json</string>
</dict>
</array>
</dict>
<key>value</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#constant</string>
</dict>
<dict>
<key>include</key>
<string>#number</string>
</dict>
<dict>
<key>include</key>
<string>#mcaddon</string>
</dict>
<dict>
<key>include</key>
<string>#array</string>
</dict>
<dict>
<key>include</key>
<string>#object</string>
</dict>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
</array>
</dict>
</dict>
<key>scopeName</key>
<string>source.mcaddon</string>
<key>uuid</key>
<string>a0c7e4ae-079d-4d09-9b1d-5379c586f67a</string>
</dict>
</plist>
# [PackageDev] target_format: plist, ext: tmLanguage
name: Minecraft Addon
scopeName: source.mcaddon
fileTypes: []
uuid: a0c7e4ae-079d-4d09-9b1d-5379c586f67a
patterns:
- include: '#value'
repository:
array:
name: meta.structure.array.json
begin: \[
beginCaptures:
'0': {name: punctuation.definition.array.begin.json}
end: \]
endCaptures:
'0': {name: punctuation.definition.array.end.json}
patterns:
- include: '#value'
- include: '#strings'
- name: punctuation.separator.array.json
match: ','
- name: invalid.illegal.expected-array-separator.json
match: '[^\s\]]'
comments:
patterns:
- name: comment.block.documentation.json
begin: /\*\*
end: \*/
captures:
'0': {name: punctuation.definition.comment.json}
- name: comment.block.json
begin: /\*
end: \*/
captures:
'0': {name: punctuation.definition.comment.json}
- name: comment.line.double-slash.js
match: (//).*$\n?
captures:
'1': {name: punctuation.definition.comment.json}
constant:
name: constant.language.json
match: \b(?:true|false|null)\b
mcaddon:
begin: \"
beginCaptures:
'0': {name: punctuation.definition.string.begin.json}
end: \"
endCaptures:
'0': {name: punctuation.definition.string.end.json}
patterns:
- comment: UI Inherit Type
name: support.function.uitype.mcaddon
match: (?<=\.)([a-zA-Z0-9_]+)(?=\")
- name: constant.numeric.json
match: (\-)?\d+(\.\d+)?(\%)?(c|x|px)?(?=[\"\s-+])
- comment: Minecraft Keyword
name: keyword.other.minecraft.mcaddon
match: (\b(minecraft)\b)
- comment: Minecraft Keyword
name: keyword.other.formatversion.mcaddon
match: (\b(format_version)\b)
- comment: Minecraft Object Parameter
name: entity.name.minecraftParam.mcaddon
match: (?<=minecraft:)([^"]+)(?=")(?!"\s*[,\n])
- comment: Minecraft Object Parameter
name: variable.parameter.minecraftParam.mcaddon
match: (?<=minecraft:)([0-9a-zA-Z_\.]+)
- comment: Invalid Minecraft Parameter
name: invalid.illegal.minecraft.mcaddon
match: (?<=minecraft:)([0-9a-zA-Z_\.]+(?!["]))
- comment: Definitions
name: support.function.definition.mcaddon
match: (\b(items|family)\b)
- comment: Definitions
name: keyword.control.uilogic.mcaddon
match: (\b(and|not|or)\b)
- comment: UI Definition
name: keyword.other.uidefinition.mcaddon
match: (?<=\")([a-zA-Z0-9_]+)(?=\@)
- comment: UI Controls
name: constant.numeric.uicontrol.mcaddon
match: ([@$#|])
- comment: Parenthesis
name: meta.parenthesis.mcaddon
match: ([\(\)])
- comment: Hyperlink
name: meta.hyperlink.mcaddon
match: (http|www)[^"]+
- comment: File Path
name: meta.filepath.mcaddon
match: (([a-zA-Z0-9_]+)\/)+[a-zA-Z0-9_\.]+
- comment: UI Namespace
name: keyword.other.uinamespace
match: (\bnamespace\b)
- comment: UI Namespace Type
name: entity.name.namespae.mcaddon
match: (?<=\@)([a-zA-Z0-9_]+)(?=[\.\"])
- comment: UI Variable
name: entity.name.uivar.mcaddon
match: (?<=\$)([a-zA-Z0-9_]+)
- comment: UI Type
name: variable.parameter.uitype.mcaddon
match: (?<=\#)([a-zA-Z0-9_]+)
- comment: UI Default
name: keyword.other.uidefault.mcaddon
match: (?<=\|)(\b(default)\b)
- comment: Event Functions
name: support.function.eventFunction.mcaddon
match: (\b(randomize|add|remove|sequence)\b)
- comment: Loot Functions
name: support.function.loot.mcaddon
match: (\b(functions|levels|count|rolls)\b)
- comment: Trade Parameters
name: support.function.trades.mcaddon
match: (\b(wants|gives|quantity)\b)
- comment: Item Definitions
name: support.function.items.mcaddon
match: (\b(effects|enchanted_effects|food|seed)\b)
- comment: Item camera definition
name: support.function.items.camera.mcaddon
match: (?<=")(camera)(?="\s*:)
- comment: Components and Component Groups
name: keyword.control.components.mcaddon
match: (\b(component(s|_groups)\b))
- comment: Trade Object Definitions
name: entity.name.stuff.mcaddon
match: (\b(pools|entries|function|tiers|trades)\b)
- comment: Entity type
name: entity.name.section.entityType.mcaddon
match: (\b(entity_types)\b)
- comment: Filters
name: entity.name.section.filter.mcaddon
match: (\b(filters)\b)
- comment: Event keyword
name: entity.name.type.events.mcaddon
match: (\b(event)\b)
- comment: Events keyword
name: keyword.control.events.mcaddon
match: (\b(events)\b)
- comment: Json File Path
name: variable.other.filepath.mcaddon
match: (?i)(?<=")[a-zA-Z0-9_/\\\.]+\.(json)(?=")
- comment: Array Definition
name: storage.type.arrayDefinition.mcaddon
match: (?<=")([a-zA-Z0-9_:\+]+)(?="\s*:\s*\[)
- comment: Object Definition
name: entity.name.objectDefinition.mcaddon
match: (?<=")([a-zA-Z0-9_:\+]+)(?="\s*:\s*\{)
- comment: Object Parameters
name: variable.parameter.object.mcaddon
match: (?<=\")([^"])+(?=\" *\:)
- comment: Strings
name: string.quoted.double.mcaddon
match: (?<=\")[^"]+(?=")
number:
name: constant.numeric.json
match: |-
(?x) # turn on extended mode
-? # an optional minus
(?:
0 # a zero
| # ...or...
[1-9] # a 1-9 character
\d* # followed by zero or more digits
)
(?:
(?:
\. # a period
\d+ # followed by one or more digits
)?
(?:
[eE] # an e character
[+-]? # followed by an option +/-
\d+ # followed by one or more digits
)? # make exponent optional
(?:
(px|%(c|x)?) # % or px
)?
)? # make decimal portion optional
object:
name: meta.structure.dictionary.json
begin: \{
beginCaptures:
'0': {name: punctuation.definition.dictionary.begin.json}
end: \}
endCaptures:
'0': {name: punctuation.definition.dictionary.end.json}
patterns:
- comment: the JSON object key
include: '#mcaddon'
- include: '#comments'
- name: meta.structure.dictionary.value.json
begin: ':'
beginCaptures:
'0': {name: punctuation.separator.dictionary.key-value.json}
end: (,)|(?=\})
endCaptures:
'1': {name: punctuation.separator.dictionary.pair.json}
patterns:
- comment: the JSON object value
include: '#value'
- name: invalid.illegal.expected-dictionary-separator.json
match: '[^\s,]'
- name: invalid.illegal.expected-dictionary-separator.json
match: '[^\s\}]'
value:
patterns:
- include: '#constant'
- include: '#number'
- include: '#mcaddon'
- include: '#array'
- include: '#object'
- include: '#comments'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment