{ "name": "KiCad PCB (S-expressions)", "scopeName": "source.pcb.sexp", "fileTypes": [ "kicad_mod", "kicad_pcb", "kicad_wks", "fp-lib-table", "dsn", "net" ], "firstLineMatch": "^\\s*\\((?:kicad_pcb|fp_lib_table)\\s+", "limitLineLength": false, "patterns": [ { "name": "meta.expression.layers.pcb.sexp", "begin": "(\\()\\s*(layers)(?=\\s|$|\\()", "end": "\\)", "beginCaptures": { "1": { "name": "punctuation.section.expression.begin.pcb.sexp" }, "2": { "name": "storage.type.class.layers.pcb.sexp" } }, "endCaptures": { "0": { "name": "punctuation.section.expression.end.pcb.sexp" } }, "patterns": [ { "name": "meta.expression.layer.pcb.sexp", "begin": "(\\()\\s*(\\d+)(?:\\s+|(?=$|\\())", "end": "\\)", "beginCaptures": { "1": { "name": "punctuation.section.expression.begin.pcb.sexp" }, "2": { "name": "constant.numeric.integer.decimal.pcb.sexp" } }, "endCaptures": { "0": { "name": "punctuation.section.expression.end.pcb.sexp" } }, "patterns": [ { "match": "\\G\\s*(-?(?:(?![\\s\\(\\)])[\\0-\\x7F])+)", "captures": { "1": { "name": "entity.name.function.pcb.sexp" } } }, { "include": "#shared" } ] }, { "include": "#shared" } ] }, { "name": "meta.expression.comment.pcb.sexp", "begin": "(\\()\\s*(comment)(?=\\s|$|\\()", "end": "\\)", "beginCaptures": { "1": { "name": "punctuation.section.expression.begin.pcb.sexp" }, "2": { "name": "entity.name.function.comment.pcb.sexp" } }, "endCaptures": { "0": { "name": "punctuation.section.expression.end.pcb.sexp" } }, "contentName": "comment.block.expression.pcb.sexp", "patterns": [ { "begin": "\"", "end": "\"|^|$", "patterns": [ { "include": "#stringInnards" } ] } ] }, { "name": "meta.expression.pcb.sexp", "begin": "\\(", "end": "\\)", "beginCaptures": { "0": { "name": "punctuation.section.expression.begin.pcb.sexp" } }, "endCaptures": { "0": { "name": "punctuation.section.expression.end.pcb.sexp" } }, "patterns": [ { "match": "\\G\\s*(kicad_pcb|module|page_layout|fp_lib_table)(?=\\s|$|\\()", "captures": { "1": { "name": "storage.type.class.pcb.sexp" } } }, { "match": "\\G\\s*(string_quote)\\s+(\")(?=\\))", "captures": { "1": { "name": "entity.name.function.pcb.sexp" }, "2": { "name": "constant.character.quote.pcb.sexp" } } }, { "match": "\\G\\s*(-?(?:(?![\\s\\(\\)])[\\0-\\x7F])+)", "captures": { "1": { "name": "entity.name.function.pcb.sexp" } } }, { "include": "#shared" } ] } ], "repository": { "shared": { "patterns": [ { "include": "#values" }, { "include": "$self" } ] }, "values": { "patterns": [ { "name": "constant.numeric.float.decimal.pcb.sexp", "match": "[-+]?\\d*\\.\\d+" }, { "name": "constant.numeric.integer.decimal.pcb.sexp", "match": "[-+]?\\d+(?=\\s|\\))" }, { "name": "constant.numeric.integer.hex.pcb.sexp", "match": "0x[A-Fa-f0-9]+(?:_[A-Fa-f0-9]+)*" }, { "name": "constant.language.boolean.$1.pcb.sexp", "match": "(?<=\\s|\\(|\\))(true|false|yes|no)(?=\\s|\\(|\\))" }, { "name": "string.quoted.double.empty.pcb.sexp", "match": "(\")(\")", "captures": { "1": { "name": "punctuation.definition.string.begin.pcb.sexp" }, "2": { "name": "punctuation.definition.string.end.pcb.sexp" } } }, { "name": "string.quoted.double.pcb.sexp", "begin": "\"", "end": "\"|^|$", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.pcb.sexp" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.pcb.sexp" } }, "patterns": [ { "include": "#stringInnards" } ] }, { "name": "meta.embedded.source.pcb.sexp", "match": "(\\${)([^\\s}\\(\\)]+)(})", "captures": { "1": { "name": "punctuation.section.embedded.bracket.curly.begin.pcb.sexp" }, "2": { "name": "string.interpolated.embedded.pcb.sexp" }, "3": { "name": "punctuation.section.embedded.bracket.curly.end.pcb.sexp" } } }, { "name": "variable.parameter.identifier.pcb.sexp", "match": "[^\\s\\(\\)]+" } ] }, "stringInnards": { "patterns": [ { "name": "constant.character.escape.pcb.sexp", "match": "\\\\\\S" }, { "name": "invalid.illegal.unclosed.string.pcb.sexp", "match": "\\G(?:[^\"\\\\]|\\\\.)+(?=$)" } ] } } }