grammars/source.httpspec.json in github-linguist-5.2.0 vs grammars/source.httpspec.json in github-linguist-5.3.0

- old
+ new

@@ -1,10 +1,12 @@ { + "name": "HTTP Spec", + "scopeName": "source.httpspec", "fileTypes": [ "httpspec" ], - "name": "HTTP Spec", + "uuid": "7bb6ff35-8b8a-4480-91ec-20f2d3fcba9a", "patterns": [ { "name": "meta.request.httpspec", "patterns": [ { @@ -18,108 +20,18 @@ } ] } ], "repository": { - "ampersand": { - "patterns": [ - { - "match": "(?<!\\&)\\&(?!\\&)", - "name": "support.function.ampersand.httpspec" - } - ] - }, - "closingbracket": { - "patterns": [ - { - "name": "keyword.other.multiplexend.httpspec" - }, - { - "match": "\\]" - } - ] - }, - "comma": { - "patterns": [ - { - "match": "\\,", - "name": "keyword.other.comma.httpspec.test" - } - ] - }, - "emptyline": { - "patterns": [ - { - "match": "^\\s*$" - } - ] - }, - "equals": { - "patterns": [ - { - "match": "\\=", - "name": "support.function.keyvaluepairseparator.httpspec" - } - ] - }, - "header": { - "patterns": [ - { - "captures": { - "1": { - "name": "variable.parameter.headername.httpspec" - } - }, - "match": "^([a-zA-Z\\-_]+\\:)\\s(.*)$", - "name": "string.unquoted.uri.httpspec" - } - ] - }, - "invalidcomma": { - "patterns": [ - { - "match": "^\\,|\\,(?=\\s)", - "name": "invalid.illegal.comma.httpspec" - } - ] - }, - "jsonblock": { - "patterns": [ - { - "include": "source.json" - } - ] - }, - "methodlist": { - "patterns": [ - { - "include": "#methodname" - }, - { - "include": "#invalidcomma" - }, - { - "include": "#comma" - } - ] - }, - "methodname": { - "patterns": [ - { - "match": "(?:\\b)(OPTIONS|HEAD|GET|DELETE|PUT|PATCH|POST)", - "name": "keyword.other.method.httpspec" - } - ] - }, "multiplex": { "begin": "(\\[)", + "end": "\\]", "beginCaptures": { "0": { "name": "keyword.other" } }, - "end": "\\]", "endCaptures": { "0": { "name": "keyword.other" } }, @@ -130,36 +42,52 @@ { "include": "#comma" } ] }, - "namevaluepair": { + "header": { "patterns": [ { - "include": "#uriqueryname" + "name": "string.unquoted.uri.httpspec", + "match": "^([a-zA-Z\\-_]+\\:)\\s(.*)$", + "captures": { + "1": { + "name": "variable.parameter.headername.httpspec" + } + } + } + ] + }, + "response": { + "patterns": [ + { + "include": "#statusline" }, { - "include": "#equals" + "include": "#header" }, { - "include": "#uriqueryvalue" + "include": "#jsonblock" } ] }, - "openingbracket": { + "jsonblock": { "patterns": [ { - "match": "\\[", - "name": "keyword.other.multiplexstart.httpspec" + "include": "source.json" } ] }, - "questionmark": { + "statusline": { "patterns": [ { - "match": "\\?", - "name": "support.function.queryseparator.httpspec" + "match": "^(\\d\\d\\d)\\s(.*)$", + "captures": { + "0": { + "name": "constant.language.statustext.httpspec" + } + } } ] }, "request": { "patterns": [ @@ -178,45 +106,82 @@ } ] } ] }, + "openingbracket": { + "patterns": [ + { + "name": "keyword.other.multiplexstart.httpspec", + "match": "\\[" + } + ] + }, + "closingbracket": { + "patterns": [ + { + "name": "keyword.other.multiplexend.httpspec" + }, + { + "match": "\\]" + } + ] + }, + "emptyline": { + "patterns": [ + { + "match": "^\\s*$" + } + ] + }, "requestline": { "patterns": [ { "include": "#methodlist" }, { "include": "#uri" } ] }, - "response": { + "methodlist": { "patterns": [ { - "include": "#statusline" + "include": "#methodname" }, { - "include": "#header" + "include": "#invalidcomma" }, { - "include": "#jsonblock" + "include": "#comma" } ] }, - "statusline": { + "methodname": { "patterns": [ { - "captures": { - "0": { - "name": "constant.language.statustext.httpspec" - } - }, - "match": "^(\\d\\d\\d)\\s(.*)$" + "name": "keyword.other.method.httpspec", + "match": "(?:\\b)(OPTIONS|HEAD|GET|DELETE|PUT|PATCH|POST)" } ] }, + "comma": { + "patterns": [ + { + "name": "keyword.other.comma.httpspec.test", + "match": "\\," + } + ] + }, + "invalidcomma": { + "patterns": [ + { + "name": "invalid.illegal.comma.httpspec", + "match": "^\\,|\\,(?=\\s)" + } + ] + }, "uri": { "patterns": [ { "include": "#uripath" }, @@ -229,23 +194,16 @@ { "include": "#uriquery" } ] }, - "uripart": { - "patterns": [ - { - "match": "([a-bA-B0-9\\-_/]+)" - } - ] - }, "uripath": { "patterns": [ { + "name": "support.function.httpspec", "begin": "(?:\\s)\\/", "end": "(?:$)", - "name": "support.function.httpspec", "patterns": [ { "include": "#uripart" }, { @@ -253,35 +211,77 @@ } ] } ] }, + "uripart": { + "patterns": [ + { + "match": "([a-bA-B0-9\\-_/]+)" + } + ] + }, + "questionmark": { + "patterns": [ + { + "name": "support.function.queryseparator.httpspec", + "match": "\\?" + } + ] + }, "uriquery": { "patterns": [ { "include": "#namevaluepair" }, { "include": "#ampersand" } ] }, + "namevaluepair": { + "patterns": [ + { + "include": "#uriqueryname" + }, + { + "include": "#equals" + }, + { + "include": "#uriqueryvalue" + } + ] + }, "uriqueryname": { "patterns": [ { - "match": "(?<=[?&])([^=&])+", - "name": "support.function.uriqueryname.httpspec" + "name": "support.function.uriqueryname.httpspec", + "match": "(?<=[?&])([^=&])+" } ] }, + "equals": { + "patterns": [ + { + "name": "support.function.keyvaluepairseparator.httpspec", + "match": "\\=" + } + ] + }, "uriqueryvalue": { "patterns": [ { - "match": "(?<=\\=)([^=&]+)", - "name": "support.function.uriqueryvalue.httpspec" + "name": "support.function.uriqueryvalue.httpspec", + "match": "(?<=\\=)([^=&]+)" } ] + }, + "ampersand": { + "patterns": [ + { + "name": "support.function.ampersand.httpspec", + "match": "(?<!\\&)\\&(?!\\&)" + } + ] } - }, - "scopeName": "source.httpspec", - "uuid": "7bb6ff35-8b8a-4480-91ec-20f2d3fcba9a" + } } \ No newline at end of file