Skip to content

Commit

Permalink
cfengine3 (#766)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
miekg committed Mar 17, 2023
1 parent 7e30655 commit cc132ed
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lexers/embedded/cfengine3.xml
Expand Up @@ -38,7 +38,7 @@
<rule pattern="#.*?\n">
<token type="Comment"/>
</rule>
<rule pattern="@.*?\n">
<rule pattern="^@.*?\n">
<token type="CommentPreproc"/>
</rule>
<rule pattern="(body)(\s+)(\S+)(\s+)(control)">
Expand Down Expand Up @@ -78,6 +78,12 @@
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="([\w.!&amp;|()&#34;&#36;]+)(::)">
<bygroups>
<token type="NameClass"/>
<token type="Punctuation"/>
</bygroups>
</rule>
<rule pattern="&#34;">
<token type="LiteralString"/>
<push state="doublequotestring"/>
Expand All @@ -96,12 +102,6 @@
<token type="Punctuation"/>
</bygroups>
</rule>
<rule pattern="([\w.!&amp;|()]+)(::)">
<bygroups>
<token type="NameClass"/>
<token type="Punctuation"/>
</bygroups>
</rule>
<rule pattern="(\w+)(:)">
<bygroups>
<token type="KeywordDeclaration"/>
Expand Down

0 comments on commit cc132ed

Please sign in to comment.