Luce packages
LuceLuce BaseLuciaOS

dymokomi/luced-3d

Source of release 0.11.6

0.11.6 / src / code_grammar.luc

## Generated by tools/code_grammar.py from luced's grammars/luce.tmLanguage.json:
## the Luce TextMate grammar the Code node highlights its snippets with.

## The Luce grammar's JSON.
pub func luce_grammar() -> str:
    return "{\n  \"name\": \"Luce\",\n  \"scopeName\": \"source.luce\",\n  \"fileTypes\": [\"luc\", \"lucb\"],\n  \"patterns\": [\n    { \"include\": \"#comment\" },\n    { \"include\": \"#string\" },\n    { \"include\": \"#number\" },\n    { \"include\": \"#constant\" },\n    { \"include\": \"#keyword\" },\n    { \"include\": \"#builtin-type\" },\n    { \"include\": \"#type-name\" },\n    { \"include\": \"#function-call\" }\n  ],\n  \"repository\": {\n    \"comment\": {\n      \"patterns\": [\n        { \"match\": \"^\\\\s*#\\\\s*mark:.*$\", \"name\": \"comment.section.luce\" },\n        { \"match\": \"#.*$\", \"name\": \"comment.line.number-sign.luce\" }\n      ]\n    },\n    \"string\": {\n      \"patterns\": [\n        {\n          \"begin\": \"[rbf]?\\\"\\\"\\\"\",\n          \"end\": \"\\\"\\\"\\\"\",\n          \"name\": \"string.quoted.triple.double.luce\",\n          \"patterns\": [{ \"match\": \"\\\\\\\\.\" , \"name\": \"constant.character.escape.luce\" }]\n        },\n        {\n          \"begin\": \"[rbf]?'''\",\n          \"end\": \"'''\",\n          \"name\": \"string.quoted.triple.single.luce\",\n          \"patterns\": [{ \"match\": \"\\\\\\\\.\", \"name\": \"constant.character.escape.luce\" }]\n        },\n        {\n          \"begin\": \"[rbf]?\\\"\",\n          \"end\": \"\\\"\",\n          \"name\": \"string.quoted.double.luce\",\n          \"patterns\": [{ \"match\": \"\\\\\\\\.\", \"name\": \"constant.character.escape.luce\" }]\n        },\n        {\n          \"begin\": \"[rbf]?'\",\n          \"end\": \"'\",\n          \"name\": \"string.quoted.single.luce\",\n          \"patterns\": [{ \"match\": \"\\\\\\\\.\", \"name\": \"constant.character.escape.luce\" }]\n        }\n      ]\n    },\n    \"number\": {\n      \"match\": \"\\\\b(0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|[0-9][0-9_]*(\\\\.[0-9_]+)?([eE][+-]?[0-9]+)?)\\\\b\",\n      \"name\": \"constant.numeric.luce\"\n    },\n    \"constant\": {\n      \"match\": \"\\\\b(true|false|none)\\\\b\",\n      \"name\": \"constant.language.luce\"\n    },\n    \"keyword\": {\n      \"match\": \"\\\\b(and|as|break|catch|class|const|continue|defer|elif|else|enum|errdefer|extern|for|from|func|if|import|in|init|interface|is|let|match|mutating|new|not|or|pub|recover|return|self|spawn|static|struct|test|try|type|var|wait|while|with|alloc|free|discard)\\\\b\",\n      \"name\": \"keyword.control.luce\"\n    },\n    \"builtin-type\": {\n      \"match\": \"\\\\b(int|float|bool|str|bytes|unit|never|list|map|set|Error|ErrorCode|Weak|task|char|i8|i16|i32|i64|u8|u16|u32|u64|usize|isize|f32|f64|void)\\\\b\",\n      \"name\": \"storage.type.luce\"\n    },\n    \"type-name\": {\n      \"match\": \"\\\\b[A-Z][A-Za-z0-9_]*\\\\b\",\n      \"name\": \"entity.name.type.luce\"\n    },\n    \"function-call\": {\n      \"match\": \"\\\\b([a-z_][A-Za-z0-9_]*)\\\\s*(?=\\\\()\",\n      \"name\": \"entity.name.function.luce\"\n    }\n  }\n}\n"