{ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "name": "aiscript", "displayName": "AiScript", "aliases": [ "is", "ais", "AiScript" ], "patterns": [ { "include": "#namespace" }, { "include": "#syntax" }, { "include": "#template-strings" } ], "repository": { "syntax": { "patterns": [ { "include": "#comments" }, { "include": "#functions" }, { "include": "#strings" }, { "include": "#declarations" }, { "include": "#numbers" }, { "include": "#keywords" }, { "include": "#operators" }, { "include": "#presets" }, { "include": "#variables" } ] }, "declarations": { "patterns": [ { "name": "storage.type.aiscript", "match": "(@|true|false|null|exists)|(^#{3}(?= +\\{))|((var|let)(?= +))" } ] }, "keywords": { "patterns": [ { "name": "keyword.control.aiscript", "match": "(return|<:|if|elif|else|for|each|eval|loop|match)(?=[\\s(])" } ] }, "operators": { "patterns": [ { "name": "keyword.operator.aiscript", "match": "(\\+|\\-|\\*|\\*\\*|\\/|%|<<|>>|&&|\\|\\||\\^|~|<|>|<=|=>|!=|=)" }, { "name": "punctuation.accessor.aiscript", "match": "(:|\\.)" } ] }, "namespace": { "patterns": [ { "name": "meta.namespaceblock.aiscript", "match": "^(:{2})\\s?([a-zA-Z0-9_]+)\\s?\\{", "captures": { "1": { "name": "storage.type.aiscript" }, "2": { "name": "entity.name.class.aiscript" } } } ] }, "functions": { "patterns": [ { "name": "meta.classfunction.aiscript", "begin": "([A-Z][A-Za-z0-9_:]*(?=:):)*((?<=:)[a-zA-Z0-9_]+(?=\\())\\(", "beginCaptures": { "1": { "name": "meta.classnamechain.aiscript", "patterns": [ { "match": ":", "name": "keyword.operator.aiscript" }, { "name": "entity.name.class.aiscript", "match": "[^:]*" } ] }, "2": { "name": "entity.name.function.aiscript" } }, "patterns": [ { "include": "#syntax" }, { "include": "#template-strings" } ], "end": "\\)" }, { "name": "meta.function.aiscript", "begin": "[:.]?([a-zA-Z_][a-zA-Z0-9_]*)\\(", "beginCaptures": { "1": { "name": "entity.name.function.aiscript" } }, "patterns": [ { "include": "#syntax" }, { "include": "#template-strings" } ], "end": "\\)" } ] }, "strings": { "patterns": [ { "name": "string.quoted.single.aiscript", "begin": "'", "end": "'", "patterns": [ { "name": "constant.character.escape.aiscript", "match": "\\\\['\"\\\\]" } ] }, { "name": "string.quoted.double.aiscript", "begin": "\"", "end": "\"", "patterns": [ { "name": "constant.character.escape.aiscript", "match": "\\\\['\"\\\\]" } ] } ] }, "template-strings": { "patterns": [ { "name": "meta.template-string.aiscript", "begin": "`", "beginCaptures": { "0": { "name": "string.other.aiscript" } }, "end": "`", "endCaptures": { "0": { "name": "string.other.aiscript" } }, "patterns": [ { "name": "constant.character.escape.aiscript", "match": "\\\\['\"`\\\\{}]" }, { "name": "meta.string-template.aiscript", "begin": "\\{", "beginCaptures": { "0": { "name": "entity.name.tag.aiscript" } }, "end": "\\}", "endCaptures": { "0": { "name": "entity.name.tag.aiscript" } }, "patterns": [ { "include": "#syntax" } ] }, { "name": "string.other.aiscript", "match": "[^`{]+" } ] } ] }, "numbers": { "patterns": [ { "name": "constant.numeric.aiscript", "match": "-?[0-9]+" } ] }, "variables": { "patterns": [ { "name": "variable.other.readwrite.aiscript", "match": "[a-zA-Z][a-zA-Z0-9_]*" } ] }, "presets": { "patterns": [ { "name": "variable.other.constant.aiscript", "match": "USER_ID|USER_NAME|CUSTOM_EMOJIS|LOCALE|SERVER_URL|THIS_ID|THIS_URL" }, { "name": "meta.classconstant.aiscript", "match": "([A-Z][A-Za-z0-9_:]*(?=:):)*((?<=:)[a-zA-Z0-9_]+)", "captures": { "1": { "name": "meta.classnamechain.aiscript", "patterns": [ { "match": ":", "name": "punctuation.accessor.aiscript" }, { "name": "entity.name.class.aiscript", "match": "[^:]*" } ] }, "2": { "name": "variable.other.constant.aiscript" } } } ] }, "comments": { "patterns": [ { "name": "comment.line.double-slash.aiscript", "match": "//.*" }, { "name": "comment.block.aiscript", "begin": "/\\*", "end": "\\*/" } ] } }, "scopeName": "source.aiscript" }