Skip to content

Instantly share code, notes, and snippets.

@vickio
Created September 14, 2019 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vickio/454eb4f3b5774c55f9e27901f2db8fc3 to your computer and use it in GitHub Desktop.
Save vickio/454eb4f3b5774c55f9e27901f2db8fc3 to your computer and use it in GitHub Desktop.
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "Dialog",
"patterns": [
{
"include": "#comments"
},
{
"include": "#keywords"
},
{
"include": "#lists"
},
{
"include": "#predicates"
},
{
"include": "#values"
},
{
"include": "#disjunctions"
},
{
"include": "#strings"
}
],
"repository": {
"predicates": {
"name": "entity.name.function.dialog",
"begin": "(?<!\\\\)(([^\\\\]\\*)|\\~)?\\(",
"end": "\\)",
"patterns": [{
"include": "#keywords"
},
{
"include": "#lists"
},
{
"include": "#predicates"
},
{
"include": "#values"
}]
},
"disjunctions": {
"name": "disjunction.dialog",
"begin": "\\{",
"end": "\\}",
"patterns": [{
"include": "#comments"
},
{
"include": "#keywords"
},
{
"include": "#lists"
},
{
"include": "#predicates"
},
{
"include": "#values"
},
{
"include": "#disjunctions"
},
{
"include": "#strings"
}]
},
"keywords": {
"patterns": [{
"name": "keyword.control.dialog",
"match": "\\(\\s*(if|then|elseif|else|endif|select|or|stopping|cycling|at random|purely at random|then at random|then purely at random)\\s*\\)"
},
{
"name": "entity.name.type.dialog",
"match": "\\(\\s*(now|exhaust|stoppable|stop|just|bold|clear|clear all|fail|fixed pitch|italic|line|no space|par|quit|reverse|roman|space|unstyle|uppercase)\\s*\\)"
}]
},
"lists": {
"name": "support.constant.color.dialog",
"begin": "\\[",
"end": "\\]",
"patterns": [{
"include": "#values"
},
{
"include": "#predicates"
}]
},
"comments": {
"patterns": [{
"name": "comment.dialog",
"match": "\\%\\%.*$"
}]
},
"values": {
"patterns": [{
"name": "entity.name.tag.dialog",
"match": "\\#((\\w|-)*)"
},
{
"name": "entity.name.tag.dialog",
"match": "(?<!\\\\)\\*"
},
{
"name": "variable.other.dialog",
"match": "\\$((\\w|-)*)"
},
{
"name": "support.constant.color.dialog",
"match": "\\@((\\w|-)*)"
}]
},
"strings": {
"patterns": [{
"name": "string.quoted.other.dialog",
"match": "[^\\(\\)]"
}]
}
},
"scopeName": "source.dialog"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment