2023-09-14 22:37:22 +00:00
|
|
|
<lexer>
|
|
|
|
<config>
|
|
|
|
<name>JSON</name>
|
|
|
|
<alias>json</alias>
|
|
|
|
<filename>*.json</filename>
|
2024-03-12 13:18:49 +00:00
|
|
|
<filename>*.avsc</filename>
|
2023-09-14 22:37:22 +00:00
|
|
|
<mime_type>application/json</mime_type>
|
|
|
|
<dot_all>true</dot_all>
|
|
|
|
<not_multiline>true</not_multiline>
|
|
|
|
</config>
|
|
|
|
<rules>
|
|
|
|
<state name="root">
|
|
|
|
<rule>
|
|
|
|
<include state="value"/>
|
|
|
|
</rule>
|
|
|
|
</state>
|
|
|
|
<state name="whitespace">
|
|
|
|
<rule pattern="\s+">
|
|
|
|
<token type="Text"/>
|
|
|
|
</rule>
|
|
|
|
</state>
|
|
|
|
<state name="comment">
|
|
|
|
<rule pattern="//.*?\n">
|
|
|
|
<token type="CommentSingle"/>
|
|
|
|
</rule>
|
|
|
|
</state>
|
|
|
|
<state name="simplevalue">
|
|
|
|
<rule pattern="(true|false|null)\b">
|
|
|
|
<token type="KeywordConstant"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern="-?(0|[1-9]\d*)(\.\d+[eE](\+|-)?\d+|[eE](\+|-)?\d+|\.\d+)">
|
|
|
|
<token type="LiteralNumberFloat"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern="-?(0|[1-9]\d*)">
|
|
|
|
<token type="LiteralNumberInteger"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern=""(\\\\|\\"|[^"])*"">
|
|
|
|
<token type="LiteralStringDouble"/>
|
|
|
|
</rule>
|
|
|
|
</state>
|
|
|
|
<state name="objectattribute">
|
|
|
|
<rule>
|
|
|
|
<include state="value"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern=":">
|
|
|
|
<token type="Punctuation"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern=",">
|
|
|
|
<token type="Punctuation"/>
|
|
|
|
<pop depth="1"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern="\}">
|
|
|
|
<token type="Punctuation"/>
|
|
|
|
<pop depth="2"/>
|
|
|
|
</rule>
|
|
|
|
</state>
|
|
|
|
<state name="objectvalue">
|
|
|
|
<rule>
|
|
|
|
<include state="whitespace"/>
|
|
|
|
</rule>
|
|
|
|
<rule>
|
|
|
|
<include state="comment"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern=""(\\\\|\\"|[^"])*"">
|
|
|
|
<token type="NameTag"/>
|
|
|
|
<push state="objectattribute"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern="\}">
|
|
|
|
<token type="Punctuation"/>
|
|
|
|
<pop depth="1"/>
|
|
|
|
</rule>
|
|
|
|
</state>
|
|
|
|
<state name="arrayvalue">
|
|
|
|
<rule>
|
|
|
|
<include state="whitespace"/>
|
|
|
|
</rule>
|
|
|
|
<rule>
|
|
|
|
<include state="value"/>
|
|
|
|
</rule>
|
|
|
|
<rule>
|
|
|
|
<include state="comment"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern=",">
|
|
|
|
<token type="Punctuation"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern="\]">
|
|
|
|
<token type="Punctuation"/>
|
|
|
|
<pop depth="1"/>
|
|
|
|
</rule>
|
|
|
|
</state>
|
|
|
|
<state name="value">
|
|
|
|
<rule>
|
|
|
|
<include state="whitespace"/>
|
|
|
|
</rule>
|
|
|
|
<rule>
|
|
|
|
<include state="simplevalue"/>
|
|
|
|
</rule>
|
|
|
|
<rule>
|
|
|
|
<include state="comment"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern="\{">
|
|
|
|
<token type="Punctuation"/>
|
|
|
|
<push state="objectvalue"/>
|
|
|
|
</rule>
|
|
|
|
<rule pattern="\[">
|
|
|
|
<token type="Punctuation"/>
|
|
|
|
<push state="arrayvalue"/>
|
|
|
|
</rule>
|
|
|
|
</state>
|
|
|
|
</rules>
|
|
|
|
</lexer>
|