{ "$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|defer)\\b" }, { "name": "keyword.declaration.zc", "match": "\\b(fn|let|struct|type|typedef|enum|const|enhance|micro|vm)\\b" }, { "name": "keyword.other.zc", "match": "\\b(as|unchecked|unbounded|asm|quote|sizeof|typeof|len|cap|push|pop|resize|o3|include|embed|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": "->|\\." } ] } } }