Files
gymkhana-actions/vscode-extension-ashes/syntaxes/ashes.tmLanguage.json

419 lines
11 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "ASHES",
"scopeName": "source.ashes",
"patterns": [
{
"include": "#comments"
},
{
"include": "#events"
},
{
"include": "#dialog-blocks"
},
{
"include": "#dialog-choices"
},
{
"include": "#commands"
},
{
"include": "#variables"
},
{
"include": "#control-flow"
},
{
"include": "#strings"
},
{
"include": "#numbers"
},
{
"include": "#operators"
},
{
"include": "#keywords"
},
{
"include": "#builtin-variables"
},
{
"include": "#global-ids"
}
],
"repository": {
"comments": {
"patterns": [
{
"name": "comment.line.number-sign.ashes",
"begin": "#",
"end": "$",
"patterns": [
{
"name": "comment.line.number-sign.ashes",
"match": "."
}
]
}
]
},
"events": {
"patterns": [
{
"name": "entity.name.function.event.ashes",
"match": "^\\s*(:)([a-zA-Z_][a-zA-Z0-9_]*)(\\s*\\|\\s*[A-Z_]+)*",
"captures": {
"1": {
"name": "punctuation.definition.event.ashes"
},
"2": {
"name": "entity.name.function.event.ashes"
},
"3": {
"name": "entity.name.tag.event-flags.ashes"
}
}
},
{
"name": "entity.name.function.event-with-target.ashes",
"match": "^\\s*(:)([a-zA-Z_][a-zA-Z0-9_]*)(\\s*\\|\\s*[A-Z_]+)*\\s+(\"[^\"]*\")",
"captures": {
"1": {
"name": "punctuation.definition.event.ashes"
},
"2": {
"name": "entity.name.function.event.ashes"
},
"3": {
"name": "entity.name.tag.event-flags.ashes"
},
"4": {
"name": "string.quoted.double.event-target.ashes"
}
}
}
]
},
"dialog-blocks": {
"patterns": [
{
"name": "meta.dialog-block.ashes",
"begin": "^(\\s*)(\\?\\!)",
"beginCaptures": {
"1": {
"name": "punctuation.whitespace.indent.ashes"
},
"2": {
"name": "keyword.control.dialog.ashes"
}
},
"end": "^(?=\\1[^\\s]|\\s*$)",
"patterns": [
{
"include": "#dialog-choices"
},
{
"include": "#commands"
},
{
"include": "#variables"
},
{
"include": "#control-flow"
},
{
"include": "#strings"
},
{
"include": "#comments"
}
]
}
]
},
"dialog-choices": {
"patterns": [
{
"name": "meta.dialog-choice.ashes",
"begin": "^(\\s*)(-)\\s*(\"[^\"]*\")\\s*(\\[.*?\\])?",
"beginCaptures": {
"1": {
"name": "punctuation.whitespace.indent.ashes"
},
"2": {
"name": "punctuation.definition.dialog-choice.ashes"
},
"3": {
"name": "string.quoted.double.dialog-choice.ashes"
},
"4": {
"name": "meta.condition.dialog-choice.ashes"
}
},
"end": "^(?=\\1[^\\s-]|\\s*$)",
"patterns": [
{
"include": "#commands"
},
{
"include": "#variables"
},
{
"include": "#control-flow"
},
{
"include": "#strings"
},
{
"include": "#comments"
}
]
}
]
},
"commands": {
"patterns": [
{
"name": "support.function.command.ashes",
"match": "\\b(accept_input|anim|anim_block|block_say|camera_push|camera_push_block|camera_set_limits|camera_set_pos|camera_set_pos_block|camera_set_target|camera_set_target_block|camera_set_zoom|camera_set_zoom_block|camera_set_zoom_height|camera_set_zoom_height_block|camera_shift|camera_shift_block|change_scene|custom|dec_global|enable_terrain|end_block_say|hide_menu|inc_global|inventory_add|inventory_remove|item_count_add|play_lib_snd|play_snd|play_video|print|print_internal|queue_event|queue_resource|rand_global|repeat|save_game|say|say_last_dialog_option|say_random|say_sequence|sched_event|set_active|set_active_if_exists|set_angle|set_animations|set_direction|set_global|set_globals|set_gui_visible|set_interactive|set_item_custom_data|set_speed|set_state|set_tooltip|show_menu|slide|slide_block|spawn|stop|stop_snd|teleport|teleport_pos|transition|turn_to|wait|walk|walk_block|walk_to_pos|walk_to_pos_block)\\b",
"captures": {
"1": {
"name": "support.function.command.ashes"
}
}
},
{
"name": "meta.function-call.ashes",
"begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(\\()",
"beginCaptures": {
"1": {
"name": "support.function.command.ashes"
},
"2": {
"name": "punctuation.definition.parameters.begin.ashes"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.definition.parameters.end.ashes"
}
},
"patterns": [
{
"include": "#strings"
},
{
"include": "#numbers"
},
{
"include": "#global-ids"
},
{
"include": "#builtin-variables"
},
{
"include": "#operators"
}
]
}
]
},
"variables": {
"patterns": [
{
"name": "storage.type.variable.ashes",
"match": "\\b(var|global)\\b",
"captures": {
"1": {
"name": "storage.type.variable.ashes"
}
}
},
{
"name": "variable.other.ashes",
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(=)",
"captures": {
"1": {
"name": "variable.other.ashes"
},
"2": {
"name": "keyword.operator.assignment.ashes"
}
}
}
]
},
"control-flow": {
"patterns": [
{
"name": "keyword.control.ashes",
"match": "\\b(if|elif|else|while|break|done|stop|pass)\\b",
"captures": {
"1": {
"name": "keyword.control.ashes"
}
}
},
{
"name": "meta.control-flow.ashes",
"begin": "\\b(if|elif|while)\\s+",
"beginCaptures": {
"1": {
"name": "keyword.control.ashes"
}
},
"end": ":",
"endCaptures": {
"0": {
"name": "punctuation.separator.condition.ashes"
}
},
"patterns": [
{
"include": "#operators"
},
{
"include": "#builtin-variables"
},
{
"include": "#global-ids"
},
{
"include": "#strings"
},
{
"include": "#numbers"
},
{
"include": "#keywords"
},
{
"include": "#variables"
},
{
"include": "#conditional-expressions"
}
]
}
]
},
"conditional-expressions": {
"patterns": [
{
"name": "meta.conditional-expression.ashes",
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(==|!=|<=|>=|<|>)\\s*([a-zA-Z_][a-zA-Z0-9_]*|\\d+)\\b",
"captures": {
"1": {
"name": "variable.other.conditional.ashes"
},
"2": {
"name": "keyword.operator.comparison.ashes"
},
"3": {
"name": "variable.other.conditional.ashes"
}
}
}
]
},
"strings": {
"patterns": [
{
"name": "string.quoted.double.ashes",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.ashes",
"match": "\\\\."
},
{
"name": "variable.other.global.ashes",
"match": "\\{[^}]+\\}"
}
]
},
{
"name": "string.quoted.single.ashes",
"begin": "'",
"end": "'",
"patterns": [
{
"name": "constant.character.escape.ashes",
"match": "\\\\."
}
]
}
]
},
"numbers": {
"patterns": [
{
"name": "constant.numeric.integer.ashes",
"match": "\\b\\d+\\b"
},
{
"name": "constant.numeric.float.ashes",
"match": "\\b\\d+\\.\\d+\\b"
}
]
},
"operators": {
"patterns": [
{
"name": "keyword.operator.arithmetic.ashes",
"match": "\\+|-|\\*|/"
},
{
"name": "keyword.operator.comparison.ashes",
"match": "==|!=|<=|>=|<|>"
},
{
"name": "keyword.operator.logical.ashes",
"match": "\\b(and|or|not)\\b|!"
},
{
"name": "keyword.operator.assignment.ashes",
"match": "="
}
]
},
"keywords": {
"patterns": [
{
"name": "constant.language.boolean.ashes",
"match": "\\b(true|false|nil)\\b"
},
{
"name": "keyword.other.ashes",
"match": "\\b(in|is|active|inventory)\\b"
}
]
},
"builtin-variables": {
"patterns": [
{
"name": "variable.language.builtin.ashes",
"match": "\\b(CURRENT_PLAYER|ESC_LAST_SCENE|ESC_CURRENT_SCENE|FORCE_LAST_SCENE_NULL|ANIMATION_RESOURCES)\\b"
}
]
},
"global-ids": {
"patterns": [
{
"name": "variable.other.global-id.ashes",
"match": "\\$([a-zA-Z_][a-zA-Z0-9_]*)",
"captures": {
"1": {
"name": "variable.other.global-id.ashes"
}
}
}
]
}
}
}