{ "name": "Augmented Backus-Naur Form", "scopeName": "source.abnf", "patterns": [ { "include": "#main" } ], "repository": { "assignment": { "patterns": [ { "name": "keyword.operator.assignment.increment.abnf", "match": "=/" }, { "name": "keyword.operator.assignment.abnf", "match": "=" } ] }, "comment": { "name": "comment.line.semicolon.abnf", "begin": ";", "end": "$", "beginCaptures": { "0": { "name": "punctuation.definition.comment.abnf" } } }, "core-rules": { "name": "support.constant.reference.core-rule.abnf", "match": "(?x)\n\\b\n(ALPHA|BIT|CHAR|CRLF|CR|CTL|DIGIT|DQUOTE\n|HEXDIG|HTAB|LF|LWSP|OCTET|SP|VCHAR|WSP)\n\\b" }, "group": { "name": "meta.group.abnf", "begin": "\\(", "end": "\\)", "patterns": [ { "include": "#rhs" } ], "beginCaptures": { "0": { "name": "punctuation.definition.round.bracket.begin.abnf" } }, "endCaptures": { "0": { "name": "punctuation.definition.round.bracket.end.abnf" } } }, "main": { "patterns": [ { "include": "#comment" }, { "include": "#rule" } ] }, "optional": { "name": "meta.optional.abnf", "begin": "\\[", "end": "\\]", "patterns": [ { "include": "#rhs" } ], "beginCaptures": { "0": { "name": "punctuation.definition.square.bracket.begin.abnf" } }, "endCaptures": { "0": { "name": "punctuation.definition.square.bracket.end.abnf" } } }, "quantifier": { "name": "meta.quantifier.abnf", "match": "([0-9]*)(\\*)", "captures": { "1": { "name": "constant.numeric.decimal.integer.int.abnf" }, "2": { "name": "keyword.operator.logical.repetition.asterisk.star.abnf" } } }, "reference": { "name": "variable.parameter.argument.identifier.reference.abnf", "match": "[A-Za-z][-A-Za-z0-9]*" }, "rhs": { "patterns": [ { "include": "#assignment" }, { "include": "#string" }, { "include": "#terminal" }, { "include": "#comment" }, { "include": "#quantifier" }, { "include": "#group" }, { "include": "#optional" }, { "include": "#core-rules" }, { "include": "#reference" }, { "name": "keyword.operator.logical.or.alternation.pipe.abnf", "match": "/" } ] }, "rule": { "name": "meta.ruleset.$2.abnf", "contentName": "meta.rhs.abnf", "begin": "(?:^|\\G)(\\s*)([A-Za-z][-A-Za-z0-9]*)", "end": "^(?!\\1\\s+\\S)|^(?=\\S)", "patterns": [ { "include": "#rhs" } ], "beginCaptures": { "0": { "name": "meta.lhs.abnf" }, "1": { "name": "punctuation.whitespace.leading.abnf" }, "2": { "name": "entity.name.rule.identifier.abnf" } } }, "string": { "name": "string.quoted.double.abnf", "begin": "\"", "end": "\"", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.abnf" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.abnf" } } }, "terminal": { "patterns": [ { "name": "meta.terminal.numeric.decimal.abnf", "begin": "(%)(d|D)", "end": "(?=$|[;()\\[\\]{}\\s])", "patterns": [ { "name": "invalid.illegal.syntax.abnf", "match": "[0-9A-Fa-f]*[^-\\s0-9.;()\\[\\]{}][^-.;()\\[\\]{}]*" }, { "name": "constant.numeric.integer.int.decimal.abnf", "match": "[0-9]+" }, { "name": "punctuation.separator.range.dash.hyphen.abnf", "match": "-" }, { "name": "keyword.operator.concatenation.abnf", "match": "\\." } ], "beginCaptures": { "1": { "name": "punctuation.definition.terminal.percentage-sign.abnf" }, "2": { "name": "storage.type.modifier.radix.abnf" } } }, { "name": "meta.terminal.numeric.hexadecimal.hex.abnf", "begin": "(%)(x|X)", "end": "(?=$|[;()\\[\\]{}\\s])", "patterns": [ { "name": "invalid.illegal.syntax.abnf", "match": "[0-9A-Fa-f]*[^-\\s0-9A-Fa-f.;()\\[\\]{}][^-.;()\\[\\]{}]*" }, { "name": "constant.numeric.integer.int.hexadecimal.hex.abnf", "match": "[0-9A-Fa-f]+" }, { "name": "punctuation.separator.range.dash.hyphen.abnf", "match": "-" }, { "name": "keyword.operator.concatenation.abnf", "match": "\\." } ], "beginCaptures": { "1": { "name": "punctuation.definition.terminal.percentage-sign.abnf" }, "2": { "name": "storage.type.modifier.radix.abnf" } } }, { "name": "meta.terminal.numeric.binary.bin.abnf", "begin": "(%)(b|B)", "end": "(?=$|[;()\\[\\]{}\\s])", "patterns": [ { "name": "invalid.illegal.syntax.abnf", "match": "[0-1]*[^-\\s0-1.;()\\[\\]{}][^-.;()\\[\\]{}]*" }, { "name": "constant.numeric.integer.int.binary.bin.abnf", "match": "[0-1]+" }, { "name": "punctuation.separator.range.dash.hyphen.abnf", "match": "-" }, { "name": "keyword.operator.concatenation.abnf", "match": "\\." } ], "beginCaptures": { "1": { "name": "punctuation.definition.terminal.percentage-sign.abnf" }, "2": { "name": "storage.type.modifier.radix.abnf" } } } ] } } }