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>
* 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 <miek@miek.nl>
* revert some non-related changes
Signed-off-by: Miek Gieben <miek@miek.nl>
* revert
Signed-off-by: Miek Gieben <miek@miek.nl>
---------
Signed-off-by: Miek Gieben <miek@miek.nl>
$(...) is a valid syntax (believe called nakedvar) that should also be
matched by the CFEngine3 lexer.
Fixes: #767
Signed-off-by: Miek Gieben <miek@miek.nl>
* Fix CommentPreproc
Macros (i.e.) CommentPreproc need to be anchored as they are only
allowed to be put on the start of the line. This also solved the
conflict with nakedvar @(....).
Signed-off-by: Miek Gieben <miek@miek.nl>
* Fix NameClass
NameClass (`xxx::`) can _also_ contain variables, so add " and $ to the
allowed list in the regexp. This now also needs to be put earlier to
match before any strings.
Signed-off-by: Miek Gieben <miek@miek.nl>
---------
Signed-off-by: Miek Gieben <miek@miek.nl>
When the YAML block scalar (multiline string) syntax is used with only one line of text, the single line is not matched by the current regexp. It currently only works with at least two lines.
This fixes the regexp by adding a special case for a single line after the first indentation in the block.
Based on the Vim syntax highlighting by Marshall Lochbaum[[0]], with number
parsing from PrismJS highlighter by Christopher Rodriguez[[1]].
The lexed types are selected to be as descriptive as possible while
retaining similar groupings to the Vim highlighter, so the highlighted
code looks familiar to BQN users.
[0]: a436a71a08/editors/vim/syntax/bqn.vim
[1]: 859f99a042