diff --git a/ivy.vscode/ivy/ivy.tmLanguage.json b/ivy.vscode/ivy/ivy.tmLanguage.json index 0da1593..40dd947 100644 --- a/ivy.vscode/ivy/ivy.tmLanguage.json +++ b/ivy.vscode/ivy/ivy.tmLanguage.json @@ -2,28 +2,115 @@ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "name": "Ivy", "patterns": [ + { + "include": "#comment" + }, + { + "include": "#const" + }, + { + "include": "#ident" + }, { "include": "#keywords" }, { "include": "#strings" + }, + { + "include": "#class" } ], "repository": { - "keywords": { - "patterns": [{ - "name": "keyword.control.ivy", - "match": "\\b(if|while|for|return)\\b" - }] - }, - "strings": { - "name": "string.quoted.double.ivy", - "begin": "\"", - "end": "\"", + "ident": { "patterns": [ { - "name": "constant.character.escape.ivy", - "match": "\\\\." + "name": "variable.parameter.ivy", + "match": "\\b[a-z]([A-Za-z0-9_]+):\\b" + }, + { + "name": "entity.name.type.ivy", + "match": "\\[A-Z]{1,2}([a-z0-9]+[A-Z]{0,2})*\\b" + } + ] + }, + "const": { + "patterns": [ + { + "name": "constant.numeric.ivy", + "match": "[\\b\\s]#[a-z0-9]*[\\b\\s]" + } + ] + }, + "keywords": { + "patterns": [ + { + "name": "keyword.control.ivy", + "match": "\\b(for|while|break|continue|if|elif|else|unless|match)[^:]\\b" + }, + { + "name": "keyword.control.ivy", + "match": "\\b(for|while|break|continue|if|elif|else|unless|match)[^:]\\b" + }, + { + "name": "storage.type.ivy", + "match": "\\b(class|protocol)[^:]\\b" + }, + { + "name": "keyword.other.ivy", + "match": "\\b(package|use|in)[^:]\\b" + }, + { + "name": "keyword.other.ivy", + "match": "\\b(package|use|in)[^:]\\b" + } + ] + }, + "strings": { + "patterns": [ + { + "name": "string.quoted.single.ivy", + "begin": "'", + "end": "'", + "patterns": [ + { + "name": "constant.character.escape.ivy", + "match": "\\\\." + } + ] + }, + { + "name": "string.quoted.double.ivy", + "begin": "\"", + "end": "\"", + "patterns": [ + { + "name": "constant.character.escape.ivy", + "match": "\\\\." + } + ] + } + ] + }, + "comment": { + "patterns": [ + { + "name": "comment.block.ivy", + "begin": "/\\*", + "end": "\\*/" + }, + { + "name": "comment.line", + "begin": "--", + "end": "\\n" + } + ] + }, + "class": { + "patterns": [ + { + "name": "entity.name.function.ivy", + "match": "\\b(?<=- )[a-z][A-Za-z0-9_]*" } ] }