From 0c31ba96b4ff06008d45080b914ed05cbcaae7d4 Mon Sep 17 00:00:00 2001 From: Maryna Balioura Date: Sun, 15 Jun 2025 18:27:12 +0200 Subject: [PATCH] syntaxes: add grammar element PROPERTIES block Closes #21 --- syntaxes/sdoc.tmLanguage.json | 48 ++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/syntaxes/sdoc.tmLanguage.json b/syntaxes/sdoc.tmLanguage.json index 00c51fc..30a2886 100644 --- a/syntaxes/sdoc.tmLanguage.json +++ b/syntaxes/sdoc.tmLanguage.json @@ -346,9 +346,18 @@ } }, { - "match": "^\\s\\s(FIELDS|RELATIONS):$", + "match": "^\\s\\s(PROPERTIES|FIELDS|RELATIONS):$", "name": "keyword.control.sdoc" }, + { + "include": "#grammar_property_composite" + }, + { + "include": "#grammar_property_prefix" + }, + { + "include": "#grammar_property_view_style" + }, { "include": "#grammar_field_title" }, @@ -366,6 +375,43 @@ } ] }, + "grammar_property_composite": { + "patterns": [{ + "name": "", + "begin": "(^\\s\\s\\s\\sIS_COMPOSITE:)\\s", + "end": "$", + "beginCaptures": { + "1": { "name": "keyword.control.sdoc" } + }, + "patterns": [ + { + "include": "#choice_boolean" + } + ] + }] + }, + "grammar_property_prefix": { + "patterns": [ + { + "name": "keyword.control.sdoc", + "match": "(^\\s\\s\\s\\sPREFIX:)\\s\\b(\\S+)\\b$", + "captures": { + "1": { "name": "keyword.control.sdoc" }, + "2": { "name": "string.sdoc" } + } + } + ] + }, + "grammar_property_view_style": { + "patterns": [{ + "name": "", + "match": "(^\\s\\s\\s\\sVIEW_STYLE:)\\s\\b(Inline|Simple|Plain|Table|Zebra|Narrative)\\b$", + "captures": { + "1": { "name": "keyword.control.sdoc" }, + "2": { "name": "constant.numeric.sdoc" } + } + }] + }, "grammar_field_title": { "patterns": [{ "name": "",