From 552271b9e769755a6a4350962d76d239aaad1f4d Mon Sep 17 00:00:00 2001 From: Stuart Date: Thu, 12 Jan 2023 03:00:43 +1030 Subject: [PATCH] feat: added a whole loasd of syntax highlighting --- syntaxes/ccini.tmLanguage.json | 171 ++++++++++++++++++++++++++++++--- 1 file changed, 158 insertions(+), 13 deletions(-) diff --git a/syntaxes/ccini.tmLanguage.json b/syntaxes/ccini.tmLanguage.json index cdc11f0..7a619da 100644 --- a/syntaxes/ccini.tmLanguage.json +++ b/syntaxes/ccini.tmLanguage.json @@ -6,24 +6,32 @@ "include": "#comments" }, { - "include": "#operators" - }, - { - "include": "#keywords" + "include": "#assignments" } ], "repository": { "comments": { "patterns": [ { - "name": "comment.line", - "begin": "//", + "begin": "(^[ \\t]+)?(?=//)", "beginCaptures": { - "0": { - "name": "comment.line.double-slash" + "1": { + "name": "punctuation.whitespace.comment.leading.cpp" } }, - "end": "\\n" + "end": "(?!\\G)", + "patterns": [ + { + "begin": "//", + "beginCaptures": { + "0": { + "name": "comment.line.double-slash" + } + }, + "end": "\\n", + "name": "comment.line" + } + ] }, { "name": "comment.block", @@ -32,13 +40,150 @@ } ] }, - "operators:": { - "name": "keyword.operator", - "match": "(\\b=\\b)" + "assignments": { + "name": "", + "match": "^(\\t*)([[:alnum:]]*?)( = )(.*?)(\\n|\\Z)", + "captures": { + "2": { + "name": "keyword", + "patterns": [ + { + "include": "#keywords" + } + ] + }, + "3": { + "name": "keyword.operator" + }, + "4": { + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#modulePaths" + }, + { + "include": "#declarations" + }, + { + "include": "#numbers" + }, + { + "include": "#strings" + } + ] + } + } }, "keywords": { "name": "keyword", - "match": "^(\\s)*([A-Z][A-z0-9]*)\\b" + "match": "(Add[A-Z][A-z0-9]*)" + }, + "declarations": { + "name": "support.class", + "patterns": [ + { + "name": "support.class", + "match": "Vector$" + }, + { + "name": "support.class", + "match": "ContentFile$" + }, + { + "name": "support.class", + "match": "SpriteFile$" + }, + { + "name": "support.class", + "match": "AtomGroup$" + }, + { + "name": "support.class", + "match": "Atom$" + }, + { + "name": "support.class", + "match": "SoundContainer$" + }, + { + "name": "support.class", + "match": "Material$" + }, + { + "name": "support.class", + "match": "Color$" + }, + { + "name": "support.class", + "match": "Actor$" + }, + { + "name": "support.class", + "match": "MOSRotating$" + }, + { + "name": "support.class", + "match": "Gib$" + }, + { + "name": "support.class", + "match": "MOPixel$" + }, + { + "name": "support.class", + "match": "AEmitter$" + }, + { + "name": "support.class", + "match": "MOSParticle$" + }, + { + "name": "support.class", + "match": "Attachable$" + }, + { + "name": "support.class", + "match": "Wound$" + }, + { + "name": "support.class", + "match": "AHuman$" + }, + { + "name": "support.class", + "match": "ACraft$" + }, + { + "name": "support.class", + "match": "ACRocket$" + }, + { + "name": "support.class", + "match": "ACDropship$" + }, + { + "name": "support.class", + "match": "Arm$" + }, + { + "name": "support.class", + "match": "Leg$" + } + ] + }, + "modulePaths": { + "name": "markup.underline.link", + "match": "(([A-Z][A-z0-9]*\\.rte)(\\/[A-z0-9]*)*(\\/[A-z0-9]+\\.(wav|flac|png|bmp)))" + }, + "strings": { + "name": "string.unquoted", + "match": ".+?(?!=(\/\/|\n))" + }, + "numbers": { + "name": "constant.numeric", + "match": "^(-?[0-9]+\\.[0-9]+)|(-?[0-9]+)" } }, "scopeName": "source.ccini"