{ "name": "Gerber Image", "scopeName": "source.gerber", "patterns": [ { "contentName": "comment.block.gerber", "begin": "G04", "end": "(?=\\*)", "beginCaptures": { "0": { "name": "entity.name.function.begin-comment.gerber" } } }, { "name": "meta.command.block.gerber", "begin": "%", "end": "%", "patterns": [ { "include": "#extendedCommands" } ], "beginCaptures": { "0": { "name": "punctuation.section.begin.extended.command.gerber" } }, "endCaptures": { "0": { "name": "punctuation.section.end.extended.command.gerber" } } }, { "name": "punctuation.separator.list.comma.gerber", "match": "," }, { "name": "keyword.operator.terminator.gerber", "match": "\\*" }, { "name": "keyword.control.eof.gerber", "match": "M02" }, { "name": "entity.name.function.${1:/downcase}.command.gerber", "match": "(?x)\n(FS|MO|AD|AM|AB|D[0-9]+|G01|G02|G03|G74|G75|LP|LM|LR|LS|G36|G37\n|SR|G04|TF|TA|TO|TD|M02|G54|G55|G70|G71|G90|G91|M00|M01|IP|AS\n|IR|MI|OF|SF|IN|LN)" }, { "name": "meta.${1:/downcase}.ordinate.gerber", "match": "(X|Y)([-+]?[0-9]+)", "captures": { "1": { "name": "storage.name.var.${1:/downcase}.gerber" }, "2": { "name": "constant.numeric.decimal.gerber" } } }, { "name": "constant.numeric.decimal.gerber", "match": "[-+]?(?:[0-9]*\\.[0-9]+|[0-9]+)" } ], "repository": { "extendedCommands": { "patterns": [ { "begin": "\\G(AM)([A-Za-z_.0-9$]+)", "end": "(?=%)", "patterns": [ { "include": "#macroInnards" } ], "beginCaptures": { "1": { "name": "storage.type.function.macro.gerber" }, "2": { "name": "entity.name.function.macro.gerber" } } }, { "name": "meta.aperture.definition.gerber", "begin": "\\G(AD)(D[0-9]+)([^,%*\\s]+)", "end": "(?=%)", "patterns": [ { "begin": "\\G(?=,)", "end": "(?=%)", "patterns": [ { "match": "(X)?([^*%X]+)", "captures": { "1": { "name": "punctuation.delimiter.modifiers.list.gerber" }, "2": { "patterns": [ { "include": "$self" } ] } } }, { "include": "$self" } ] }, { "include": "$self" } ], "beginCaptures": { "1": { "name": "storage.type.function.aperture.gerber" }, "2": { "name": "entity.name.function.d-code.gerber" }, "3": { "name": "variable.parameter.aperture-name.gerber" } } }, { "name": "meta.attribute.gerber", "begin": "\\G(TF|TA|TO)([^,*%]+)(,)", "end": "(?=\\*|%)", "patterns": [ { "name": "punctuation.separator.list.comma.gerber", "match": "," }, { "name": "string.unquoted.attribute.gerber", "match": "[^,%*]" } ], "beginCaptures": { "1": { "name": "storage.type.attribute.gerber" }, "2": { "name": "entity.other.attribute-name.gerber" } } }, { "match": "\\G(TD)([^,*%]+)", "captures": { "1": { "name": "entity.name.function.delete.attribute.gerber" }, "2": { "name": "entity.other.attribute-name.gerber" } } }, { "match": "\\G(FS)([LT][AI])", "captures": { "1": { "name": "entity.name.function.format-spec.gerber" }, "2": { "name": "constant.language.option.modes.gerber" } } }, { "match": "\\G(OF)(A)([-+]?[0-9]+)(B)([-+]?[0-9]+)", "captures": { "1": { "name": "entity.name.function.offset.gerber" }, "2": { "name": "storage.name.var.offset.a-axis.gerber" }, "3": { "name": "constant.numeric.decimal.gerber" }, "4": { "name": "storage.name.var.offset.b-axis.gerber" }, "5": { "name": "constant.numeric.decimal.gerber" } } }, { "match": "\\G(MO)(IN|MM)", "captures": { "1": { "name": "entity.name.function.unit-mode.gerber" }, "2": { "name": "constant.language.unit-type.gerber" } } }, { "match": "\\G(IP)(POS|NEG)", "captures": { "1": { "name": "entity.name.function.image-polarity.gerber" }, "2": { "name": "constant.language.image-polarity.gerber" } } }, { "match": "\\G(LP)(C|D)", "captures": { "1": { "name": "entity.name.function.load-polarity.gerber" }, "2": { "name": "constant.language.polarity-type.gerber" } } }, { "match": "\\G(LM)(N|XY|X|Y)", "captures": { "1": { "name": "entity.name.function.load-mirroring.gerber" }, "2": { "name": "constant.language.mirror-type.gerber" } } }, { "contentName": "variable.parameter.gerber", "begin": "\\G(LN)", "end": "(?=\\*|%)", "beginCaptures": { "1": { "name": "entity.name.function.load-name.gerber" } } }, { "include": "$self" } ] }, "macroInnards": { "patterns": [ { "name": "comment.line.primitive.gerber", "match": "^\\s*(0)(\\s+([^*%]+)(?=\\*|%|$))", "captures": { "1": { "name": "keyword.operator.primitive.gerber" }, "2": { "patterns": [ { "include": "#unicodeEscape" } ] }, "3": { "name": "string.unquoted.gerber" } } }, { "name": "keyword.operator.logical.arithmetic.gerber", "match": "\\+|-|x|X|/" }, { "match": "(\\()|(\\))", "captures": { "1": { "name": "punctuation.section.equation.begin.gerber" }, "2": { "name": "punctuation.section.equation.end.gerber" } } }, { "name": "variable.positional.parameter.gerber", "match": "(\\$)[1-9][0-9]*", "captures": { "1": { "name": "punctuation.definition.variable.gerber" } } }, { "name": "keyword.operator.assignment.gerber", "match": "=" }, { "include": "$self" } ] }, "unicodeEscape": { "name": "constant.character.escape.unicode.gerber", "match": "(\\\\)u[0-9A-Fa-f]{4}", "captures": { "1": { "name": "punctuation.definition.escape.backslash.gerber" } } } } }