From d6941c3dbdfd7ff1d5ff1819a2d5813b8c9f37f9 Mon Sep 17 00:00:00 2001 From: Markos Girgis Date: Thu, 13 Oct 2022 18:55:14 +0300 Subject: [PATCH] Add operators, reserved words and so on --- syntaxes/bitloops.tmLanguage.json | 140 ++++++++++++++++++++---------- 1 file changed, 95 insertions(+), 45 deletions(-) diff --git a/syntaxes/bitloops.tmLanguage.json b/syntaxes/bitloops.tmLanguage.json index 456ba54..3086aef 100644 --- a/syntaxes/bitloops.tmLanguage.json +++ b/syntaxes/bitloops.tmLanguage.json @@ -1,53 +1,103 @@ { - "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", - "name": "Bitloops", - "patterns": [ - { - "include": "#keywords" - }, + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "Bitloops", + "patterns": [ { - "include": "#numeric" - }, - { - "include": "#strings" - }, + "include": "#keywords" + }, + { + "include": "#numeric" + }, + { + "include": "#strings" + }, + { + "include": "#storage" + }, { - "include": "#comments" - }, + "include": "#variables" + }, + { + "include": "#comments" + }, { - "include": "#bitloopsClasses" - }, + "include": "#bitloopsClasses" + }, { - "include": "#myClasses" - } - ], - "repository": { - "keywords": { - "patterns": [{ - "name": "keyword.control.bitloops", - "match": "\\b(const|let|continue|break|return|concretes|implements|extends)\\b" - }] - }, + "include": "#myClasses" + } + ], + "repository": { + "keywords": { + "patterns": [ + { + "name": "keyword.control.bitloops", + "match": "\\b(const|let|continue|break|return|concretes|implements|extends|if|isBrokenIf)\\b" + }, + { + "name": "keyword.operator.comparison.bitloops", + "match": "==|!=" + }, + { + "name": "keyword.operator.relational.bitloops", + "match": "<=|>=|<|>" + }, + { + "name": "keyword.operator.logical.bitloops", + "match": "NOT|OR|AND" + }, + { + "name": "keyword.operator.arithmetic.bitloops", + "match": "%|\\*|/|-|\\+" + } + ] + }, "numeric": { - "patterns": [{ - "name": "constant.numeric.bitloops", - "match": "\\b(0x[0-9a-fA-F]+|0b[01]+|\\d+)\\b" - }] + "patterns": [ + { + "name": "constant.numeric.bitloops", + "match": "\\b(0x[0-9a-fA-F]+|0b[01]+|\\d+)\\b" + } + ] }, "bitloopsClasses": { - "patterns": [{ - "name": "keyword.control.templateClass.bitloops", - "match": "\\b(Config|(REST\\.Methods)|REST|DTO|UseCase|Aggregate|Entity|OK|Errors|ValueObject|Props|RESTController|RESTRouter|GraphQLController|Feature|Mapper|RepoPort|RepoAdapter|PackagePort|PackageAdapter|ApplicationErrors|DomainErrors|DomainError|ApplicationError)\\b" - }] - }, + "patterns": [ + { + "name": "keyword.control.templateClass.bitloops", + "match": "\\b(Config|(REST\\.Methods)|REST|DTO|UseCase|Root|Entity|Rule|OK|Errors|ValueObject|Props|RESTController|RESTRouter|GraphQLController|Feature|Mapper|RepoPort|RepoAdapter|PackagePort|PackageAdapter|ApplicationErrors|DomainErrors|DomainError|ApplicationError)\\b" + } + ] + }, "myClasses": { - "patterns": [{ - "name": "entity.name.class.bitloops", - "match": "\\b[A-Z]+[a-zA-Z0-9]*(DTO|UseCase|Aggregate|VO|Entity|Error|Controller|Router|Feature|Mapper|RepoPort|RepoAdapter|PackagePort|PackageAdapter|Error)\\b" - }] - }, - "strings": { - "patterns": [ + "patterns": [ + { + "name": "entity.name.class.bitloops", + "match": "\\b[A-Z]+[a-zA-Z0-9]*(DTO|UseCase|Aggregate|VO|Entity|Error|Controller|Router|Feature|Mapper|RepoPort|RepoAdapter|PackagePort|PackageAdapter|Error)\\b" + } + ] + }, + "storage": { + "patterns": [ + { + "name": "storage.type.bitloops", + "match": "\\b(double|float|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string|bytes|timestamp)\\b" + }, + { + "name": "storage.modifier.bitloops", + "match": "\\b(optional|required|public|private)\\b" + } + ] + }, + "variables": { + "patterns": [ + { + "name": "variable.language.bitloops", + "match": "\\b(this)\\b" + } + ] + }, + "strings": { + "patterns": [ { "name": "string.quoted.double.bitloops", "begin": "\"", @@ -64,7 +114,7 @@ "end": "`" } ] - }, + }, "comments": { "patterns": [ { @@ -78,6 +128,6 @@ } ] } - }, - "scopeName": "source.bitloops" -} \ No newline at end of file + }, + "scopeName": "source.bitloops" +}