{"name":"Labelled Backus-Naur Form","scopeName":"source.lbnf","patterns":[{"include":"#main"}],"repository":{"braces":{"name":"meta.braces.lbnf","begin":"{","end":"}","patterns":[{"include":"#rhs"}],"beginCaptures":{"0":{"name":"punctuation.definition.curly.bracket.begin.lbnf"}},"endCaptures":{"0":{"name":"punctuation.definition.curly.bracket.end.lbnf"}}},"category":{"match":"(?:(?\u003c=\\.)|(?\u003c=\\[)\\G)\\s*((?!\\d)\\w+)","captures":{"1":{"name":"entity.name.tag.category.lbnf"}}},"character":{"name":"string.quoted.single.character.lbnf","match":"(').(')","captures":{"1":{"name":"punctuation.definition.string.begin.lbnf"},"2":{"name":"punctuation.definition.string.end.lbnf"}}},"comments":{"patterns":[{"name":"comment.line.double-dash.lbnf","begin":"--","end":"$","beginCaptures":{"0":{"name":"punctuation.definition.comment.lbnf"}}},{"name":"comment.block.lbnf","begin":"{-","end":"-}","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.lbnf"}},"endCaptures":{"0":{"name":"punctuation.definition.comment.end.lbnf"}}}]},"definition":{"name":"meta.definition.lbnf","begin":"::=","end":"(?=;)","patterns":[{"include":"#rhs"}],"beginCaptures":{"0":{"name":"keyword.operator.assignment.lbnf"}}},"label":{"match":"(?:(?:^|\\G)\\s*(?!\\d)(\\w+)\\s*|(?\u003c=\\]|\\))\\s*)(\\.)","captures":{"1":{"name":"entity.name.label.lbnf"},"2":{"name":"keyword.operator.label-separator.lbnf"}}},"list":{"patterns":[{"name":"meta.list.cons-rule.lbnf","match":"(\\()(:)(\\))","captures":{"1":{"name":"punctuation.section.round.bracket.begin.lbnf"},"2":{"patterns":[{"include":"#misc-operators"}]},"3":{"name":"punctuation.section.round.bracket.end.lbnf"}}},{"name":"meta.list.one-element.lbnf","match":"(\\()(:)(\\[\\])(\\))","captures":{"1":{"name":"punctuation.section.round.bracket.begin.lbnf"},"2":{"patterns":[{"include":"#misc-operators"}]},"3":{"patterns":[{"include":"#list-empty"}]},"4":{"name":"punctuation.section.round.bracket.end.lbnf"}}},{"include":"#list-empty"},{"name":"meta.list.lbnf","begin":"\\[","end":"\\]","patterns":[{"include":"#list-innards"}],"beginCaptures":{"0":{"name":"punctuation.section.group.square.bracket.begin.lbnf"}},"endCaptures":{"0":{"name":"punctuation.section.group.square.bracket.end.lbnf"}}},{"name":"meta.list.parenthetical.lbnf","begin":"\\(","end":"\\)","patterns":[{"include":"#list-innards"}],"beginCaptures":{"0":{"name":"punctuation.section.round.bracket.begin.lbnf"}},"endCaptures":{"0":{"name":"punctuation.section.round.bracket.end.lbnf"}}}]},"list-empty":{"name":"meta.list.empty.lbnf","match":"(\\[)(\\])","captures":{"1":{"name":"punctuation.section.group.square.bracket.begin.lbnf"},"2":{"name":"punctuation.section.group.square.bracket.end.lbnf"}}},"list-innards":{"patterns":[{"include":"#reference"},{"include":"#comments"},{"include":"#list"},{"include":"#rhs"}]},"main":{"patterns":[{"include":"#comments"},{"include":"#list"},{"include":"#label"},{"include":"#category"},{"include":"#pragmas"},{"include":"#definition"},{"include":"#rhs"}]},"misc-keywords":{"name":"keyword.operator.reserved-word.$1.lbnf","match":"(?x) \\b\n( char\n| coercions\n| comment\n| digit\n| entrypoints\n| eps\n| internal\n| layout\n| letter\n| lower\n| nonempty\n| position\n| rules\n| separator\n| stop\n| terminator\n| token\n| toplevel\n| upper\n) \\b"},"misc-operators":{"patterns":[{"name":"punctuation.definition.cons-rule.colon.lbnf","match":":"},{"name":"punctuation.delimiter.comma.lbnf","match":","},{"name":"keyword.operator.arithmetic.subtraction.lbnf","match":"-"}]},"number":{"name":"constant.numeric.decimal.lbnf","match":"-?\\d+(?:\\.\\d+)?"},"pragmas":{"patterns":[{"name":"meta.praga.$1.lbnf","begin":"(?:^|\\G)\\s*(rules)\\s+(\\w+)\\s*(?=::=)","end":"(?=;)","patterns":[{"include":"#definition"}],"beginCaptures":{"1":{"name":"keyword.control.directive.pragma.$1.lbnf"},"2":{"name":"entity.name.type.lbnf"}}},{"name":"meta.pragma.comment-syntax.lbnf","begin":"(?:^|\\G)\\s*(comment)(?=\\s|$)","end":"(?=;|$)","patterns":[{"include":"#rhs"}],"beginCaptures":{"1":{"name":"keyword.control.directive.pragma.$1-syntax.lbnf"}}},{"name":"meta.pragma.$1.lbnf","begin":"(?x) (?:^|\\G)\\s*\n( coercions\n| entrypoints\n| layout (?:\\s+(stop|toplevel))?\n| (position\\s+)? token\n| rules\n| separator\n| terminator\n) (?=\\s|$)","end":"$|(?=;)","patterns":[{"include":"#rhs"}],"beginCaptures":{"1":{"name":"keyword.control.directive.pragma.$1.lbnf"},"2":{"name":"keyword.control.layout-command.lbnf"}}}]},"reference":{"name":"entity.name.tag.reference.lbnf","match":"(?!\\d)\\w+"},"rhs":{"patterns":[{"include":"#string"},{"include":"#character"},{"include":"#semicolon"},{"include":"#misc-keywords"},{"include":"#misc-operators"},{"include":"#reference"},{"include":"#list"},{"include":"source.bnf#operators"},{"include":"#number"},{"include":"#comments"},{"include":"#braces"}]},"semicolon":{"name":"punctuation.terminator.statement.semicolon.lbnf","match":";"},"string":{"name":"string.quoted.double.lbnf","begin":"\"","end":"\"","patterns":[{"name":"constant.character.escape.quote.lbnf","match":"\\\\\""}],"beginCaptures":{"0":{"name":"punctuation.definition.string.begin.lbnf"}},"endCaptures":{"0":{"name":"punctuation.definition.string.end.lbnf"}}}}}