diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-27 14:00:49 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-27 14:00:49 +0000 |
| commit | 5d37ebcc02f6ca2ce1ced93f803dd1daf634d866 (patch) | |
| tree | 4c955f89e1f43aefe66064e34e547625eba3bc1b /plugin/syntaxes/cie-pseudocode.tmLanguage.json | |
| parent | 3d7d1d7cf8685f0d9230cd89d06017869da1c6d8 (diff) | |
feat(editor): support PP directives in VS Code and Bundle
Share preprocessor highlighting through the existing grammar, keep conditional
blocks at the ordinary indentation depth, and exercise switches in Bundle's
native runner test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'plugin/syntaxes/cie-pseudocode.tmLanguage.json')
| -rw-r--r-- | plugin/syntaxes/cie-pseudocode.tmLanguage.json | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/plugin/syntaxes/cie-pseudocode.tmLanguage.json b/plugin/syntaxes/cie-pseudocode.tmLanguage.json index 16a4ac4..14ef33c 100644 --- a/plugin/syntaxes/cie-pseudocode.tmLanguage.json +++ b/plugin/syntaxes/cie-pseudocode.tmLanguage.json @@ -418,6 +418,9 @@ "include": "#strings" }, { + "include": "#preprocessor" + }, + { "include": "#class" }, { @@ -442,17 +445,6 @@ "include": "#return_type" }, { - "match": "^\\s*(#)(LIB)\\s*$", - "captures": { - "1": { - "name": "punctuation.definition.directive.cpp" - }, - "2": { - "name": "keyword.control.directive.pragma.cpp" - } - } - }, - { "match": "(?<!\\w)(?:CASE|ENDCASE)(?!\\w)", "name": "keyword.control.switch.cpp" }, @@ -599,6 +591,34 @@ "include": "#type_tokens" } ] + }, + "preprocessor": { + "begin": "^\\s*(?:(PP_DEFINE)|(PP_UNDEF)|(PP_IFDEF|PP_IFNDEF)|(PP_ENDIF))\\b", + "end": "$", + "beginCaptures": { + "1": { + "name": "keyword.control.directive.define.cpp" + }, + "2": { + "name": "keyword.control.directive.undef.cpp" + }, + "3": { + "name": "keyword.control.directive.conditional.cpp" + }, + "4": { + "name": "keyword.control.directive.conditional.cpp" + } + }, + "name": "meta.preprocessor.cie-pseudocode", + "patterns": [ + { + "include": "#line_comment" + }, + { + "match": "[A-Za-z_][A-Za-z0-9_]*", + "name": "entity.name.function.preprocessor.cpp" + } + ] } }, "injections": { |
