{ "name": "MoonScript", "scopeName": "source.moonscript", "patterns": [ { "name": "comment.line.double-dash.lua", "match": "(--)(?!\\[\\[).*$\\n?", "captures": { "1": { "name": "punctuation.definition.comment.lua" } } }, { "name": "string.quoted.single.lua", "begin": "'", "end": "'", "patterns": [ { "name": "constant.character.escape.lua", "match": "\\\\(\\d{1,3}|.)" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.lua" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.lua" } } }, { "name": "string.quoted.double.lua", "begin": "\"", "end": "\"", "patterns": [ { "name": "constant.character.escape.lua", "match": "\\\\(\\d{1,3}|.)" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.lua" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.lua" } } }, { "name": "string.quoted.other.multiline.lua", "begin": "(?\u003c!--)\\[(=*)\\[", "end": "\\]\\1\\]", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.lua" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.lua" } } }, { "name": "constant.numeric.lua", "match": "(?\u003c![\\d.])\\s0x[a-fA-F\\d]+|\\b\\d+(\\.\\d+)?([eE]-?\\d+)?|\\.\\d+([eE]-?\\d+)?" }, { "name": "support.constant", "match": "\\b[A-Z]\\w*\\b(?!:)" }, { "name": "keyword.operator", "match": "=\u003e|-\u003e" }, { "name": "keyword.operator.lua", "match": "\\b(and|or|not)\\b" }, { "name": "entity.name.function", "match": "[a-zA-Z_]\\w*\\s*(?=:)" }, { "name": "entity.name.function", "match": "\\(|\\)" }, { "name": "keyword.operator.lua", "match": "\\+|-|%|#|\\*|\\/|\\^|==?|~=|!=|\\\\|:|,|;|\\.|\u003c=?|\u003e=?|(?\u003c!\\.)\\.{2}(?!\\.)" }, { "name": "storage.modifier", "match": "{|}|\\[|\\]" }, { "name": "storage.type.class", "match": "\\b(class|extends|super)\\b" }, { "name": "keyword.control", "match": "\\b(if|then|else|elseif|export|import|from|switch|when|with|using|do|for|in|while|return|local|unless|continue|break)\\b" }, { "name": "variable.language", "match": "\\b(self)\\b" }, { "name": "variable.parameter", "match": "@@?[a-zA-Z_]\\w*\\b" }, { "name": "constant.language.nil", "match": "\\b(nil)\\b" }, { "name": "constant.language.boolean", "match": "\\b(true|false)\\b" }, { "name": "invalid.illegal", "match": "(?\u003c!\\.|\\\\)\\b(function|repeat|end)\\b(?!\\s*:)" }, { "name": "support.function.lua", "match": "(?\u003c![^.]\\.|\\\\)\\b(assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|loadfile|loadstring|module|next|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\\b" }, { "name": "support.constant", "match": "(?\u003c![^.]\\.|\\\\)\\b(_G)\\b" }, { "name": "support.function.library.lua", "match": "(?\u003c![^.]\\.|\\\\)\\b(coroutine\\.(create|resume|running|status|wrap|yield)|string\\.(byte|char|dump|find|format|gmatch|gsub|len|lower|match|rep|reverse|sub|upper)|table\\.(concat|insert|maxn|remove|sort)|math\\.(abs|acos|asin|atan2?|ceil|cosh?|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pow|rad|random|randomseed|sinh?|sqrt|tanh?)|io\\.(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|os\\.(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\\.(cpath|loaded|loadlib|path|preload|seeall)|debug\\.(debug|[gs]etfenv|[gs]ethook|getinfo|[gs]etlocal|[gs]etmetatable|getregistry|[gs]etupvalue|traceback))\\b" } ] }