{ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "name": "Hebi", "scopeName": "source.hebi", "fileTypes": ["hebi"], "patterns": [ { "match": "\\b(?:(import)|(from))\\b", "captures": { "1": { "name": "keyword.control.import.hebi" }, "2": { "name": "keyword.control.import.from.hebi" } } }, { "match": "\\b(if|elif|else)\\b", "name": "keyword.control.conditional.hebi", "comment": "keywords that delimit flow conditionals" }, { "match": "\\b(for|while|loop)\\b", "name": "keyword.control.repeat.hebi", "comment": "keywords that delimit loops" }, { "match": "\\b(break|continue|pass|return|yield)\\b", "name": "keyword.control.statement.hebi", "comment": "keywords that alter flow from within a block" }, { "begin": "\\s*(class)\\s+(?=[a-zA-Z_][a-zA-Z0-9_]?)", "beginCaptures": { "1": { "name": "storage.type.class.hebi" } }, "end": "(\\s*\\:)", "name": "meta.class.hebi", "patterns": [ { "begin": "(?=[a-zA-Z_][a-zA-Z0-9_]*)", "contentName": "entity.name.type.class.hebi", "end": "(?![a-zA-Z0-9_])" } ] }, { "begin": "\\s*(fn)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\(", "beginCaptures": { "1": { "name": "storage.type.function.hebi" }, "2": { "name": "entity.name.function.hebi" } }, "end": "\\s*\\)\\s*\\:", "name": "meta.function.hebi", "patterns": [{ "include": "#expressions" }] }, { "match": "\\s*#[^\\n]*$\\n?", "name": "comment.line.hebi" }, { "include": "#expressions" } ], "repository": { "expressions": { "patterns": [ { "match": "\\b([0-9]+(\\.[0-9]+)?([Ee][+-]?[0-9]+)?)\\b", "name": "constant.numeric.float.hebi" }, { "match": "\\b([0-9][0-9_]*)\\b", "name": "constant.numeric.int.hebi" }, { "match": "\\b(as|print|self|super)\\b", "captures": { "1": { "name": "keyword.other.hebi" } }, "comment": "keywords that haven't fit into other groups." }, { "match": "\\b(none|true|false)\\b", "name": "constant.language.hebi" }, { "match": "(\\?\\?)|(\\|\\|)|(&&)|(\\!)|(\\?)", "name": "keyword.operator.logical.hebi" }, { "match": "\\b(is|in)\\b", "name": "keyword.operator.logical.hebi" }, { "match": "\\b([a-z_][a-zA-Z0-9_]*)\\s*(?=\\()", "name": "meta.function.call.hebi", "captures": { "1": { "name": "entity.name.function.hebi" } } }, { "match": "\\b([A-Z_][a-zA-Z0-9_]*)\\s*(?=\\()", "name": "meta.function.call.hebi", "captures": { "1": { "name": "entity.name.type.class.hebi" } } }, { "match": "\\b([a-z_][a-zA-Z0-9_]*)\\b", "name": "variable.other.hebi" }, { "match": "\\b([A-Z_][a-zA-Z0-9_]*)\\b", "name": "entity.name.type.class.hebi" }, { "match": "<|<\\=|>|>\\=|\\!\\=|\\=\\=", "name": "keyword.operator.comparison.hebi" }, { "match": ":\\=", "name": "keyword.operator.declaration.hebi" }, { "match": "\\=", "name": "keyword.operator.assignment.hebi" }, { "match": "\\+\\=|-\\=|\\*\\=|/\\=|%\\=|\\*\\*\\=|\\?\\?\\=", "name": "keyword.operator.assignment.compound.hebi" }, { "match": "(\\+)|(\\-)|(\\*)|(/)|(%)|(\\*\\*)", "name": "keyword.operator.arithmetic.hebi" }, { "match": "(\\.\\.)", "name": "keyword.operator.other.hebi" }, { "begin": "\"", "end": "\"", "name": "string.quoted.double.hebi", "patterns": [ { "name": "constant.character.escape.hebi", "match": "\\\\." } ] } ] } } }