grammars/source.pcb.schematic.json in github-linguist-5.3.3 vs grammars/source.pcb.schematic.json in github-linguist-6.0.0

- old
+ new

@@ -1,50 +1,33 @@ { "name": "KiCad Schematic", "scopeName": "source.pcb.schematic", - "fileTypes": [ - "sch" - ], - "firstLineMatch": "^\\s*EESchema\\s+(?:Schematic|-LIBRARY)\\s", "patterns": [ { - "begin": "\\A(?=<\\?xml\\s+version=\"[\\d.]+\"\\s)", + "contentName": "source.eagle.pcb.board", + "begin": "\\A(?=\u003c\\?xml\\s+version=\"[\\d.]+\"\\s)", "end": "(?=A)B", "patterns": [ { "include": "text.xml" } - ], - "contentName": "source.eagle.pcb.board" + ] }, { + "contentName": "source.scheme", "begin": "\\A\\s*(?=;|\\()", "end": "(?=A)B", "patterns": [ { "include": "source.scheme" } - ], - "contentName": "source.scheme" + ] }, { "name": "meta.header.pcb.schematic", "begin": "^\\s*(EESchema\\s+(?:Schematic|-LIBRARY)\\s+\\S+.*)\\s*$", - "end": "(?<=\\$EndDescr)(?=\\s|$)", - "beginCaptures": { - "1": { - "name": "keyword.control.header.pcb.schematic" - } - }, - "endCaptures": { - "1": { - "name": "keyword.control.header.pcb.schematic" - }, - "2": { - "name": "punctuation.definition.header.pcb.schematic" - } - }, + "end": "(?\u003c=\\$EndDescr)(?=\\s|$)", "patterns": [ { "match": "^\\s*(LIBS(:))\\s*(.+)", "captures": { "1": { @@ -54,25 +37,30 @@ "name": "punctuation.separator.key-value.pcb.schematic" }, "3": { "patterns": [ { - "match": ",", - "name": "punctuation.delimiter.list.comma.pcb.schematic" + "name": "punctuation.delimiter.list.comma.pcb.schematic", + "match": "," }, { - "match": "[^\\s,]+", - "name": "constant.other.lib-name.pcb.schematic" + "name": "constant.other.lib-name.pcb.schematic", + "match": "[^\\s,]+" } ] } } }, { "name": "meta.eelayer.pcb.schematic", "begin": "^\\s*(EELAYER)((?:\\s+[-+]?[\\d.]+)*)\\s*$", "end": "^\\s*(EELAYER)\\s+(END)\\s*$", + "patterns": [ + { + "include": "$self" + } + ], "beginCaptures": { "1": { "name": "entity.name.var.pcb.schematic" }, "2": { @@ -88,21 +76,29 @@ "name": "entity.name.var.pcb.schematic" }, "2": { "name": "keyword.control.pcb.schematic" } - }, - "patterns": [ - { - "include": "$self" - } - ] + } }, { "name": "meta.description.pcb.schematic", "begin": "^\\s*((\\$)Descr)(?=\\s)", "end": "^\\s*((\\$)EndDescr)(?=\\s)", + "patterns": [ + { + "match": "\\G\\s+([A-E][0-9]?)(?=\\s)", + "captures": { + "1": { + "name": "constant.language.paper-size.pcb.schematic" + } + } + }, + { + "include": "$self" + } + ], "beginCaptures": { "1": { "name": "keyword.control.section.pcb.schematic" }, "2": { @@ -114,85 +110,90 @@ "name": "keyword.control.section.pcb.schematic" }, "2": { "name": "punctuation.section.end.pcb.schematic" } - }, - "patterns": [ - { - "match": "\\G\\s+([A-E][0-9]?)(?=\\s)", - "captures": { - "1": { - "name": "constant.language.paper-size.pcb.schematic" - } - } - }, - { - "include": "$self" - } - ] + } }, { "include": "$self" } - ] - }, - { - "name": "meta.bitmap.pcb.schematic", - "begin": "^\\s*((\\$)Bitmap)\\s*$", - "end": "^\\s*((\\$)EndBitmap)(?=\\s|$)", + ], "beginCaptures": { "1": { - "name": "keyword.control.section.pcb.schematic" - }, - "2": { - "name": "punctuation.section.begin.pcb.schematic" + "name": "keyword.control.header.pcb.schematic" } }, "endCaptures": { "1": { - "name": "keyword.control.section.pcb.schematic" + "name": "keyword.control.header.pcb.schematic" }, "2": { - "name": "punctuation.section.end.pcb.schematic" + "name": "punctuation.definition.header.pcb.schematic" } - }, + } + }, + { + "name": "meta.bitmap.pcb.schematic", + "begin": "^\\s*((\\$)Bitmap)\\s*$", + "end": "^\\s*((\\$)EndBitmap)(?=\\s|$)", "patterns": [ { + "contentName": "string.unquoted.heredoc.bytestream.pcb.schematic", "begin": "^\\s*(Data)\\s*$", "end": "^\\s*(EndData)\\s*$", + "patterns": [ + { + "name": "comment.ignored.pcb.schematic", + "match": "\\s+((\\$)EndBitmap)\\s*$" + }, + { + "name": "invalid.illegal.syntax.pcb.schematic", + "match": "(?\u003c=\\s|^)(?![A-Fa-f0-9]{2}(?:\\s|$))(\\S+)" + } + ], "beginCaptures": { "1": { "name": "keyword.control.data.section.begin.pcb.schematic" } }, "endCaptures": { "1": { "name": "keyword.control.data.section.end.pcb.schematic" } - }, - "contentName": "string.unquoted.heredoc.bytestream.pcb.schematic", - "patterns": [ - { - "match": "\\s+((\\$)EndBitmap)\\s*$", - "name": "comment.ignored.pcb.schematic" - }, - { - "name": "invalid.illegal.syntax.pcb.schematic", - "match": "(?<=\\s|^)(?![A-Fa-f0-9]{2}(?:\\s|$))(\\S+)" - } - ] + } }, { "include": "$self" } - ] + ], + "beginCaptures": { + "1": { + "name": "keyword.control.section.pcb.schematic" + }, + "2": { + "name": "punctuation.section.begin.pcb.schematic" + } + }, + "endCaptures": { + "1": { + "name": "keyword.control.section.pcb.schematic" + }, + "2": { + "name": "punctuation.section.end.pcb.schematic" + } + } }, { "name": "meta.component.${1:/downcase}.pcb.schematic", "begin": "^\\s*(DEF|DRAW)(?:\\s+(\\S+)\\s+(.+))?\\s*$", "end": "^\\s*(END\\1)(?=\\s|$)", + "patterns": [ + { + "include": "#params" + } + ], "beginCaptures": { "1": { "name": "storage.type.class.definition.pcb.schematic" }, "2": { @@ -208,16 +209,11 @@ }, "endCaptures": { "1": { "name": "storage.type.class.definition.pcb.schematic" } - }, - "patterns": [ - { - "include": "#params" - } - ] + } }, { "name": "meta.aliases.pcb.schematic", "match": "^\\s*(ALIAS)\\s+(.+)\\s*$", "captures": { @@ -239,10 +235,15 @@ }, { "name": "meta.${3:/downcase}.pcb.schematic", "begin": "^\\s*((\\$)([A-Za-z]\\w+))\\s*$", "end": "^\\s*((\\$)[Ee]nd\\3)(?=\\s|$)", + "patterns": [ + { + "include": "$self" + } + ], "beginCaptures": { "1": { "name": "keyword.control.section.pcb.schematic" }, "2": { @@ -254,16 +255,11 @@ "name": "keyword.control.section.pcb.schematic" }, "2": { "name": "punctuation.section.end.pcb.schematic" } - }, - "patterns": [ - { - "include": "$self" - } - ] + } }, { "name": "meta.wire.pcb.schematic", "match": "^\\s*(Wire)\\s+(Wire|Bus|Line)\\s+(Line)\\s*$", "captures": { @@ -314,58 +310,26 @@ } }, { "begin": "^\\s*([A-Za-z]\\w*)(?=\\s)", "end": "$", - "beginCaptures": { - "1": { - "name": "entity.name.var.pcb.schematic" - } - }, "patterns": [ { "include": "#params" } - ] + ], + "beginCaptures": { + "1": { + "name": "entity.name.var.pcb.schematic" + } + } }, { "include": "#shared" } ], "repository": { - "shared": { - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#capsConstant" - }, - { - "include": "#tilde" - }, - { - "include": "#quotedString" - }, - { - "include": "#numbers" - } - ] - }, - "params": { - "patterns": [ - { - "include": "#upperCaseName" - }, - { - "include": "#lowerCaseName" - }, - { - "include": "$self" - } - ] - }, "comments": { "match": "^\\s*((#).*$)", "captures": { "1": { "name": "comment.line.number-sign.pcb.schematic" @@ -373,56 +337,88 @@ "2": { "name": "punctuation.definition.comment.pcb.board" } } }, - "upperCaseName": { - "name": "constant.language.other.pcb.schematic", - "match": "(?<=\\s)([+#])?[A-Z0-9_]+(?:\\s|$)", - "captures": { - "1": { - "name": "punctuation.definition.constant.pcb.schematic" - } - } - }, "lowerCaseName": { "name": "variable.parameter.identifier.pcb.schematic", - "match": "(?<=\\s)[A-Za-z_][-\\w]+(?=\\s|$)" + "match": "(?\u003c=\\s)[A-Za-z_][-\\w]+(?=\\s|$)" }, "numbers": { "patterns": [ { "name": "constant.numeric.integer.decimal.pcb.schematic", - "match": "(?<![-\\w])[-+]?\\d+(?=\\s|$)" + "match": "(?\u003c![-\\w])[-+]?\\d+(?=\\s|$)" }, { "name": "constant.numeric.float.decimal.pcb.schematic", - "match": "(?<![-\\w])[-+]?\\d*\\.\\d+" + "match": "(?\u003c![-\\w])[-+]?\\d*\\.\\d+" } ] }, + "params": { + "patterns": [ + { + "include": "#upperCaseName" + }, + { + "include": "#lowerCaseName" + }, + { + "include": "$self" + } + ] + }, "quotedString": { "name": "string.quoted.double.pcb.schematic", "begin": "\"", "end": "\"|^|$", + "patterns": [ + { + "include": "#stringInnards" + } + ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.pcb.schematic" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.pcb.schematic" } - }, + } + }, + "shared": { "patterns": [ { - "include": "#stringInnards" + "include": "#comments" + }, + { + "include": "#capsConstant" + }, + { + "include": "#tilde" + }, + { + "include": "#quotedString" + }, + { + "include": "#numbers" } ] }, "tilde": { "name": "keyword.operator.pcb.schematic", "match": "~" + }, + "upperCaseName": { + "name": "constant.language.other.pcb.schematic", + "match": "(?\u003c=\\s)([+#])?[A-Z0-9_]+(?:\\s|$)", + "captures": { + "1": { + "name": "punctuation.definition.constant.pcb.schematic" + } + } } } -} \ No newline at end of file +}