mirror of
https://github.com/michaelgale/ldraw-vscode.git
synced 2026-09-15 02:53:12 +00:00
148 lines
3.2 KiB
JSON
148 lines
3.2 KiB
JSON
{
|
|
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
|
"name": "ldraw",
|
|
"patterns": [
|
|
{
|
|
"include": "#commands"
|
|
},
|
|
{
|
|
"include": "#keywords"
|
|
},
|
|
{
|
|
"include": "#meta"
|
|
},
|
|
{
|
|
"include": "#nofile"
|
|
},
|
|
{
|
|
"include": "#fileblocks"
|
|
},
|
|
{
|
|
"include": "#linetypes"
|
|
},
|
|
{
|
|
"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(ROTATION|CONFIG|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"
|
|
}
|
|
}
|
|
}]
|
|
},
|
|
"linetypes": {
|
|
"patterns": [{
|
|
"match": "^\\s*([1-5])\\s?(\\d+)\\s?(([-.0-9]+\\s*){3})\\s?(([-.0-9]+\\s*){3})\\s?(([-.0-9]+\\s*){3})\\s?(([-.0-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"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"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": {
|
|
"name": "comment.line.character.ldraw",
|
|
"match": "^\\s*0.*$"
|
|
}
|
|
},
|
|
"scopeName": "source.ldraw"
|
|
}
|