diff --git a/angel_vscode/package.json b/angel_vscode/package.json index dceaa425..b4bc80ca 100644 --- a/angel_vscode/package.json +++ b/angel_vscode/package.json @@ -33,6 +33,25 @@ "title": "Hello World" } ], + "languages": [ + { + "id": "jael", + "aliases": [ + "Jael" + ], + "extensions": [ + ".jael" + ], + "configuration": "./syntaxes/jael-language-configuration.json" + } + ], + "grammars": [ + { + "language": "jael", + "scopeName": "source.jael", + "path": "./syntaxes/jael.json" + } + ], "snippets": [ { "language": "dart", diff --git a/angel_vscode/syntaxes/jael-language-configuration.json b/angel_vscode/syntaxes/jael-language-configuration.json new file mode 100644 index 00000000..0f428e09 --- /dev/null +++ b/angel_vscode/syntaxes/jael-language-configuration.json @@ -0,0 +1,28 @@ +{ + "attribution-notice": { + "author-of-most-of-this-file": "Danny Tuppeny", + "source": "https://github.com/Dart-Code/Dart-Code/blob/master/syntaxes/dart.json" + }, + "comments": { + "blockComment": [""] + }, + "brackets": [["{", "}"], ["[", "]"], ["(", ")"], ["<", ">"]], + "autoClosingPairs": [ + { "open": "{", "close": "}" }, + { "open": "[", "close": "]" }, + { "open": "(", "close": ")" }, + { "open": "'", "close": "'", "notIn": ["string", "comment"] }, + { "open": "\"", "close": "\"", "notIn": ["string"] }, + { "open": "`", "close": "`", "notIn": ["string", "comment"] }, + { "open": "/**", "close": " */", "notIn": ["string"] } + ], + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["<", ">"], + ["'", "'"], + ["\"", "\""], + ["`", "`"] + ] +} diff --git a/angel_vscode/syntaxes/jael.json b/angel_vscode/syntaxes/jael.json new file mode 100644 index 00000000..02856a68 --- /dev/null +++ b/angel_vscode/syntaxes/jael.json @@ -0,0 +1,126 @@ +{ + "fileTypes": ["jael"], + "name": "Jael", + "scopeName": "source.jael", + "patterns": [ + { + "include": "#expressions" + }, + { + "match": "[:,\\.]", + "name": "punctuation.jael" + }, + { + "begin": "{{-?", + "end": "}}", + "beginCaptures": { + "0": { + "name": "comment.jael" + } + }, + "endCaptures": { + "0": { + "name": "comment.jael" + } + }, + "patterns": [{ "include": "#expressions" }, { "include": "#operators" }] + }, + { + "match": "\\b(block|declare|for-each|extend|if|include|switch)\\b", + "name": "keyword.control.jael" + }, + { + "match": "<\\s*/?\\s*([A-Za-z_][A-Za-z0-9_]*)\\b", + "captures": { + "1": { + "name": "keyword.tag.jael" + } + } + }, + { + "match": "@[A-Za-z_][A-Za-z0-9_]*", + "name": "storage.argument.jael" + }, + { + "match": "\\b(@?[A-Za-z_][A-Za-z0-9_]*)=", + "captures": { + "1": { + "name": "storage.name.jael" + } + } + }, + { + "captures": { + "0": { + "name": "punctuation.definition.comment.jael" + } + }, + "begin": "", + "name": "comment.jael" + }, + { + "include": "#operators" + } + ], + "repository": { + "operators": { + "patterns": [ + { + "match": "((!?=)|\\+|\\*|-|/|\\?|(\\?\\.)|%|\\[|\\])", + "name": "keyword.operator.jael" + } + ] + }, + "expressions": { + "patterns": [ + { + "match": "\\b[<>]\\b", + "name": "keyword.operator.jael" + }, + { + "begin": "'", + "end": "'", + "name": "string.quoted.single.jael", + "patterns": [ + { + "name": "constant.character.escape.jael", + "match": "\\\\[bfnrt']" + } + ] + }, + { + "begin": "\"", + "end": "\"", + "name": "string.quoted.double.jael", + "patterns": [ + { + "name": "constant.character.escape.jael", + "match": "\\\\[bfnrt\"]" + } + ] + }, + { + "match": "\\b(true|false|null)\\b", + "name": "constant.language.jael" + }, + { + "match": "\\b-?[0-9]+(\\.[0-9]+)?([Ee][0-9]+)?\\b", + "name": "constant.numeric.jael" + }, + { + "match": "\\b0x[A-Fa-f0-9]+\\b", + "name": "constant.numeric.jael" + }, + { + "match": "([A-Za-z_][A-Za-z0-9_]*)\\s*\\(", + "captures": { + "1": { + "name": "entity.name.function.jael" + } + } + } + ] + } + } +}