aboutsummaryrefslogtreecommitdiff
path: root/editors/vscode/syntaxes
diff options
context:
space:
mode:
authorGravatar Moon Flower <moonflower@elhenney.local> 2026-10-12 08:46:23 +0330
committerGravatar Moon Flower <moonflower@elhenney.local> 2026-10-12 08:46:23 +0330
commitecc350ca5c2eb50be8309c5f14f8bf0d87db9a02 (patch)
tree70e0af76a1b13affff7c6cc8aac7b3e6ef960478 /editors/vscode/syntaxes
a
Diffstat (limited to 'editors/vscode/syntaxes')
-rw-r--r--editors/vscode/syntaxes/zc.tmLanguage.json175
1 files changed, 175 insertions, 0 deletions
diff --git a/editors/vscode/syntaxes/zc.tmLanguage.json b/editors/vscode/syntaxes/zc.tmLanguage.json
new file mode 100644
index 0000000..49f7b37
--- /dev/null
+++ b/editors/vscode/syntaxes/zc.tmLanguage.json
@@ -0,0 +1,175 @@
+{
+ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
+ "name": "ZC",
+ "scopeName": "source.zc",
+ "patterns": [
+ { "include": "#comments" },
+ { "include": "#strings" },
+ { "include": "#numbers" },
+ { "include": "#ownership" },
+ { "include": "#keywords" },
+ { "include": "#types" },
+ { "include": "#builtins" },
+ { "include": "#constants" },
+ { "include": "#function-declarations" },
+ { "include": "#function-calls" },
+ { "include": "#operators" }
+ ],
+ "repository": {
+ "comments": {
+ "patterns": [
+ {
+ "name": "comment.line.double-slash.zc",
+ "match": "//.*$"
+ },
+ {
+ "name": "comment.block.zc",
+ "begin": "/\\*",
+ "end": "\\*/"
+ }
+ ]
+ },
+ "strings": {
+ "patterns": [
+ {
+ "name": "string.quoted.double.byte.zc",
+ "begin": "b\"",
+ "end": "\"",
+ "patterns": [{ "name": "constant.character.escape.zc", "match": "\\\\." }]
+ },
+ {
+ "name": "string.quoted.double.zc",
+ "begin": "\"",
+ "end": "\"",
+ "patterns": [{ "name": "constant.character.escape.zc", "match": "\\\\." }]
+ },
+ {
+ "name": "string.quoted.single.zc",
+ "begin": "'",
+ "end": "'",
+ "patterns": [{ "name": "constant.character.escape.zc", "match": "\\\\." }]
+ }
+ ]
+ },
+ "numbers": {
+ "patterns": [
+ {
+ "name": "constant.numeric.hex.zc",
+ "match": "\\b0[xX][0-9a-fA-F]+\\b"
+ },
+ {
+ "name": "constant.numeric.float.zc",
+ "match": "\\b[0-9]+\\.[0-9]+([eE][+-]?[0-9]+)?\\b|\\b[0-9]+[eE][+-]?[0-9]+\\b"
+ },
+ {
+ "name": "constant.numeric.decimal.zc",
+ "match": "\\b[0-9]+\\b"
+ }
+ ]
+ },
+ "ownership": {
+ "patterns": [
+ {
+ "name": "storage.modifier.lifetime.tag.zc",
+ "match": "\\.(u|m|d)\\b"
+ },
+ {
+ "name": "keyword.operator.lifetime.recast.zc",
+ "match": "\\b(u|m|d)\\*(?=[a-zA-Z_])"
+ }
+ ]
+ },
+ "keywords": {
+ "patterns": [
+ {
+ "name": "keyword.control.zc",
+ "match": "\\b(if|else|while|do|for|switch|case|default|break|continue|return)\\b"
+ },
+ {
+ "name": "keyword.declaration.zc",
+ "match": "\\b(fn|let|struct|type|enum|const|enhance|micro|vm)\\b"
+ },
+ {
+ "name": "keyword.other.zc",
+ "match": "\\b(as|unchecked|asm|quote|sizeof|typeof|len|cap|push|pop|resize|o3|include|memdebug|fixed|typecheck)\\b"
+ },
+ {
+ "name": "keyword.operator.memory.zc",
+ "match": "\\b(new|free)\\b"
+ }
+ ]
+ },
+ "types": {
+ "patterns": [
+ {
+ "name": "storage.type.primitive.zc",
+ "match": "\\b(int|char|word|bool|void|float)\\b"
+ }
+ ]
+ },
+ "builtins": {
+ "patterns": [
+ {
+ "name": "support.function.builtin.zc",
+ "match": "\\b(putc|getc|eof|halt|puts|putn|strlen|streq|wcopy|wfill|new_t|new_raw|new_oz|recycle|gc|isobj|osize|typeof_obj|live_objects|install|zdiv|zmod|zshl|mem_set|memreport|checkptr|syscall|readfile|bopen|bread|bwrite|bgetenv|ld8|st8|ld16|st16|ld32|st32|slen|sbyte|snew|sput|scat|sslice|bputs|ston|ntos|atoi|itoa|strcat|starts|env|now|writefile)\\b"
+ }
+ ]
+ },
+ "constants": {
+ "patterns": [
+ {
+ "name": "support.constant.builtin.zc",
+ "match": "\\b(MW|HEAP_LO|HEAP_HI|ZFP|GORG|FBOT|FTOP|RS0|DSLO|DSHI|SYSGATE|MAGIC|SYS_OPEN|SYS_CLOSE|SYS_READ|SYS_WRITE|SYS_GETENV|SYS_TIME)\\b"
+ }
+ ]
+ },
+ "function-declarations": {
+ "patterns": [
+ {
+ "match": "\\bfn\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\(",
+ "captures": {
+ "1": { "name": "entity.name.function.zc" }
+ }
+ }
+ ]
+ },
+ "function-calls": {
+ "patterns": [
+ {
+ "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\(",
+ "captures": {
+ "1": { "name": "entity.name.function.call.zc" }
+ }
+ }
+ ]
+ },
+ "operators": {
+ "patterns": [
+ {
+ "name": "keyword.operator.comparison.zc",
+ "match": "==|!=|<=|>=|<|>"
+ },
+ {
+ "name": "keyword.operator.logical.zc",
+ "match": "&&|\\|\\||!"
+ },
+ {
+ "name": "keyword.operator.arithmetic.zc",
+ "match": "\\+|-|\\*|/|%|\\+\\+|--"
+ },
+ {
+ "name": "keyword.operator.bitwise.zc",
+ "match": "&|\\||\\^|~|<<|>>"
+ },
+ {
+ "name": "keyword.operator.assignment.zc",
+ "match": "=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>="
+ },
+ {
+ "name": "keyword.operator.member.zc",
+ "match": "->|\\."
+ }
+ ]
+ }
+ }
+}