From e0c3b66b3e43f7547c7ecd1cf27f75f5b29b9106 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Thu, 23 Mar 2023 16:39:52 +0100 Subject: [PATCH 1/3] Add ISC dhcp config lexer This adds a lexer to parse ISC's dhcpd.conf, https://www.isc.org/dhcp/, this is EOL, but distributions still carry it. It has the keywords that I could find and takes some liberty with LiteralNumber* tokens to return IP, network and MAC addresses. It may be possible to make this somewhat smaller, but haven't pushed for that yet. Signed-off-by: Miek Gieben --- lexers/embedded/iscdhcpd.xml | 112 ++++++++++ lexers/testdata/hlsl.expected | 80 +++---- lexers/testdata/iscdhcpd.actual | 77 +++++++ lexers/testdata/iscdhcpd.expected | 345 ++++++++++++++++++++++++++++++ lexers/testdata/natural.expected | 10 +- 5 files changed, 576 insertions(+), 48 deletions(-) create mode 100644 lexers/embedded/iscdhcpd.xml create mode 100644 lexers/testdata/iscdhcpd.actual create mode 100644 lexers/testdata/iscdhcpd.expected diff --git a/lexers/embedded/iscdhcpd.xml b/lexers/embedded/iscdhcpd.xml new file mode 100644 index 000000000..babfb55bb --- /dev/null +++ b/lexers/embedded/iscdhcpd.xml @@ -0,0 +1,112 @@ + + + ISCdhcpd + iscdhcpd + *.conf + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lexers/testdata/hlsl.expected b/lexers/testdata/hlsl.expected index dcd0491e5..5a296ea26 100644 --- a/lexers/testdata/hlsl.expected +++ b/lexers/testdata/hlsl.expected @@ -1,40 +1,40 @@ -[ - {"type":"KeywordType","value":"float4"}, - {"type":"Text","value":" "}, - {"type":"Name","value":"vertex"}, - {"type":"Punctuation","value":"("}, - {"type":"KeywordType","value":"float3"}, - {"type":"Text","value":" "}, - {"type":"Name","value":"position"}, - {"type":"Punctuation","value":")"}, - {"type":"Text","value":" "}, - {"type":"Punctuation","value":"{"}, - {"type":"Text","value":"\n "}, - {"type":"Keyword","value":"return"}, - {"type":"Text","value":" "}, - {"type":"NameBuiltin","value":"mul"}, - {"type":"Punctuation","value":"("}, - {"type":"Name","value":"projection"}, - {"type":"Punctuation","value":","}, - {"type":"Text","value":" "}, - {"type":"NameBuiltin","value":"mul"}, - {"type":"Punctuation","value":"("}, - {"type":"Name","value":"view"}, - {"type":"Punctuation","value":","}, - {"type":"Text","value":" "}, - {"type":"NameBuiltin","value":"mul"}, - {"type":"Punctuation","value":"("}, - {"type":"Name","value":"model"}, - {"type":"Punctuation","value":","}, - {"type":"Text","value":" "}, - {"type":"KeywordType","value":"float4"}, - {"type":"Punctuation","value":"("}, - {"type":"Name","value":"position"}, - {"type":"Punctuation","value":","}, - {"type":"Text","value":" "}, - {"type":"LiteralNumberFloat","value":"1.0"}, - {"type":"Punctuation","value":"))));"}, - {"type":"Text","value":"\n"}, - {"type":"Punctuation","value":"}"}, - {"type":"Text","value":"\n"} -] \ No newline at end of file +[ + {"type":"KeywordType","value":"float4"}, + {"type":"Text","value":" "}, + {"type":"Name","value":"vertex"}, + {"type":"Punctuation","value":"("}, + {"type":"KeywordType","value":"float3"}, + {"type":"Text","value":" "}, + {"type":"Name","value":"position"}, + {"type":"Punctuation","value":")"}, + {"type":"Text","value":" "}, + {"type":"Punctuation","value":"{"}, + {"type":"Text","value":"\n "}, + {"type":"Keyword","value":"return"}, + {"type":"Text","value":" "}, + {"type":"NameBuiltin","value":"mul"}, + {"type":"Punctuation","value":"("}, + {"type":"Name","value":"projection"}, + {"type":"Punctuation","value":","}, + {"type":"Text","value":" "}, + {"type":"NameBuiltin","value":"mul"}, + {"type":"Punctuation","value":"("}, + {"type":"Name","value":"view"}, + {"type":"Punctuation","value":","}, + {"type":"Text","value":" "}, + {"type":"NameBuiltin","value":"mul"}, + {"type":"Punctuation","value":"("}, + {"type":"Name","value":"model"}, + {"type":"Punctuation","value":","}, + {"type":"Text","value":" "}, + {"type":"KeywordType","value":"float4"}, + {"type":"Punctuation","value":"("}, + {"type":"Name","value":"position"}, + {"type":"Punctuation","value":","}, + {"type":"Text","value":" "}, + {"type":"LiteralNumberFloat","value":"1.0"}, + {"type":"Punctuation","value":"))));"}, + {"type":"Text","value":"\n"}, + {"type":"Punctuation","value":"}"}, + {"type":"Text","value":"\n"} +] diff --git a/lexers/testdata/iscdhcpd.actual b/lexers/testdata/iscdhcpd.actual new file mode 100644 index 000000000..2dfec0a29 --- /dev/null +++ b/lexers/testdata/iscdhcpd.actual @@ -0,0 +1,77 @@ +# dhcpd.conf +# +# Sample configuration file for ISC dhcpd +# +# Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as +# configuration file instead of this file. +# + +# option definitions common to all supported networks... +option domain-name "example.org"; +option domain-name-servers ns1.example.org, ns2.example.org; + +default-lease-time 600; +max-lease-time 7200; + +ddns-update-style none; + +authoritative; + +log-facility local7; + +# This is a very basic subnet declaration. + +subnet 10.254.239.0 netmask 255.255.255.224 { + range 10.254.239.10 10.254.239.20; + option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; +} + +subnet 10.254.239.32 netmask 255.255.255.224 { + range dynamic-bootp 10.254.239.40 10.254.239.60; + option broadcast-address 10.254.239.31; + option routers rtr-239-32-1.example.org; +} + +# A slightly different configuration for an internal subnet. +subnet 10.5.5.0 netmask 255.255.255.224 { + range 10.5.5.26 10.5.5.30; + option domain-name-servers ns1.internal.example.org; + option domain-name "internal.example.org"; + option subnet-mask 255.255.255.224; + option routers 10.5.5.1; + option broadcast-address 10.5.5.31; + default-lease-time 600; + max-lease-time 7200; +} + +host passacaglia { + hardware ethernet 0:0:c0:5d:bd:95; + filename "vmunix.passacaglia"; + server-name "toccata.example.com"; +} + +host fantasia { + hardware ethernet 08:00:07:26:c0:a5; + fixed-address fantasia.example.com; +} + +class "foo" { + match if substring (option vendor-class-identifier, 0, 4) = "S\"UNW"; +} + +shared-network 224-29 { + subnet 10.17.224.0 netmask 255.255.255.0 { + option routers rtr-224.example.org; + } + subnet 10.0.29.0 netmask 255.255.255.0 { + option routers rtr-29.example.org; + } + pool { + allow members of "foo"; + range 10.17.224.10 10.17.224.250; + } + pool { + deny members of "foo"; + range 10.0.29.10 10.0.29.230; + } +} diff --git a/lexers/testdata/iscdhcpd.expected b/lexers/testdata/iscdhcpd.expected new file mode 100644 index 000000000..5b6492959 --- /dev/null +++ b/lexers/testdata/iscdhcpd.expected @@ -0,0 +1,345 @@ +[ + {"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":"Keyword","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":"NameVariable","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":"NameVariable","value":"none"}, + {"type":"Punctuation","value":";"}, + {"type":"Text","value":"\n\n"}, + {"type":"Keyword","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":"NameVariable","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":"NameVariable","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"}, + {"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":"NameVariable","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":"Keyword","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":"NameVariable","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":"Keyword","value":"ethernet"}, + {"type":"Text","value":" "}, + {"type":"LiteralNumberHex","value":"0:0:c0:5d:bd:95"}, + {"type":"Punctuation","value":";"}, + {"type":"Text","value":"\n "}, + {"type":"NameVariable","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":"Keyword","value":"ethernet"}, + {"type":"Text","value":" "}, + {"type":"LiteralNumberHex","value":"08:00:07:26:c0:a5"}, + {"type":"Punctuation","value":";"}, + {"type":"Text","value":"\n "}, + {"type":"Keyword","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":"NameVariable","value":"match"}, + {"type":"Text","value":" "}, + {"type":"Keyword","value":"if"}, + {"type":"Text","value":" "}, + {"type":"NameFunction","value":"substring"}, + {"type":"Text","value":" "}, + {"type":"Punctuation","value":"("}, + {"type":"NameVariable","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":"Punctuation","value":"}"}, + {"type":"Text","value":"\n\n"}, + {"type":"NameVariable","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":"NameVariable","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":"NameVariable","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":"NameVariable","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":"NameVariable","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"} +] diff --git a/lexers/testdata/natural.expected b/lexers/testdata/natural.expected index 7f1bc807d..0e88688ae 100644 --- a/lexers/testdata/natural.expected +++ b/lexers/testdata/natural.expected @@ -16,9 +16,9 @@ {"type":"Other","value":"(A10)"}, {"type":"Text","value":" "}, {"type":"Keyword","value":"INIT"}, - {"type":"Operator","value":"<"}, + {"type":"Operator","value":"\u003c"}, {"type":"LiteralStringSingle","value":"'Hello'"}, - {"type":"Operator","value":">"}, + {"type":"Operator","value":"\u003e"}, {"type":"Text","value":"\n"}, {"type":"LiteralNumberInteger","value":"1"}, {"type":"Text","value":" "}, @@ -48,14 +48,12 @@ {"type":"Text","value":" "}, {"type":"NameVariable","value":"#VAR-NAME-1"}, {"type":"Text","value":"\n\n"}, - {"type":"Keyword","value":"DEFINE"}, {"type":"Text","value":" "}, {"type":"Keyword","value":"SUBROUTINE"}, {"type":"Text","value":" "}, {"type":"NameFunction","value":"MY-SUBROUTINE"}, {"type":"Text","value":"\n"}, - {"type":"Keyword","value":"FOR"}, {"type":"Text","value":" "}, {"type":"NameVariable","value":"#I"}, @@ -68,17 +66,13 @@ {"type":"Text","value":" "}, {"type":"LiteralNumberInteger","value":"10"}, {"type":"Text","value":"\n"}, - {"type":"Keyword","value":"ESCAPE"}, {"type":"Text","value":" "}, {"type":"Keyword","value":"MODULE"}, {"type":"Text","value":"\n"}, - {"type":"Keyword","value":"END-FOR"}, {"type":"Text","value":"\n"}, - {"type":"Keyword","value":"END-SUBROUTINE"}, - {"type":"Text","value":"\n\n"}, {"type":"Keyword","value":"END"}, {"type":"Text","value":"\n\n"} From eda2812796700730d78e3e4327513fe6e8de28ee Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Fri, 24 Mar 2023 10:51:39 +0100 Subject: [PATCH 2/3] revert some non-related changes Signed-off-by: Miek Gieben --- bin/goreleaser | 2 +- lexers/embedded/cfengine3.xml | 3 -- lexers/testdata/hlsl.expected | 80 ++++++++++++++++---------------- lexers/testdata/natural.expected | 10 +++- 4 files changed, 49 insertions(+), 46 deletions(-) diff --git a/bin/goreleaser b/bin/goreleaser index 89655c9f5..95e531870 120000 --- a/bin/goreleaser +++ b/bin/goreleaser @@ -1 +1 @@ -.goreleaser-1.16.2.pkg \ No newline at end of file +.goreleaser-1.5.0.pkg \ No newline at end of file diff --git a/lexers/embedded/cfengine3.xml b/lexers/embedded/cfengine3.xml index 495030505..5c91ac755 100644 --- a/lexers/embedded/cfengine3.xml +++ b/lexers/embedded/cfengine3.xml @@ -111,9 +111,6 @@ - - - diff --git a/lexers/testdata/hlsl.expected b/lexers/testdata/hlsl.expected index 5a296ea26..dcd0491e5 100644 --- a/lexers/testdata/hlsl.expected +++ b/lexers/testdata/hlsl.expected @@ -1,40 +1,40 @@ -[ - {"type":"KeywordType","value":"float4"}, - {"type":"Text","value":" "}, - {"type":"Name","value":"vertex"}, - {"type":"Punctuation","value":"("}, - {"type":"KeywordType","value":"float3"}, - {"type":"Text","value":" "}, - {"type":"Name","value":"position"}, - {"type":"Punctuation","value":")"}, - {"type":"Text","value":" "}, - {"type":"Punctuation","value":"{"}, - {"type":"Text","value":"\n "}, - {"type":"Keyword","value":"return"}, - {"type":"Text","value":" "}, - {"type":"NameBuiltin","value":"mul"}, - {"type":"Punctuation","value":"("}, - {"type":"Name","value":"projection"}, - {"type":"Punctuation","value":","}, - {"type":"Text","value":" "}, - {"type":"NameBuiltin","value":"mul"}, - {"type":"Punctuation","value":"("}, - {"type":"Name","value":"view"}, - {"type":"Punctuation","value":","}, - {"type":"Text","value":" "}, - {"type":"NameBuiltin","value":"mul"}, - {"type":"Punctuation","value":"("}, - {"type":"Name","value":"model"}, - {"type":"Punctuation","value":","}, - {"type":"Text","value":" "}, - {"type":"KeywordType","value":"float4"}, - {"type":"Punctuation","value":"("}, - {"type":"Name","value":"position"}, - {"type":"Punctuation","value":","}, - {"type":"Text","value":" "}, - {"type":"LiteralNumberFloat","value":"1.0"}, - {"type":"Punctuation","value":"))));"}, - {"type":"Text","value":"\n"}, - {"type":"Punctuation","value":"}"}, - {"type":"Text","value":"\n"} -] +[ + {"type":"KeywordType","value":"float4"}, + {"type":"Text","value":" "}, + {"type":"Name","value":"vertex"}, + {"type":"Punctuation","value":"("}, + {"type":"KeywordType","value":"float3"}, + {"type":"Text","value":" "}, + {"type":"Name","value":"position"}, + {"type":"Punctuation","value":")"}, + {"type":"Text","value":" "}, + {"type":"Punctuation","value":"{"}, + {"type":"Text","value":"\n "}, + {"type":"Keyword","value":"return"}, + {"type":"Text","value":" "}, + {"type":"NameBuiltin","value":"mul"}, + {"type":"Punctuation","value":"("}, + {"type":"Name","value":"projection"}, + {"type":"Punctuation","value":","}, + {"type":"Text","value":" "}, + {"type":"NameBuiltin","value":"mul"}, + {"type":"Punctuation","value":"("}, + {"type":"Name","value":"view"}, + {"type":"Punctuation","value":","}, + {"type":"Text","value":" "}, + {"type":"NameBuiltin","value":"mul"}, + {"type":"Punctuation","value":"("}, + {"type":"Name","value":"model"}, + {"type":"Punctuation","value":","}, + {"type":"Text","value":" "}, + {"type":"KeywordType","value":"float4"}, + {"type":"Punctuation","value":"("}, + {"type":"Name","value":"position"}, + {"type":"Punctuation","value":","}, + {"type":"Text","value":" "}, + {"type":"LiteralNumberFloat","value":"1.0"}, + {"type":"Punctuation","value":"))));"}, + {"type":"Text","value":"\n"}, + {"type":"Punctuation","value":"}"}, + {"type":"Text","value":"\n"} +] \ No newline at end of file diff --git a/lexers/testdata/natural.expected b/lexers/testdata/natural.expected index 0e88688ae..7f1bc807d 100644 --- a/lexers/testdata/natural.expected +++ b/lexers/testdata/natural.expected @@ -16,9 +16,9 @@ {"type":"Other","value":"(A10)"}, {"type":"Text","value":" "}, {"type":"Keyword","value":"INIT"}, - {"type":"Operator","value":"\u003c"}, + {"type":"Operator","value":"<"}, {"type":"LiteralStringSingle","value":"'Hello'"}, - {"type":"Operator","value":"\u003e"}, + {"type":"Operator","value":">"}, {"type":"Text","value":"\n"}, {"type":"LiteralNumberInteger","value":"1"}, {"type":"Text","value":" "}, @@ -48,12 +48,14 @@ {"type":"Text","value":" "}, {"type":"NameVariable","value":"#VAR-NAME-1"}, {"type":"Text","value":"\n\n"}, + {"type":"Keyword","value":"DEFINE"}, {"type":"Text","value":" "}, {"type":"Keyword","value":"SUBROUTINE"}, {"type":"Text","value":" "}, {"type":"NameFunction","value":"MY-SUBROUTINE"}, {"type":"Text","value":"\n"}, + {"type":"Keyword","value":"FOR"}, {"type":"Text","value":" "}, {"type":"NameVariable","value":"#I"}, @@ -66,13 +68,17 @@ {"type":"Text","value":" "}, {"type":"LiteralNumberInteger","value":"10"}, {"type":"Text","value":"\n"}, + {"type":"Keyword","value":"ESCAPE"}, {"type":"Text","value":" "}, {"type":"Keyword","value":"MODULE"}, {"type":"Text","value":"\n"}, + {"type":"Keyword","value":"END-FOR"}, {"type":"Text","value":"\n"}, + {"type":"Keyword","value":"END-SUBROUTINE"}, + {"type":"Text","value":"\n\n"}, {"type":"Keyword","value":"END"}, {"type":"Text","value":"\n\n"} From 5f65ec39df2dbda7d1f667baa1d1e9f6126b0805 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Fri, 24 Mar 2023 10:53:35 +0100 Subject: [PATCH 3/3] revert Signed-off-by: Miek Gieben --- bin/goreleaser | 2 +- lexers/embedded/cfengine3.xml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/goreleaser b/bin/goreleaser index 95e531870..89655c9f5 120000 --- a/bin/goreleaser +++ b/bin/goreleaser @@ -1 +1 @@ -.goreleaser-1.5.0.pkg \ No newline at end of file +.goreleaser-1.16.2.pkg \ No newline at end of file diff --git a/lexers/embedded/cfengine3.xml b/lexers/embedded/cfengine3.xml index 5c91ac755..495030505 100644 --- a/lexers/embedded/cfengine3.xml +++ b/lexers/embedded/cfengine3.xml @@ -111,6 +111,9 @@ + + +