tm-grammars
Version:
Collecton of TextMate grammars in JSON
1,243 lines (1,242 loc) • 36.1 kB
JSON
{
"displayName": "BIRD2 Configuration",
"fileTypes": [
"conf",
"bird",
"bird2",
"bird3",
"bird.conf",
"bird2.conf",
"bird3.conf"
],
"foldingStartMarker": "\\{\\s*$",
"foldingStopMarker": "^\\s*}",
"name": "bird2",
"patterns": [
{
"include": "#comments"
},
{
"include": "#strings"
},
{
"include": "#ip-addresses"
},
{
"include": "#prefixes"
},
{
"include": "#vpn-rd"
},
{
"include": "#bytestrings"
},
{
"include": "#bgp-paths"
},
{
"include": "#print-statements"
},
{
"include": "#template-definitions"
},
{
"include": "#filter-definitions"
},
{
"include": "#function-definitions"
},
{
"include": "#protocol-definitions"
},
{
"include": "#next-hop-statements"
},
{
"include": "#neighbor-statements"
},
{
"include": "#import-export-statements"
},
{
"include": "#variable-declarations"
},
{
"include": "#method-calls"
},
{
"include": "#function-calls"
},
{
"include": "#method-properties"
},
{
"include": "#route-attributes"
},
{
"include": "#data-types"
},
{
"include": "#constants"
},
{
"include": "#structural-keywords"
},
{
"include": "#protocol-phrases"
},
{
"include": "#functional-keywords"
},
{
"include": "#semantic-modifiers"
},
{
"include": "#builtin-functions"
},
{
"include": "#filter-names"
},
{
"include": "#user-variables"
},
{
"include": "#operators"
},
{
"include": "#numbers"
},
{
"include": "#symbols"
},
{
"include": "#blocks"
}
],
"repository": {
"bgp-paths": {
"patterns": [
{
"begin": "\\[=",
"beginCaptures": {
"0": {
"name": "punctuation.definition.bgp-path.begin.bird"
}
},
"end": "=]",
"endCaptures": {
"0": {
"name": "punctuation.definition.bgp-path.end.bird"
}
},
"name": "meta.bgp-path.bird",
"patterns": [
{
"match": "[*+?]",
"name": "keyword.operator.wildcard.bird"
},
{
"match": "\\b[0-9]+\\b",
"name": "constant.numeric.asn.bird"
},
{
"include": "#operators"
},
{
"include": "#symbols"
}
]
}
]
},
"blocks": {
"patterns": [
{
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "punctuation.definition.block.begin.bird"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.definition.block.end.bird"
}
},
"name": "meta.block.bird",
"patterns": [
{
"include": "$self"
}
]
},
{
"begin": "\\[",
"beginCaptures": {
"0": {
"name": "punctuation.definition.set.begin.bird"
}
},
"end": "]",
"endCaptures": {
"0": {
"name": "punctuation.definition.set.end.bird"
}
},
"name": "meta.set.bird",
"patterns": [
{
"include": "$self"
}
]
},
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.definition.tuple.begin.bird"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.definition.tuple.end.bird"
}
},
"name": "meta.tuple.bird",
"patterns": [
{
"include": "$self"
}
]
},
{
"match": ";",
"name": "punctuation.terminator.statement.bird"
},
{
"match": ",",
"name": "punctuation.separator.bird"
}
]
},
"builtin-functions": {
"patterns": [
{
"match": "\\b(?:defined|unset|roa_check|aspa_check|aspa_check_downstream|aspa_check_upstream|from_hex|format|append|prepend|add|delete|empty|reset|bt_assert|bt_test_suite|bt_test_same)\\b",
"name": "support.function.builtin.bird"
}
]
},
"bytestrings": {
"patterns": [
{
"match": "\\bhex:\\h{2}(?:[-.:\\s]*\\h{2})*\\b",
"name": "constant.numeric.bytestring.bird"
},
{
"match": "\\b(?:\\h{2}[-.:\\s]*){15,}\\h{2}\\b",
"name": "constant.numeric.bytestring.bird"
},
{
"match": "\\b\\h{32,}\\b",
"name": "constant.numeric.bytestring.bird"
}
]
},
"comments": {
"patterns": [
{
"begin": "#",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.bird"
}
},
"end": "$",
"name": "comment.line.number-sign.bird"
},
{
"begin": "/\\*",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.begin.bird"
}
},
"end": "\\*/",
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.end.bird"
}
},
"name": "comment.block.bird"
}
]
},
"constants": {
"patterns": [
{
"match": "\\b(?:on|off|yes|no|true|false)\\b",
"name": "constant.language.boolean.bird"
},
{
"match": "\\b(?:empty|unknown|generic|rt|ro|one|ten)\\b",
"name": "constant.language.special.bird"
},
{
"match": "\\bSCOPE_(?:HOST|LINK|SITE|ORGANIZATION|UNIVERSE)\\b",
"name": "constant.language.scope.bird"
},
{
"match": "\\bRTS_(?:STATIC|INHERIT|DEVICE|RIP|OSPF|OSPF_IA|OSPF_EXT1|OSPF_EXT2|BGP|PIPE|BABEL)\\b",
"name": "constant.language.source.bird"
},
{
"match": "\\bRTD_(?:ROUTER|DEVICE|MULTIPATH|BLACKHOLE|UNREACHABLE|PROHIBIT)\\b",
"name": "constant.language.dest.bird"
},
{
"match": "\\bROA_(?:UNKNOWN|INVALID|VALID)\\b",
"name": "constant.language.roa.bird"
},
{
"match": "\\bASPA_(?:UNKNOWN|INVALID|VALID)\\b",
"name": "constant.language.aspa.bird"
},
{
"match": "\\bNET_(?:IP4|IP6|IP6_SADR|VPN4|VPN6|ROA4|ROA6|FLOW4|FLOW6|MPLS)\\b",
"name": "constant.language.net-type.bird"
},
{
"match": "\\bMPLS_POLICY_(?:NONE|STATIC|PREFIX|AGGREGATE|VRF)\\b",
"name": "constant.language.mpls.bird"
}
]
},
"data-types": {
"patterns": [
{
"match": "\\b(?:(?:int|pair|quad|ip|prefix|ec|lc|rd|enum)\\s+set|int|bool|ip|prefix|rd|pair|quad|ec|lc|string|bytestring|bgpmask|bgppath|clist|eclist|lclist|set|enum|route)\\b",
"name": "storage.type.bird"
}
]
},
"filter-definitions": {
"patterns": [
{
"begin": "\\b(filter)\\s+([A-Z_a-z][0-9A-Z_a-z]*|'[-.0-:A-Z_a-z]+')\\s*\\{",
"beginCaptures": {
"1": {
"name": "keyword.control.filter.bird"
},
"2": {
"name": "entity.name.function.filter.bird"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.definition.block.end.bird"
}
},
"name": "meta.filter-definition.bird",
"patterns": [
{
"include": "$self"
}
]
}
]
},
"filter-names": {
"patterns": [
{
"match": "\\b[A-Z_a-z][0-9A-Z_a-z]*_filter\\b",
"name": "entity.name.function.filter.bird"
}
]
},
"function-calls": {
"patterns": [
{
"begin": "\\b([A-Z_a-z][0-9A-Z_a-z]*)\\s*\\(",
"beginCaptures": {
"1": {
"name": "entity.name.function.call.bird"
}
},
"end": "\\)",
"name": "meta.function-call.bird",
"patterns": [
{
"include": "$self"
}
]
}
]
},
"function-definitions": {
"patterns": [
{
"begin": "\\b(function)\\s+([A-Z_a-z][0-9A-Z_a-z]*|'[-.0-:A-Z_a-z]+')(?=\\s*\\()",
"beginCaptures": {
"1": {
"name": "keyword.control.function.bird"
},
"2": {
"name": "entity.name.function.user-defined.bird"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.definition.block.end.bird"
}
},
"name": "meta.function-definition.bird",
"patterns": [
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.definition.parameters.begin.bird"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.definition.parameters.end.bird"
}
},
"name": "meta.function-parameters.bird",
"patterns": [
{
"include": "#data-types"
},
{
"include": "#symbols"
}
]
},
{
"begin": "->",
"beginCaptures": {
"0": {
"name": "keyword.operator.return-type.bird"
}
},
"end": "(?=\\{)",
"name": "meta.function-return-type.bird",
"patterns": [
{
"include": "#data-types"
}
]
},
{
"include": "$self"
}
]
}
]
},
"functional-keywords": {
"patterns": [
{
"match": "\\b(?:static|rip|ospf|bgp|babel|rpki|bfd|bmp|device|direct|kernel|pipe|perf|mrt|aggregator|l3vpn|radv)\\b",
"name": "keyword.control.protocol-type.bird"
},
{
"match": "\\b(?:graceful|restart|preference|disabled|hold|keepalive|connect|retry|start|delay|error|wait|forget|scan|randomize|router|id)\\b",
"name": "keyword.control.routing.bird"
},
{
"match": "\\b(?:interface|type|wired|wireless|tunnel|rxcost|limit|hello|update|interval|port|tx|class|dscp|priority|rx|buffer|length|check|link|rtt|cost|min|max|decay|send|timestamps)\\b",
"name": "keyword.other.interface.bird"
},
{
"match": "\\b(?:(?:refresh|retry|expire|transport|ssh|tcp|user|address|version|ignore|private|public|key)|(?:local\\s+address|ignore\\s+max\\s+length|min\\s+version|max\\s+version|bird\\s+private\\s+key|remote\\s+public\\s+key))\\b",
"name": "keyword.other.rpki.bird"
},
{
"match": "\\b(?:authentication|none|mac|permissive|password|generate|accept|from|to|algorithm|hmac|sha1|sha256|sha384|sha512|blake2s128|blake2s256|blake2b256|blake2b512)\\b",
"name": "keyword.other.auth.bird"
},
{
"match": "\\btime\\b",
"name": "keyword.other.time.bird"
},
{
"match": "\\b(?:hostname|description|debug|log|syslog|stderr|bird|protocols|tables|channels|timeouts|passwords|bfd|confederation|cluster|stub|dead|neighbors|area|md5|multihop|passive|rfc1583compat|tick|ls|retransmit|transmit|ack|state|database|summary|external|nssa|translator|always|candidate|never|role|stability|election|action|warn|block|disable|keep|filtered|receive|modify|add|delete|withdraw|unreachable|blackhole|prohibit|unreach|igp_metric|localpref|med|origin|community|large_community|ext_community|as_path|prepend|weight|gateway|scope|onlink|recursive|multipath|igp|channel|sadr|src|learn|persist|via|ng)\\b",
"name": "keyword.other.config.bird"
},
{
"match": "\\b(?:flow4|flow6|dst|src|proto|header|dport|sport|icmp|code|tcp|flags|dscp|dont_fragment|is_fragment|first_fragment|last_fragment|fragment|label|offset)\\b",
"name": "keyword.other.flowspec.bird"
},
{
"match": "\\b(?:vpn4|vpn6|mpls|aspa|roa4|roa6)\\b",
"name": "keyword.other.address.bird"
},
{
"match": "\\b(?:all|none)\\b",
"name": "keyword.other.quick-declaration.bird"
}
]
},
"import-export-statements": {
"patterns": [
{
"captures": {
"1": {
"name": "keyword.control.import-export.bird"
},
"2": {
"name": "keyword.control.filter.bird"
},
"3": {
"name": "entity.name.function.filter.bird"
}
},
"match": "\\b(import)\\s+(filter)\\s+([A-Z_a-z][0-9A-Z_a-z]*|'[-.0-:A-Z_a-z]+')\\b",
"name": "meta.import-statement.bird"
},
{
"begin": "\\b(import)\\s+(filter)\\s*\\{",
"beginCaptures": {
"1": {
"name": "keyword.control.import-export.bird"
},
"2": {
"name": "keyword.control.filter.bird"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.definition.block.end.bird"
}
},
"name": "meta.import-filter-inline.bird",
"patterns": [
{
"include": "$self"
}
]
},
{
"begin": "\\b(export)\\s+(where)\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.import-export.bird"
},
"2": {
"name": "keyword.control.where.bird"
}
},
"end": ";",
"endCaptures": {
"0": {
"name": "punctuation.terminator.statement.bird"
}
},
"name": "meta.export-where-clause.bird",
"patterns": [
{
"include": "$self"
}
]
},
{
"captures": {
"1": {
"name": "keyword.control.import-export.bird"
},
"2": {
"name": "keyword.control.filter.bird"
},
"3": {
"name": "entity.name.function.filter.bird"
}
},
"match": "\\b(export)\\s+(filter)\\s+([A-Z_a-z][0-9A-Z_a-z]*|'[-.0-:A-Z_a-z]+')\\b",
"name": "meta.export-statement.bird"
}
]
},
"ip-addresses": {
"patterns": [
{
"match": "\\b(?:[0-9]{1,3}\\.){3}[0-9]{1,3}(?:/[0-9]{1,2})?\\b",
"name": "constant.numeric.ip.ipv4.bird"
},
{
"match": "\\b(?:\\h{0,4}:){2,7}\\h{0,4}(?:/[0-9]{1,3})?\\b",
"name": "constant.numeric.ip.ipv6.bird"
},
{
"match": "::(?:\\h{0,4}:){0,6}\\h{0,4}(?:/[0-9]{1,3})?\\b",
"name": "constant.numeric.ip.ipv6.bird"
},
{
"match": "\\b(?:\\h{0,4}:){1,6}::(?:\\h{0,4}:){0,5}\\h{0,4}(?:/[0-9]{1,3})?\\b",
"name": "constant.numeric.ip.ipv6.bird"
}
]
},
"method-calls": {
"patterns": [
{
"begin": "\\.\\s*([A-Z_a-z][0-9A-Z_a-z]*)\\s*\\(",
"beginCaptures": {
"1": {
"name": "entity.name.function.method.bird"
}
},
"end": "\\)",
"name": "meta.method-call.bird",
"patterns": [
{
"include": "$self"
}
]
},
{
"captures": {
"1": {
"name": "variable.other.property.bird"
}
},
"match": "\\.\\s*([A-Z_a-z][0-9A-Z_a-z]*)",
"name": "meta.method-access.bird"
}
]
},
"method-properties": {
"patterns": [
{
"match": "(?<=\\.)\\s*(?:first|last|last_nonaggregated|len|asn|data1??|data2|is_v4|ip|src|dst|rd|maxlen|type|mask|min|max)\\b(?!\\s*\\()",
"name": "support.variable.property.bird"
}
]
},
"neighbor-statements": {
"patterns": [
{
"captures": {
"1": {
"name": "keyword.control.local.bird"
},
"2": {
"name": "entity.name.symbol.local-address.bird"
},
"3": {
"name": "keyword.control.port.bird"
},
"4": {
"name": "constant.numeric.port.bird"
},
"5": {
"name": "keyword.control.as.bird"
},
"6": {
"name": "constant.numeric.asn.bird"
}
},
"match": "\\b(local)\\s+([.:\\h]+|[A-Z_a-z][0-9A-Z_a-z]*|'[-.0-:A-Z_a-z]+')(?:\\s+(port)\\s+([0-9]+|[A-Z_a-z][0-9A-Z_a-z]*))?\\s+(as)\\s+([0-9]+|[A-Z_a-z][0-9A-Z_a-z]*)\\b",
"name": "meta.local-as-statement.bird"
},
{
"captures": {
"1": {
"name": "keyword.control.local.bird"
},
"2": {
"name": "keyword.control.as.bird"
},
"3": {
"name": "constant.numeric.asn.bird"
}
},
"match": "\\b(local)\\s+(as)\\s+([0-9]+|[A-Z_a-z][0-9A-Z_a-z]*)\\b",
"name": "meta.local-as-template-statement.bird"
},
{
"captures": {
"1": {
"name": "keyword.control.neighbor.bird"
},
"2": {
"name": "constant.numeric.ip-address.bird"
},
"3": {
"name": "meta.interface-reference.bird"
},
"4": {
"name": "string.quoted.single.interface.bird"
},
"5": {
"name": "variable.other.interface.bird"
},
"6": {
"name": "keyword.control.as.bird"
},
"7": {
"name": "constant.numeric.asn.bird"
},
"8": {
"name": "keyword.control.port.bird"
},
"9": {
"name": "constant.numeric.port.bird"
}
},
"match": "\\b(neighbor)\\s+([.:\\h]+)\\s*(%\\s*(?:'([-.0-:A-Z_a-z]+)'|([-.0-:A-Z_a-z]+)))?(?:\\s+(as)\\s+([0-9]+|[A-Z_a-z][0-9A-Z_a-z]*))?\\s+(port)\\s+([0-9]+|[A-Z_a-z][0-9A-Z_a-z]*)\\b",
"name": "meta.neighbor-port-statement.bird"
},
{
"captures": {
"1": {
"name": "keyword.control.neighbor.bird"
},
"2": {
"name": "entity.name.symbol.neighbor-address.bird"
},
"3": {
"name": "meta.interface-reference.bird"
},
"4": {
"name": "string.quoted.single.interface.bird"
},
"5": {
"name": "variable.other.interface.bird"
},
"6": {
"name": "keyword.control.as.bird"
},
"7": {
"name": "constant.numeric.asn.bird"
},
"8": {
"name": "keyword.control.port.bird"
},
"9": {
"name": "constant.numeric.port.bird"
}
},
"match": "\\b(neighbor)\\s+('[-.0-:A-Z_a-z]+'|(?!(?:as|range)\\b)[A-Z_a-z][0-9A-Z_a-z]*)\\s*(%\\s*(?:'([-.0-:A-Z_a-z]+)'|([-.0-:A-Z_a-z]+)))?(?:\\s+(as)\\s+([0-9]+|[A-Z_a-z][0-9A-Z_a-z]*))?\\s+(port)\\s+([0-9]+|[A-Z_a-z][0-9A-Z_a-z]*)\\b",
"name": "meta.neighbor-port-symbolic-statement.bird"
},
{
"captures": {
"1": {
"name": "keyword.control.neighbor.bird"
},
"2": {
"name": "constant.numeric.ip-address.bird"
},
"3": {
"name": "meta.interface-reference.bird"
},
"4": {
"name": "string.quoted.single.interface.bird"
},
"5": {
"name": "variable.other.interface.bird"
},
"6": {
"name": "keyword.control.as.bird"
},
"7": {
"name": "constant.numeric.asn.bird"
}
},
"match": "\\b(neighbor)\\s+([.:\\h]+)\\s*(%\\s*(?:'([-.0-:A-Z_a-z]+)'|([-.0-:A-Z_a-z]+)))?\\s+(as)\\s+([0-9]+|[A-Z_a-z][0-9A-Z_a-z]*)\\b",
"name": "meta.neighbor-statement.bird"
},
{
"captures": {
"1": {
"name": "keyword.control.neighbor.bird"
},
"2": {
"name": "entity.name.symbol.neighbor-address.bird"
},
"3": {
"name": "meta.interface-reference.bird"
},
"4": {
"name": "string.quoted.single.interface.bird"
},
"5": {
"name": "variable.other.interface.bird"
},
"6": {
"name": "keyword.control.as.bird"
},
"7": {
"name": "constant.numeric.asn.bird"
}
},
"match": "\\b(neighbor)\\s+('[-.0-:A-Z_a-z]+'|(?!(?:as|range)\\b)[A-Z_a-z][0-9A-Z_a-z]*)\\s*(%\\s*(?:'([-.0-:A-Z_a-z]+)'|([-.0-:A-Z_a-z]+)))?\\s+(as)\\s+([0-9]+|[A-Z_a-z][0-9A-Z_a-z]*)\\b",
"name": "meta.neighbor-symbolic-statement.bird"
},
{
"captures": {
"1": {
"name": "keyword.control.neighbor.bird"
},
"2": {
"name": "keyword.control.as.bird"
},
"3": {
"name": "constant.numeric.asn.bird"
}
},
"match": "\\b(neighbor)\\s+(as)\\s+([0-9]+|[A-Z_a-z][0-9A-Z_a-z]*)\\b",
"name": "meta.neighbor-template-statement.bird"
},
{
"captures": {
"1": {
"name": "keyword.control.source.bird"
},
"2": {
"name": "constant.numeric.ip-address.bird"
}
},
"match": "\\b(source address)\\s+([.:\\h]+)\\b",
"name": "meta.source-address-statement.bird"
}
]
},
"next-hop-statements": {
"patterns": [
{
"captures": {
"1": {
"name": "keyword.control.routing.bird"
},
"2": {
"name": "keyword.other.ip-version.bird"
},
"3": {
"name": "constant.numeric.ip-address.bird"
}
},
"match": "\\b(next hop)\\s+(ipv4)\\s+([.0-9]+)\\b",
"name": "meta.next-hop-ipv4.bird"
},
{
"captures": {
"1": {
"name": "keyword.control.routing.bird"
},
"2": {
"name": "keyword.other.ip-version.bird"
},
"3": {
"name": "constant.numeric.ip-address.bird"
}
},
"match": "\\b(next hop)\\s+(ipv6)\\s+([:\\h]+)\\b",
"name": "meta.next-hop-ipv6.bird"
},
{
"captures": {
"1": {
"name": "keyword.control.routing.bird"
},
"2": {
"name": "keyword.other.semantic-modifier.bird"
}
},
"match": "\\b(next hop)\\s+(self)\\b",
"name": "meta.next-hop-simple.bird"
},
{
"captures": {
"1": {
"name": "keyword.control.routing.bird"
},
"2": {
"name": "keyword.other.semantic-modifier.bird"
}
},
"match": "\\b(extended next hop)\\s+(o(?:n|ff))\\b",
"name": "meta.extended-next-hop-statement.bird"
}
]
},
"numbers": {
"patterns": [
{
"match": "\\b0x\\h+\\b",
"name": "constant.numeric.hex.bird"
},
{
"match": "\\b[0-9]+\\b",
"name": "constant.numeric.decimal.bird"
},
{
"captures": {
"1": {
"name": "keyword.other.unit.bird"
}
},
"match": "\\b[0-9]+\\s*([mu]??s)\\b",
"name": "constant.numeric.time.bird"
}
]
},
"operators": {
"patterns": [
{
"match": "==|!=|<=|>=|!~|[<=>~]",
"name": "keyword.operator.comparison.bird"
},
{
"match": "&&|\\|\\||!|->",
"name": "keyword.operator.logical.bird"
},
{
"match": "\\+\\+",
"name": "keyword.operator.concat.bird"
},
{
"match": "[-%*+/]",
"name": "keyword.operator.arithmetic.bird"
},
{
"match": "\\.\\.",
"name": "keyword.operator.range.bird"
},
{
"match": "\\.",
"name": "keyword.operator.accessor.bird"
}
]
},
"prefixes": {
"patterns": [
{
"match": "\\b(?:(?:[0-9]{1,3}\\.){3}[0-9]{1,3}|(?:\\h{0,4}:)+\\h{0,4})/[0-9]{1,3}(?:[-+]|\\{[0-9]+,[0-9]+})?\\b",
"name": "constant.numeric.prefix.bird"
}
]
},
"print-statements": {
"patterns": [
{
"begin": "\\b(printn??)\\b",
"beginCaptures": {
"1": {
"name": "keyword.other.print.bird"
}
},
"end": ";",
"endCaptures": {
"0": {
"name": "punctuation.terminator.statement.bird"
}
},
"name": "meta.print-statement.bird",
"patterns": [
{
"include": "$self"
}
]
}
]
},
"protocol-definitions": {
"patterns": [
{
"begin": "\\b(protocol)\\s+([A-Z_a-z][0-9A-Z_a-z]*)\\s+([A-Z_a-z][0-9A-Z_a-z]*|'[-.0-:A-Z_a-z]+')\\s+(from)\\s+([A-Z_a-z][0-9A-Z_a-z]*|'[-.0-:A-Z_a-z]+')\\s*\\{",
"beginCaptures": {
"1": {
"name": "keyword.control.protocol.bird"
},
"2": {
"name": "entity.name.type.protocol.bird"
},
"3": {
"name": "entity.name.function.protocol.bird"
},
"4": {
"name": "keyword.control.template-reference.bird"
},
"5": {
"name": "entity.name.function.template.bird"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.definition.block.end.bird"
}
},
"name": "meta.protocol-definition-with-template.bird",
"patterns": [
{
"include": "$self"
}
]
},
{
"begin": "\\b(protocol)\\s+([A-Z_a-z][0-9A-Z_a-z]*)\\s+([A-Z_a-z][0-9A-Z_a-z]*|'[-.0-:A-Z_a-z]+')\\s*\\{",
"beginCaptures": {
"1": {
"name": "keyword.control.protocol.bird"
},
"2": {
"name": "entity.name.type.protocol.bird"
},
"3": {
"name": "entity.name.function.protocol.bird"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.definition.block.end.bird"
}
},
"name": "meta.protocol-definition-with-name.bird",
"patterns": [
{
"include": "$self"
}
]
},
{
"begin": "\\b(protocol)\\s+([A-Z_a-z][0-9A-Z_a-z]*)\\s*\\{",
"beginCaptures": {
"1": {
"name": "keyword.control.protocol.bird"
},
"2": {
"name": "entity.name.type.protocol.bird"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.definition.block.end.bird"
}
},
"name": "meta.protocol-definition-anonymous.bird",
"patterns": [
{
"include": "$self"
}
]
}
]
},
"protocol-phrases": {
"patterns": [
{
"match": "\\b(?:strict\\s+bind|zero\\s+udp6\\s+checksum\\s+rx|idle\\s+tx\\s+interval|multiplier|keyed|meticulous)\\b",
"name": "keyword.other.bfd.phrase.bird"
},
{
"match": "\\b(?:send\\s+timestamps|rtt\\s+(?:cost|min|max|decay)|next\\s+hop\\s+prefer|prefer|native)\\b",
"name": "keyword.other.babel.phrase.bird"
},
{
"match": "\\b(?:next\\s+hop\\s+(?:self|address|ibgp|ebgp)|link\\s+local\\s+next\\s+hop\\s+format|import\\s+table|export\\s+table|base\\s+table|add\\s+paths|aigp\\s+originate|long\\s+lived\\s+graceful\\s+restart|long\\s+lived\\s+stale\\s+time|dynamic\\s+name(?:\\s+digits)?|free\\s+bind|ttl\\s+security|multihop\\s+password|rr\\s+client|rs\\s+client|advertise\\s+hostname|interpret\\s+communities|deterministic\\s+med|default\\s+bgp_local_pref|default\\s+bgp_med|med\\s+metric|igp\\s+metric|missing\\s+lladdr|gateway\\s+address|forwarding\\s+addressed|gateway\\s+recursive|allow\\s+local\\s+as|allow\\s+bogus\\s+as|originate\\s+community|full\\s+route\\s+table|capabilities|primary)\\b",
"name": "keyword.other.bgp.phrase.bird"
}
]
},
"route-attributes": {
"patterns": [
{
"match": "\\b(?:net|scope|preference|from|gw|proto|source|dest|ifname|ifindex|weight|gw_mpls|gw_mpls_stack|onlink|igp_metric|mpls_label|mpls_policy|mpls_class|bgp_path|bgp_origin|bgp_next_hop|bgp_med|bgp_local_pref|bgp_community|bgp_ext_community|bgp_large_community|bgp_originator_id|bgp_cluster_list|ospf_metric1|ospf_metric2|ospf_tag|ospf_router_id|rip_metric|rip_tag|mypath|mylclist)\\b",
"name": "support.variable.route-attribute.bird"
}
]
},
"semantic-modifiers": {
"patterns": [
{
"match": "\\b(?:self|on|off|remote|extended)\\b",
"name": "keyword.other.semantic-modifier.bird"
}
]
},
"strings": {
"patterns": [
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.bird"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.bird"
}
},
"name": "string.quoted.double.bird",
"patterns": [
{
"match": "\\.",
"name": "constant.character.escape.bird"
}
]
},
{
"match": "'[-.0-:A-Z_a-z]+'",
"name": "entity.name.symbol.quoted.bird"
}
]
},
"structural-keywords": {
"patterns": [
{
"match": "\\b(?:if|then|else|case|for|do|while|break|continue|return|in)\\b",
"name": "keyword.control.bird"
},
{
"match": "\\belse\\s*:",
"name": "keyword.control.case.else.bird"
},
{
"match": "\\b(?:accept|reject|error)\\b",
"name": "keyword.control.flow.bird"
},
{
"match": "\\b(?:protocol|table|define|include|attribute|eval|ipv4|ipv6|local|as|from|where|cost|limit|action)\\b",
"name": "keyword.control.structure.bird"
}
]
},
"symbols": {
"patterns": [
{
"match": "\\b[A-Z_a-z][0-9A-Z_a-z]*\\b",
"name": "variable.other.bird"
}
]
},
"template-definitions": {
"patterns": [
{
"begin": "\\b(template)\\s+([A-Z_a-z][0-9A-Z_a-z]*)\\s+([A-Z_a-z][0-9A-Z_a-z]*|'[-.0-:A-Z_a-z]+')\\s+(from)\\s+([A-Z_a-z][0-9A-Z_a-z]*|'[-.0-:A-Z_a-z]+')\\s*\\{",
"beginCaptures": {
"1": {
"name": "keyword.control.template.bird"
},
"2": {
"name": "entity.name.type.protocol.bird"
},
"3": {
"name": "entity.name.function.template.bird"
},
"4": {
"name": "keyword.control.template-reference.bird"
},
"5": {
"name": "entity.name.function.template.bird"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.definition.block.end.bird"
}
},
"name": "meta.template-definition-with-from.bird",
"patterns": [
{
"include": "$self"
}
]
},
{
"begin": "\\b(template)\\s+([A-Z_a-z][0-9A-Z_a-z]*)\\s+([A-Z_a-z][0-9A-Z_a-z]*|'[-.0-:A-Z_a-z]+')\\s*\\{",
"beginCaptures": {
"1": {
"name": "keyword.control.template.bird"
},
"2": {
"name": "entity.name.type.protocol.bird"
},
"3": {
"name": "entity.name.function.template.bird"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.definition.block.end.bird"
}
},
"name": "meta.template-definition-with-name.bird",
"patterns": [
{
"include": "$self"
}
]
},
{
"begin": "\\b(template)\\s+([A-Z_a-z][0-9A-Z_a-z]*)\\s*\\{",
"beginCaptures": {
"1": {
"name": "keyword.control.template.bird"
},
"2": {
"name": "entity.name.type.protocol.bird"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.definition.block.end.bird"
}
},
"name": "meta.template-definition-anonymous.bird",
"patterns": [
{
"include": "$self"
}
]
}
]
},
"user-variables": {
"patterns": [
{
"match": "\\b[A-Z][0-9A-Z_a-z]*\\b",
"name": "variable.other.user-defined.bird"
}
]
},
"variable-declarations": {
"patterns": [
{
"captures": {
"1": {
"name": "storage.type.bird"
},
"2": {
"name": "variable.other.declaration.bird"
}
},
"match": "\\b((?:int|pair|quad|ip|prefix|ec|lc|rd|enum)\\s+set|int|bool|ip|prefix|rd|pair|quad|ec|lc|string|bytestring|bgpmask|bgppath|clist|eclist|lclist|set|enum|route)\\s+([A-Z_a-z][0-9A-Z_a-z]*)(?:\\s*=|;)",
"name": "meta.variable-declaration.bird"
}
]
},
"vpn-rd": {
"match": "\\b(?:[0-9]+:[0-9]+|[012]:[0-9]+:[0-9]+|(?:[0-9]{1,3}\\.){3}[0-9]{1,3}:[0-9]+)\\b",
"name": "constant.numeric.vpn-rd.bird"
}
},
"scopeName": "source.bird2"
}