Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lexer for properties files #670

Merged
merged 2 commits into from Sep 3, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions lexers/embedded/properties.xml
@@ -0,0 +1,27 @@
<lexer>
<config>
<name>properties</name>
<alias>java-properties</alias>
<filename>*.properties</filename>
<mime_type>text/x-java-properties</mime_type>
</config>
<rules>
<state name="root">
<rule pattern="\s+">
<token type="Text"/>
</rule>
<rule pattern="^[;#!].*">
<token type="CommentSingle"/>
</rule>
<rule pattern="^(.+?)([ \t]*)([=:])([ \t]*)(.*)">
<bygroups>
<token type="NameAttribute"/>
<token type="Text"/>
<token type="Operator"/>
<token type="Text"/>
<token type="LiteralString"/>
</bygroups>
</rule>
</state>
</rules>
</lexer>