{ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "name": "ldraw", "patterns": [ { "include": "#commands" }, { "include": "#keywords" }, { "include": "#meta" }, { "include": "#nofile" }, { "include": "#fileblocks" }, { "include": "#linetype1" }, { "include": "#linetype2" }, { "include": "#linetype3" }, { "include": "#linetype45" }, { "include": "#strings" }, { "include": "#numbers" }, { "include": "#hexnumbers" }, { "include": "#comments" } ], "repository": { "commands": { "patterns": [{ "name": "keyword.control.ldraw", "match": "\\b(MODEL|TITLE|STEP|WRITE|CLEAR|PAUSE|SAVE|COMMENT|PART|LINE|TRIANGLE|QUADRILATERAL|CONDITIONAL-LINE)\\b" }] }, "keywords": { "patterns": [{ "name": "keyword.control.ldraw", "match": "\\b(BFC|ROTATION|ROTSTEP|GROUP|BUFEXCHG|SYNTH|BEGIN|END)\\b" }] }, "meta": { "patterns": [ { "match": "^\\s*([0])\\s?(!\\w+)\\s?", "captures": { "1": { "name": "constant.numeric.ldraw" }, "2": { "name": "support.function.ldraw" } } } ] }, "nofile": { "patterns": [{ "match": "^\\s*([0])\\s?(NOFILE)\\s?", "captures": { "1":{ "name": "constant.numeric.ldraw" }, "2":{ "name": "variable.language.ldraw" } } }] }, "fileblocks": { "patterns": [{ "match": "^\\s*([0])\\s?(FILE)\\s?(.+)", "captures": { "1":{ "name": "constant.numeric.ldraw" }, "2":{ "name": "variable.language.ldraw" }, "3":{ "name": "string.other.ldraw" } } }] }, "linetype1": { "patterns": [ { "match": "^\\s*([1])\\s?(\\d+)\\s?(([-.eE0-9]+\\s*){3})\\s?(([-.eE0-9]+\\s*){3})\\s?(([-.eE0-9]+\\s*){3})\\s?(([-.eE0-9]+\\s*){3})\\s?(.+)", "captures": { "1": { "name": "constant.numeric.ldraw" }, "2": { "name": "string.other.ldraw" }, "5": { "name": "constant.numeric.ldraw" }, "9": { "name": "constant.numeric.ldraw" }, "11": { "name": "string.other.ldraw" } } } ] }, "linetype2": { "patterns": [ { "match": "^\\s*([2])\\s?(\\d+)\\s?(([-.eE0-9]+\\s*){3})\\s?(([-.eE0-9]+\\s*){3})", "captures": { "1": { "name": "constant.numeric.ldraw" }, "2": { "name": "string.other.ldraw" }, "5": { "name": "constant.numeric.ldraw" } } } ] }, "linetype3": { "patterns": [ { "match": "^\\s*([3])\\s?(\\d+)\\s?(([-.eE0-9]+\\s*){3})\\s?(([-.eE0-9]+\\s*){3})\\s?(([-.eE0-9]+\\s*){3})", "captures": { "1": { "name": "constant.numeric.ldraw" }, "2": { "name": "string.other.ldraw" }, "5": { "name": "constant.numeric.ldraw" } } } ] }, "linetype45": { "patterns": [{ "match": "^\\s*([4-5])\\s?(\\d+)\\s?(([-.eE0-9]+\\s*){3})\\s?(([-.eE0-9]+\\s*){3})\\s?(([-.eE0-9]+\\s*){3})\\s?(([-.eE0-9]+\\s*){3})", "captures": { "1":{ "name": "constant.numeric.ldraw" }, "2":{ "name": "string.other.ldraw" }, "5":{ "name": "constant.numeric.ldraw" }, "9":{ "name": "constant.numeric.ldraw" } } } ] }, "strings": { "name": "string.quoted.double.ldraw", "begin": "\"", "end": "\"", "patterns": [ { "name": "constant.character.escape.ldraw", "match": "\\\\." } ] }, "numbers": { "patterns": [{ "name": "constant.numeric", "match": "[0-9]*\\.?[0-9]+" }] }, "hexnumbers": { "patterns": [ { "name": "string.other.ldraw", "match": "#(?:[0-9a-fA-F]{3}){1,2}" } ] }, "comments": { "patterns": [ { "match": "(\/\/.*$)", "captures": { "1": { "name": "comment.line.character.ldraw" } } } ] } }, "scopeName": "source.ldraw" }