{ "name": "Monkey", "scopeName": "source.monkey", "patterns": [ { "name": "punctuation.terminator.line.monkey", "match": ";" }, { "include": "#mnky_comment_quote" }, { "include": "#mnky_comment_block" }, { "include": "#mnky_global_variable" }, { "include": "#mnky_local_variable" }, { "include": "#mnky_constant" }, { "include": "#mnky_attributes" }, { "include": "#mnky_commands" }, { "include": "#mnky_function" }, { "include": "#mnky_method" }, { "name": "import.module.monkey", "match": "(?i)\\b(import)\\s+((?:[a-zA-Z_]\\w*\\.?)+)", "captures": { "1": { "name": "keyword.other.import.monkey" }, "2": { "name": "string.unquoted.module.monkey" } } }, { "name": "import.file.monkey", "contentName": "string.quoted.double.monkey", "begin": "(?i)\\b(import)\\s+((\"))", "end": "(\")", "patterns": [ { "include": "#mnky_string_content" } ], "beginCaptures": { "1": { "name": "keyword.other.import.monkey" }, "2": { "name": "punctuation.definition.string.begin.monkey" }, "3": { "name": "string.quoted.double.monkey" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.monkey" }, "1": { "name": "string.quoted.double.monkey" } } }, { "name": "type.monkey", "begin": "(?i)\\b(class)\\s+([a-zA-Z_]\\w*)(?:\\s+(extends)\\s+([a-zA-Z_]\\w*))?(?:\\s+(final|abstract))?", "end": "(?i)\\b(end(\\s?class)?)\\b", "patterns": [ { "include": "#mnky_comment_quote" }, { "include": "#mnky_comment_block" }, { "include": "#mnky_constants" }, { "include": "#mnky_string_quoted" }, { "include": "#mnky_attributes" }, { "include": "#mnky_null" }, { "include": "#mnky_types" }, { "include": "#mnky_typename" }, { "include": "#mnky_global_variable" }, { "include": "#mnky_local_variable" }, { "include": "#mnky_constant" }, { "include": "#mnky_function" }, { "include": "#mnky_method" }, { "include": "#mnky_field" }, { "include": "#mnky_constructor" } ], "beginCaptures": { "1": { "name": "storage.type.class.monkey" }, "2": { "name": "entity.name.type.monkey" }, "3": { "name": "storage.modifier.extends.monkey" }, "4": { "name": "entity.other.inherited-class.monkey" }, "5": { "name": "storage.modifier.class.monkey" } }, "endCaptures": { "1": { "name": "storage.type.class.monkey" } } }, { "name": "control.keywords.monkey", "match": "\\s*\\b(c(ase|ontinue)|do|e(lse(\\s?if)?|nd(class|for(each)?|function|if|method|select|while)|xit)|for(\\s?each)?|if|return|select|then|wend|while)\\b" }, { "include": "#mnky_control_keywords" }, { "name": "control.while.monkey", "begin": "(?i)\\b(while)\\b", "end": "(?i)\\b(end(\\s?while)?|wend)\\b", "patterns": [ { "include": "$self" } ], "beginCaptures": { "1": { "name": "keyword.control.while.monkey" } }, "endCaptures": { "1": { "name": "keyword.control.while.end.monkey" } } }, { "name": "control.if.monkey", "begin": "(?i)\\b(if|then|else|else(\\s?if)?)\\b", "end": "(?i)\\b(end(\\s?if)?)\\b", "patterns": [ { "name": "keyword.control.then.monkey", "match": "(?i)\\b(then)\\b" }, { "name": "keyword.control.else-if.monkey", "match": "(?i)\\b(else(\\s?if)?)\\b" }, { "name": "keyword.control.else.monkey", "match": "(?i)\\b(else)\\b" }, { "include": "$self" } ], "beginCaptures": { "1": { "name": "keyword.control.if.monkey" } }, "endCaptures": { "1": { "name": "keyword.control.if.end.monkey" } } }, { "name": "control.if-then.monkey", "begin": "(?i)\\b(if)\\b", "end": "$", "patterns": [ { "name": "keyword.control.then.monkey", "match": "(?i)\\b(then)\\b" }, { "include": "$self" } ], "beginCaptures": { "1": { "name": "keyword.control.if.monkey" } }, "endCaptures": { "1": { "name": "keyword.control.if.end.monkey" } } }, { "name": "control.for.monkey", "begin": "(?i)\\b(for)\\b", "end": "(?i)\\b(next)\\b", "patterns": [ { "name": "keyword.control.for.eachin.monkey", "match": "(?i)\\beachin\\b" }, { "name": "keyword.control.for.to.monkey", "match": "(?i)\\bto\\b" }, { "name": "keyword.control.for.until.monkey", "match": "(?i)\\buntil\\b" }, { "name": "keyword.control.for.step.monkey", "match": "(?i)\\bstep\\b" }, { "include": "$self" } ], "beginCaptures": { "1": { "name": "keyword.control.for.monkey" } }, "endCaptures": { "1": { "name": "keyword.control.for.end.monkey" } } }, { "name": "control.repeat.monkey", "begin": "(?i)\\b(repeat)\\b", "end": "(?i)\\b(until|forever)\\b", "patterns": [ { "include": "$self" } ], "beginCaptures": { "1": { "name": "keyword.control.repeat.monkey" } }, "endCaptures": { "1": { "name": "keyword.control.repeat.end.monkey" } } }, { "name": "control.select.monkey", "begin": "(?i)\\b(select)\\b", "end": "(?i)\\b(end(\\s?select)?)\\b", "patterns": [ { "name": "control.select.case.monkey", "match": "(?i)\\b(case)\\b", "captures": { "1": { "name": "keyword.control.select.case.monkey" } } }, { "name": "control.select.default.monkey", "match": "(?i)\\b(default)\\b", "captures": { "1": { "name": "keyword.control.select.default.monkey" } } }, { "include": "$self" } ], "beginCaptures": { "1": { "name": "keyword.control.select.monkey" } }, "endCaptures": { "1": { "name": "keyword.control.select.end.monkey" } } }, { "name": "keyword.operator.monkey", "match": "(?i)\\b(mod|shl|shr|and|or|not)\\b" }, { "name": "keyword.operator.monkey", "match": ":?[\\^+\\-\u0026~|=\u003e\u003c]" }, { "name": "keyword.other.scope.monkey", "match": "(?i)\\b(private|public)\\b" }, { "name": "keyword.other.strictness.monkey", "match": "(?i)\\b(strict)\\b" }, { "include": "#mnky_null" }, { "include": "#mnky_types" }, { "include": "#mnky_constants" }, { "include": "#mnky_string_quoted" }, { "name": "variable.language.self.monkey", "match": "(?i)\\b(self)\\b" }, { "name": "variable.language.super.monkey", "match": "(?i)\\b(super)\\b" }, { "include": "#mnky_constructor" }, { "include": "#mnky_array" }, { "include": "#mnky_typename" } ], "repository": { "mnky_array": { "name": "array.monkey", "begin": "(\\[)", "end": "(\\])", "patterns": [ { "include": "$self" } ], "beginCaptures": { "1": { "name": "keyword.operator.array.monkey" } }, "endCaptures": { "1": { "name": "keyword.operator.array.monkey" } } }, "mnky_attributes": { "name": "attributes.monkey", "begin": "(\\{)", "end": "(\\})", "patterns": [ { "name": "attribute.monkey", "begin": "\\b([a-zA-Z_]\\w*)\\s*(=)\\s*", "end": "(?=\\s|\\}|[a-zA-Z_])", "patterns": [ { "include": "#mnky_string_quoted" }, { "include": "#mnky_numbers" } ], "beginCaptures": { "1": { "name": "entity.other.attribute-name.monkey" } } }, { "name": "attribute.monkey", "match": "\\b([a-zA-Z_]\\w*)(?:\\s*((?!=)|(?=\\})))", "captures": { "1": { "name": "entity.other.attribute-name.monkey" } } } ], "beginCaptures": { "1": { "name": "storage.modifier.attributes.braces.monkey" } }, "endCaptures": { "1": { "name": "storage.modifier.attributes.braces.monkey" } } }, "mnky_boolean": { "name": "constant.language.boolean.monkey", "match": "(?i)\\b(true|false)\\b" }, "mnky_char": { "name": "constant.language.char.monkey", "match": "\\b(CHAR_(TAB|BACKSPACE|ENTER|ESCAPE|PAGE(UP|DOWN)|END|HOME|LEFT|UP|RIGHT|DOWN|INSERT|DELETE))\\b" }, "mnky_commands": { "name": "keyword.other.commands.monkey", "match": "(?i)\\b(A(bstract|Cos|Sin|Tan|Tan2|bs|ccel(X|Y|Z)|dd(First|Last)|pp|rray)|B(ackwards|ool)|C(ase|eil|hannelState|l(amp|s)|o(mpare|nst|nt(ains|inue)|py|s|unt)|lear)|D(e(faultFlags|vice(Height|Width))|iscard|raw(Circle|Ellipse|Image|ImageRect|Line|Oval|Point|Poly|Rect|Text))|E(achin|xt(ends|ern)|nd|ndsWith|rror|xit)|F(alse|i(eld|nd|ndLast|rst)|loat(Map|Set)|loor|or(ever)|rames|romChar)|G(et|et(Alpha|Blend|Char|Color|Font|Matrix|Scissor)|lobal|rabImage)|H(andle(X|Y)|eight)|I(m(age|p(lements|ort))|n(clude|line|t(erface|Map|Set))|sEmpty)|Jo(in|y(Down|Hit|X|Y|Z))|Key|Key(Down|Hit|s)|L(ast|ength|ist|o(g|ad(Image|Sound|State|String)|cal))|M(ap|ax|ethod|i(llisecs|n)|o(d(ule)|use(Down|Hit|X|Y))|in)|N(ative|e(w|xt)|o(de)|ull)|O(bject(Enumerator)|n(Create|Loading|Render|Resume|Suspend|Update))|P(laySound|o(pMatrix|w)|r(i(nt|vate)|operty)|u(blic|shMatrix))|R(e(move|move(Each|First|Last)|p(eat|lace)|turn)|nd|otate)|S(aveState|cale|e(ed|lect|lf|t(Alpha|Blend|Channel(Pan|Rate|Volume)|Color|Font|Handle|Image|List|Matrix|Scissor|UpdateRate))|gn|h(l|r)|in|ound|plit|qrt|t(artsWith|ep|opChannel|ri(ct|ng(Map|Set)))|uper)|T(an|hen|o(Lower|Upper|uch(Down|Hit|X|Y))|r(ans(form|late)|im|ue))|Until|V(alue|alue(ForKey|s)|oid)|Width)\\b" }, "mnky_comment_block": { "name": "comment.block.rem.monkey", "begin": "(?i)(?\u003c=\\s|^|;)\\#rem\\b", "end": "(?i)(?\u003c=\\s|^|;)\\#end\\b", "patterns": [ { "include": "#mnky_url_content" } ] }, "mnky_comment_quote": { "name": "comment.line.apostrophe.monkey", "begin": "'", "end": "$", "patterns": [ { "include": "#mnky_url_content" } ] }, "mnky_constant": { "name": "constant.monkey", "match": "(?i)\\b(const)\\s+([a-zA-Z_]\\w*)\\b", "captures": { "1": { "name": "keyword.other.new.monkey" }, "2": { "name": "constant.monkey" } } }, "mnky_constants": { "name": "constants.monkey", "patterns": [ { "include": "#mnky_pi" }, { "include": "#mnky_boolean" }, { "include": "#mnky_numbers" }, { "include": "#mnky_joy" }, { "include": "#mnky_key" }, { "include": "#mnky_mouse" }, { "include": "#mnky_char" }, { "include": "#mnky_env" } ] }, "mnky_constructor": { "name": "call.constructor.monkey", "match": "(?i)\\b(new)\\s+([a-zA-Z_]\\w*)\\b", "captures": { "1": { "name": "keyword.other.new.monkey" }, "2": { "name": "storage.type.class.monkey" } } }, "mnky_control_keywords": { "name": "keyword.control.monkey", "match": "(?i)\\b(throw|return|exit|continue)\\b" }, "mnky_env": { "name": "constant.language.env.monkey", "match": "\\b(TARGET|LANG)\\b" }, "mnky_field": { "name": "variable.field.monkey", "match": "(?i)\\b(field)\\s+([a-zA-Z_]\\w*)+\\b", "captures": { "1": { "name": "keyword.other.variable.field.monkey" } } }, "mnky_function": { "name": "function.monkey", "begin": "(?i)\\b(function)\\s+([a-zA-Z_]\\w*)\\b", "end": "(?i)\\b(end(\\s?function)?)\\b", "patterns": [ { "include": "$self" } ], "beginCaptures": { "1": { "name": "storage.type.function.monkey" }, "2": { "name": "entity.name.function.monkey" } }, "endCaptures": { "1": { "name": "storage.type.function.monkey" } } }, "mnky_global_variable": { "name": "variable.monkey", "match": "(?i)\\b(global)\\s+([a-zA-Z_]\\w*)\\b", "captures": { "1": { "name": "storage.modifier.global.monkey" } } }, "mnky_joy": { "name": "constant.language.joy.monkey", "match": "\\bJOY_(A|B|X|Y|LB|RB|BACK|START|LEFT|UP|RIGHT|DOWN)\\b" }, "mnky_key": { "name": "constant.language.key.monkey", "match": "\\bKEY_(BACKSPACE|TAB|ENTER|ESCAPE|SPACE|SHIFT|CONTROL|PAGEUP|PAGEDOWN|END|HOME|LEFT|UP|RIGHT|DOWN|INSERT|DELETE|F([0-9]|1[0-2])|[0-9]|[A-Z]|TILDE|MINUS|EQUALS|OPENBRACKET|CLOSEBRACKET|BACKSLASH|SEMICOLON|QUOTES|COMMA|PERIOD|SLASH|(L|R|M)MB)|TOUCH([0-9]|[1-2][0-9]|3[0-2])\\b" }, "mnky_local_variable": { "name": "variable.monkey", "match": "(?i)\\b(local)\\s+([a-zA-Z_]\\w*)\\b", "captures": { "1": { "name": "keyword.other.variable.local.monkey" } } }, "mnky_method": { "name": "method.monkey", "begin": "(?i)\\b(method)\\s+([a-zA-Z_]\\w*)\\b", "end": "(?i)\\b(end(\\s?method)?)\\b", "patterns": [ { "include": "$self" } ], "beginCaptures": { "1": { "name": "storage.type.method.monkey" }, "2": { "name": "entity.name.method.monkey" } }, "endCaptures": { "1": { "name": "storage.type.method.monkey" } } }, "mnky_mouse": { "name": "constant.language.mouse.monkey", "match": "\\bMOUSE_(LEFT|RIGHT|MIDDLE)\\b" }, "mnky_null": { "name": "constant.language.null.monkey", "match": "(?i)\\bnull\\b" }, "mnky_numbers": { "patterns": [ { "name": "constant.numeric.integer.hexadecimal.monkey", "match": "(\\$[0-9a-fA-F]{1,16})" }, { "name": "constant.numeric.float.monkey", "match": "(?x) (?\u003c! \\$ ) (\n\t\t\t\t\t\t\t\\b ([0-9]+ \\. [0-9]+) |\n\t\t\t\t\t\t\t(\\. [0-9]+)\n\t\t\t\t\t\t)" }, { "name": "constant.numeric.integer.monkey", "match": "(?x)\\b(([0-9]+))" } ] }, "mnky_pi": { "name": "constant.language.monkey", "match": "\\b(HALF|TWO)?PI\\b" }, "mnky_string_content": { "patterns": [ { "name": "constant.character.escape.monkey", "match": "\\~[^\"]" }, { "include": "#mnky_url_content" } ] }, "mnky_string_quoted": { "name": "string.quoted.double.monkey", "begin": "\"", "end": "\"", "patterns": [ { "include": "#mnky_string_content" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.monkey" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.monkey" } } }, "mnky_typename": { "name": "typename.monkey", "match": "(?xi)(?: \\: \\s* ([a-zA-Z_]\\w*) | ([!#%]|@{1,2}|\\$[zw]?) )", "captures": { "1": { "name": "storage.type.monkey" }, "2": { "name": "storage.type.monkey" } } }, "mnky_types": { "name": "storage.type.monkey", "match": "(?i)\\b(array|bool|int|float|string)\\b" }, "mnky_url_content": { "name": "url.monkey", "match": "[a-zA-Z_]\\w*://[^ \"'()\\[\\]]*(?=$|\\b)" } } }