mirror of
https://github.com/alecthomas/chroma.git
synced 2025-02-13 13:28:27 +02:00
This updates the ISC dhcp XML lexer. It: - Fixes functions in function by removed the arglist state, this make NameFunction tokens work. - Adds KeywordType for more words that can open a brace delimited section. - Remove another set of Keyword so that they become NameVariables Note on that latter point, from what I could scrape together from the dhcp manual pages is that there exist 150+ directives/keywords in that syntax, I pondered adding them all, but there lays madness, so sort of took the middle ground, in the hopes it is useful enough to other folks Signed-off-by: Miek Gieben <miek@miek.nl>
357 lines
14 KiB
Plaintext
357 lines
14 KiB
Plaintext
[
|
|
{"type":"Comment","value":"# dhcpd.conf\n#\n# Sample configuration file for ISC dhcpd\n#\n# Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as\n# configuration file instead of this file.\n#\n"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Comment","value":"# option definitions common to all supported networks...\n"},
|
|
{"type":"Keyword","value":"option"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"domain-name"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralString","value":"\"example.org\""},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Keyword","value":"option"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"domain-name-servers"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"ns1.example.org"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"ns2.example.org"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"NameVariable","value":"default-lease-time"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"600"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Keyword","value":"max-lease-time"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"7200"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"NameVariable","value":"ddns-update-style"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordConstant","value":"none"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"NameVariable","value":"authoritative"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"NameVariable","value":"log-facility"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"local7"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"Comment","value":"# This is a very basic subnet declaration.\n"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordType","value":"subnet"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.254.239.0"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordType","value":"netmask"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"255.255.255.224"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"KeywordType","value":"range"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.254.239.10"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.254.239.20"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"option"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"routers"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"rtr-239-0-1.example.org"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"rtr-239-0-2.example.org"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"KeywordType","value":"subnet"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.254.239.32"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordType","value":"netmask"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"255.255.255.224"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"KeywordType","value":"range"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"dynamic-bootp"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.254.239.40"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.254.239.60"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"option"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"broadcast-address"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.254.239.31"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"option"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"routers"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"rtr-239-32-1.example.org"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n\n\n"},
|
|
{"type":"Comment","value":"# A slightly different configuration for an internal subnet.\n"},
|
|
{"type":"KeywordType","value":"subnet"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.5.5.0"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordType","value":"netmask"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"255.255.255.224"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"KeywordType","value":"range"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.5.5.26"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.5.5.30"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"option"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"domain-name-servers"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"ns1.internal.example.org"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"option"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"domain-name"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralString","value":"\"internal.example.org\""},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"option"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordType","value":"subnet"},
|
|
{"type":"NameVariable","value":"-mask"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"255.255.255.224"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"option"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"routers"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.5.5.1"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"option"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"broadcast-address"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.5.5.31"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"NameVariable","value":"default-lease-time"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"600"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"max-lease-time"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"7200"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"KeywordType","value":"host"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"passacaglia"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"hardware"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"ethernet"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberHex","value":"0:0:c0:5d:bd:95"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"filename"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralString","value":"\"vmunix.passacaglia\""},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"NameVariable","value":"server-name"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralString","value":"\"toccata.example.com\""},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"KeywordType","value":"host"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"fantasia"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"hardware"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"ethernet"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberHex","value":"08:00:07:26:c0:a5"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"NameVariable","value":"fixed-address"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"fantasia.example.com"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"KeywordType","value":"class"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralString","value":"\"foo\""},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"match"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Keyword","value":"if"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameFunction","value":"substring"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Keyword","value":"option"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"vendor-class-identifier"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"0"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"4"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Operator","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralString","value":"\"S"},
|
|
{"type":"LiteralStringEscape","value":"\\\""},
|
|
{"type":"LiteralString","value":"UNW\""},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"NameFunction","value":"log"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"NameVariable","value":"info"},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"NameFunction","value":"concat"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"LiteralString","value":"\"SUN request from \""},
|
|
{"type":"Punctuation","value":","},
|
|
{"type":"Keyword","value":"host-decl-name"},
|
|
{"type":"Punctuation","value":"));"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"KeywordType","value":"shared-network"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"224-29"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"KeywordType","value":"subnet"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.17.224.0"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordType","value":"netmask"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"255.255.255.0"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"option"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"routers"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"rtr-224.example.org"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"KeywordType","value":"subnet"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.0.29.0"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"KeywordType","value":"netmask"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"255.255.255.0"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"option"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"routers"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"rtr-29.example.org"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"KeywordType","value":"pool"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"allow"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"members"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"of"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralString","value":"\"foo\""},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"KeywordType","value":"range"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.17.224.10"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.17.224.250"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"KeywordType","value":"pool"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Keyword","value":"deny"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"members"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"NameVariable","value":"of"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralString","value":"\"foo\""},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"KeywordType","value":"range"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.0.29.10"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumberFloat","value":"10.0.29.230"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n"}
|
|
]
|