{ "name": "Pony", "scopeName": "source.pony", "patterns": [ { "include": "#block-comments" }, { "include": "#line-comments" }, { "include": "#typedeclarations" }, { "include": "#methoddeclarations" }, { "include": "#keywords" }, { "include": "#constants" }, { "include": "#identifiers" }, { "include": "#strings" } ], "repository": { "block-comments": { "name": "comment.block.pony", "begin": "/\\*", "end": "\\*/", "patterns": [ { "include": "#block-comments" } ] }, "constants": { "patterns": [ { "name": "constant.other.pony", "match": "\\b(this)\\b" }, { "name": "constant.language.pony", "match": "\\b(true|false)\\b" }, { "name": "constant.numeric.pony", "match": "\\b((0b[0-1_]*)|(0x[0-9a-fA-F_]*)|([0-9][0-9_]*(\\.[0-9][0-9_]*)?((e|E)(\\+|-)?[0-9_]+)?))\\b" } ] }, "identifiers": { "patterns": [ { "match": "\\b([_a-z][_a-zA-Z0-9]*)\\b(\\(|\\[)", "captures": { "1": { "name": "support.function.pony" } } }, { "match": "\\.\\s*([_a-z][_a-zA-Z0-9]*)\\b[^\\(\\[]", "captures": { "1": { "name": "variable.parameter.pony" } } }, { "match": "@\\s*([_a-zA-z][_a-zA-Z0-9]*)\\s*(\\(|\\[)", "captures": { "1": { "name": "support.function.pony" } } }, { "name": "entity.name.class.pony", "match": "\\b(_*[A-Z][_a-zA-Z0-9]*)\\b" }, { "match": "\\b(_*[a-z][_a-zA-Z0-9']*)" } ] }, "keywords": { "patterns": [ { "name": "keyword.other.intrinsic.pony", "match": "\\b(compile_intrinsic|compile_error)\\b" }, { "name": "keyword.other.import.pony", "match": "\\b(use)\\b" }, { "name": "keyword.other.declaration.pony", "match": "\\b(var|let|embed|delegate)\\b" }, { "name": "entity.other.attribute-name.pony", "match": "\\b(iso|trn|ref|val|box|tag)\\b" }, { "name": "keyword.control.jump.pony", "match": "\\b(break|continue|return|error)\\b" }, { "name": "keyword.control.pony", "match": "\\b(if|ifdef|then|elseif|else|end|match|where|try|with|as|recover|consume|object|digestof)\\b" }, { "name": "keyword.control.loop.pony", "match": "\\b(while|do|repeat|until|for|in)\\b" }, { "match": "(\\?|[-=]\u003e)" }, { "match": "(\\-|\\+|\\*|/(?![/*])|%|\u003c\u003c|\u003e\u003e)" }, { "match": "(==|!=|\u003c=|\u003e=|\u003c|\u003e)" }, { "match": "\\b(is|isnt|not|and|or|xor)\\b" }, { "match": "=" }, { "match": "(\\||\\\u0026|\\,|\\^)" } ] }, "line-comments": { "name": "comment.line.double-slash.pony", "begin": "//", "end": "\\n" }, "methoddeclarations": { "match": "\\b(new|be|fun)\\s+(iso|trn|ref|val|box|tag)?\\b\\s*([_a-z][_a-zA-Z0-9]*)", "captures": { "1": { "name": "keyword.declaration.pony" }, "2": { "name": "keyword.other.capability.pony" }, "3": { "name": "entity.name.function.pony" } } }, "strings": { "patterns": [ { "name": "constant.character.pony", "begin": "'", "end": "'", "patterns": [ { "name": "constant.character.escape.pony", "match": "\\\\(?:[abfnrtv\\\\\"0]|x[0-9A-Fa-f]{2})" }, { "name": "invalid.illegal.pony", "match": "\\\\." } ], "beginCaptures": { "0": { "name": "punctuation.definition.character.begin.pony" } }, "endCaptures": { "0": { "name": "punctuation.definition.character.end.pony" } } }, { "name": "variable.parameter.pony", "begin": "\"\"\"", "end": "\"\"\"(?!\")", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.pony" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.pony" } } }, { "name": "string.quoted.double.pony", "begin": "\"", "end": "\"", "patterns": [ { "name": "constant.string.escape.pony", "match": "\\\\(?:[abfnrtv\\\\\"0]|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{6})" }, { "name": "invalid.illegal.pony", "match": "\\\\." } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.pony" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.pony" } } } ] }, "typedeclarations": { "match": "\\b(type|interface|trait|primitive|struct|class|actor)\\s+(iso|trn|ref|val|box|tag)?@?\\s*([_A-Z][_a-zA-Z0-9]*)", "captures": { "1": { "name": "keyword.declaration.pony" }, "2": { "name": "keyword.other.capability.pony" }, "3": { "name": "entity.name.type.pony" } } } } }