mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-12-05 00:00:34 +00:00
Initial dumb stuff
This commit is contained in:
parent
1699024e8a
commit
925c570bf3
154
lexers/abap.xml
Normal file
154
lexers/abap.xml
Normal file
@ -0,0 +1,154 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>ABAP</name>
|
||||
<alias>abap</alias>
|
||||
<filename>*.abap</filename>
|
||||
<filename>*.ABAP</filename>
|
||||
<mime_type>text/x-abap</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="common">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="^\*.*$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\".*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="##\w+">
|
||||
<token type="CommentSpecial"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="variable-names">
|
||||
<rule pattern="<\S+>">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="\w[\w~]*(?:(\[\])|->\*)?">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="common"/>
|
||||
</rule>
|
||||
<rule pattern="CALL\s+(?:BADI|CUSTOMER-FUNCTION|FUNCTION)">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(CALL\s+(?:DIALOG|SCREEN|SUBSCREEN|SELECTION-SCREEN|TRANSACTION|TRANSFORMATION))\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(FORM|PERFORM)(\s+)(\w+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(PERFORM)(\s+)(\()(\w+)(\))">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameVariable"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(MODULE)(\s+)(\S+)(\s+)(INPUT|OUTPUT)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(METHOD)(\s+)([\w~]+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\s+)([\w\-]+)([=\-]>)([\w\-~]+)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="NameVariable"/>
|
||||
<token type="Operator"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(?<=(=|-)>)([\w\-~]+)(?=\()">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="(TEXT)(-)(\d{3})">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(TEXT)(-)(\w{3})">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameVariable"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(ADD-CORRESPONDING|AUTHORITY-CHECK|CLASS-DATA|CLASS-EVENTS|CLASS-METHODS|CLASS-POOL|DELETE-ADJACENT|DIVIDE-CORRESPONDING|EDITOR-CALL|ENHANCEMENT-POINT|ENHANCEMENT-SECTION|EXIT-COMMAND|FIELD-GROUPS|FIELD-SYMBOLS|FUNCTION-POOL|INTERFACE-POOL|INVERTED-DATE|LOAD-OF-PROGRAM|LOG-POINT|MESSAGE-ID|MOVE-CORRESPONDING|MULTIPLY-CORRESPONDING|NEW-LINE|NEW-PAGE|NEW-SECTION|NO-EXTENSION|OUTPUT-LENGTH|PRINT-CONTROL|SELECT-OPTIONS|START-OF-SELECTION|SUBTRACT-CORRESPONDING|SYNTAX-CHECK|SYSTEM-EXCEPTIONS|TYPE-POOL|TYPE-POOLS|NO-DISPLAY)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(?<![-\>])(CREATE\s+(PUBLIC|PRIVATE|DATA|OBJECT)|(PUBLIC|PRIVATE|PROTECTED)\s+SECTION|(TYPE|LIKE)\s+((LINE\s+OF|REF\s+TO|(SORTED|STANDARD|HASHED)\s+TABLE\s+OF))?|FROM\s+(DATABASE|MEMORY)|CALL\s+METHOD|(GROUP|ORDER) BY|HAVING|SEPARATED BY|GET\s+(BADI|BIT|CURSOR|DATASET|LOCALE|PARAMETER|PF-STATUS|(PROPERTY|REFERENCE)\s+OF|RUN\s+TIME|TIME\s+(STAMP)?)?|SET\s+(BIT|BLANK\s+LINES|COUNTRY|CURSOR|DATASET|EXTENDED\s+CHECK|HANDLER|HOLD\s+DATA|LANGUAGE|LEFT\s+SCROLL-BOUNDARY|LOCALE|MARGIN|PARAMETER|PF-STATUS|PROPERTY\s+OF|RUN\s+TIME\s+(ANALYZER|CLOCK\s+RESOLUTION)|SCREEN|TITLEBAR|UPADTE\s+TASK\s+LOCAL|USER-COMMAND)|CONVERT\s+((INVERTED-)?DATE|TIME|TIME\s+STAMP|TEXT)|(CLOSE|OPEN)\s+(DATASET|CURSOR)|(TO|FROM)\s+(DATA BUFFER|INTERNAL TABLE|MEMORY ID|DATABASE|SHARED\s+(MEMORY|BUFFER))|DESCRIBE\s+(DISTANCE\s+BETWEEN|FIELD|LIST|TABLE)|FREE\s(MEMORY|OBJECT)?|PROCESS\s+(BEFORE\s+OUTPUT|AFTER\s+INPUT|ON\s+(VALUE-REQUEST|HELP-REQUEST))|AT\s+(LINE-SELECTION|USER-COMMAND|END\s+OF|NEW)|AT\s+SELECTION-SCREEN(\s+(ON(\s+(BLOCK|(HELP|VALUE)-REQUEST\s+FOR|END\s+OF|RADIOBUTTON\s+GROUP))?|OUTPUT))?|SELECTION-SCREEN:?\s+((BEGIN|END)\s+OF\s+((TABBED\s+)?BLOCK|LINE|SCREEN)|COMMENT|FUNCTION\s+KEY|INCLUDE\s+BLOCKS|POSITION|PUSHBUTTON|SKIP|ULINE)|LEAVE\s+(LIST-PROCESSING|PROGRAM|SCREEN|TO LIST-PROCESSING|TO TRANSACTION)(ENDING|STARTING)\s+AT|FORMAT\s+(COLOR|INTENSIFIED|INVERSE|HOTSPOT|INPUT|FRAMES|RESET)|AS\s+(CHECKBOX|SUBSCREEN|WINDOW)|WITH\s+(((NON-)?UNIQUE)?\s+KEY|FRAME)|(BEGIN|END)\s+OF|DELETE(\s+ADJACENT\s+DUPLICATES\sFROM)?|COMPARING(\s+ALL\s+FIELDS)?|(INSERT|APPEND)(\s+INITIAL\s+LINE\s+(IN)?TO|\s+LINES\s+OF)?|IN\s+((BYTE|CHARACTER)\s+MODE|PROGRAM)|END-OF-(DEFINITION|PAGE|SELECTION)|WITH\s+FRAME(\s+TITLE)|(REPLACE|FIND)\s+((FIRST|ALL)\s+OCCURRENCES?\s+OF\s+)?(SUBSTRING|REGEX)?|MATCH\s+(LENGTH|COUNT|LINE|OFFSET)|(RESPECTING|IGNORING)\s+CASE|IN\s+UPDATE\s+TASK|(SOURCE|RESULT)\s+(XML)?|REFERENCE\s+INTO|AND\s+(MARK|RETURN)|CLIENT\s+SPECIFIED|CORRESPONDING\s+FIELDS\s+OF|IF\s+FOUND|FOR\s+EVENT|INHERITING\s+FROM|LEAVE\s+TO\s+SCREEN|LOOP\s+AT\s+(SCREEN)?|LOWER\s+CASE|MATCHCODE\s+OBJECT|MODIF\s+ID|MODIFY\s+SCREEN|NESTING\s+LEVEL|NO\s+INTERVALS|OF\s+STRUCTURE|RADIOBUTTON\s+GROUP|RANGE\s+OF|REF\s+TO|SUPPRESS DIALOG|TABLE\s+OF|UPPER\s+CASE|TRANSPORTING\s+NO\s+FIELDS|VALUE\s+CHECK|VISIBLE\s+LENGTH|HEADER\s+LINE|COMMON\s+PART)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(^|(?<=(\s|\.)))(ABBREVIATED|ABSTRACT|ADD|ALIASES|ALIGN|ALPHA|ASSERT|AS|ASSIGN(ING)?|AT(\s+FIRST)?|BACK|BLOCK|BREAK-POINT|CASE|CATCH|CHANGING|CHECK|CLASS|CLEAR|COLLECT|COLOR|COMMIT|CREATE|COMMUNICATION|COMPONENTS?|COMPUTE|CONCATENATE|CONDENSE|CONSTANTS|CONTEXTS|CONTINUE|CONTROLS|COUNTRY|CURRENCY|DATA|DATE|DECIMALS|DEFAULT|DEFINE|DEFINITION|DEFERRED|DEMAND|DETAIL|DIRECTORY|DIVIDE|DO|DUMMY|ELSE(IF)?|ENDAT|ENDCASE|ENDCATCH|ENDCLASS|ENDDO|ENDFORM|ENDFUNCTION|ENDIF|ENDINTERFACE|ENDLOOP|ENDMETHOD|ENDMODULE|ENDSELECT|ENDTRY|ENDWHILE|ENHANCEMENT|EVENTS|EXACT|EXCEPTIONS?|EXIT|EXPONENT|EXPORT|EXPORTING|EXTRACT|FETCH|FIELDS?|FOR|FORM|FORMAT|FREE|FROM|FUNCTION|HIDE|ID|IF|IMPORT|IMPLEMENTATION|IMPORTING|IN|INCLUDE|INCLUDING|INDEX|INFOTYPES|INITIALIZATION|INTERFACE|INTERFACES|INTO|LANGUAGE|LEAVE|LENGTH|LINES|LOAD|LOCAL|JOIN|KEY|NEXT|MAXIMUM|MESSAGE|METHOD[S]?|MINIMUM|MODULE|MODIFIER|MODIFY|MOVE|MULTIPLY|NODES|NUMBER|OBLIGATORY|OBJECT|OF|OFF|ON|OTHERS|OVERLAY|PACK|PAD|PARAMETERS|PERCENTAGE|POSITION|PROGRAM|PROVIDE|PUBLIC|PUT|PF\d\d|RAISE|RAISING|RANGES?|READ|RECEIVE|REDEFINITION|REFRESH|REJECT|REPORT|RESERVE|RESUME|RETRY|RETURN|RETURNING|RIGHT|ROLLBACK|REPLACE|SCROLL|SEARCH|SELECT|SHIFT|SIGN|SINGLE|SIZE|SKIP|SORT|SPLIT|STATICS|STOP|STYLE|SUBMATCHES|SUBMIT|SUBTRACT|SUM(?!\()|SUMMARY|SUMMING|SUPPLY|TABLE|TABLES|TIMESTAMP|TIMES?|TIMEZONE|TITLE|\??TO|TOP-OF-PAGE|TRANSFER|TRANSLATE|TRY|TYPES|ULINE|UNDER|UNPACK|UPDATE|USING|VALUE|VALUES|VIA|VARYING|VARY|WAIT|WHEN|WHERE|WIDTH|WHILE|WITH|WINDOW|WRITE|XSD|ZERO)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(abs|acos|asin|atan|boolc|boolx|bit_set|char_off|charlen|ceil|cmax|cmin|condense|contains|contains_any_of|contains_any_not_of|concat_lines_of|cos|cosh|count|count_any_of|count_any_not_of|dbmaxlen|distance|escape|exp|find|find_end|find_any_of|find_any_not_of|floor|frac|from_mixed|insert|lines|log|log10|match|matches|nmax|nmin|numofchar|repeat|replace|rescale|reverse|round|segment|shift_left|shift_right|sign|sin|sinh|sqrt|strlen|substring|substring_after|substring_from|substring_before|substring_to|tan|tanh|to_upper|to_lower|to_mixed|translate|trunc|xstrlen)(\()\b">
|
||||
<bygroups>
|
||||
<token type="NameBuiltin"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="&[0-9]">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9]+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=(\s|.))(AND|OR|EQ|NE|GT|LT|GE|LE|CO|CN|CA|NA|CS|NOT|NS|CP|NP|BYTE-CO|BYTE-CN|BYTE-CA|BYTE-NA|BYTE-CS|BYTE-NS|IS\s+(NOT\s+)?(INITIAL|ASSIGNED|REQUESTED|BOUND))\b">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="variable-names"/>
|
||||
</rule>
|
||||
<rule pattern="[?*<>=\-+&]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="'(''|[^'])*'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="`([^`])*`">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="([|}])([^{}|]*?)([|{])">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="LiteralStringSingle"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[/;:()\[\],.]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(!)(\w+)">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="Name"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
66
lexers/abnf.xml
Normal file
66
lexers/abnf.xml
Normal file
@ -0,0 +1,66 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>ABNF</name>
|
||||
<alias>abnf</alias>
|
||||
<filename>*.abnf</filename>
|
||||
<mime_type>text/x-abnf</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern=";.*$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="(%[si])?"[^"]*"">
|
||||
<token type="Literal"/>
|
||||
</rule>
|
||||
<rule pattern="%b[01]+\-[01]+\b">
|
||||
<token type="Literal"/>
|
||||
</rule>
|
||||
<rule pattern="%b[01]+(\.[01]+)*\b">
|
||||
<token type="Literal"/>
|
||||
</rule>
|
||||
<rule pattern="%d[0-9]+\-[0-9]+\b">
|
||||
<token type="Literal"/>
|
||||
</rule>
|
||||
<rule pattern="%d[0-9]+(\.[0-9]+)*\b">
|
||||
<token type="Literal"/>
|
||||
</rule>
|
||||
<rule pattern="%x[0-9a-fA-F]+\-[0-9a-fA-F]+\b">
|
||||
<token type="Literal"/>
|
||||
</rule>
|
||||
<rule pattern="%x[0-9a-fA-F]+(\.[0-9a-fA-F]+)*\b">
|
||||
<token type="Literal"/>
|
||||
</rule>
|
||||
<rule pattern="\b[0-9]+\*[0-9]+">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\b[0-9]+\*">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\b[0-9]+">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\*">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="(HEXDIG|DQUOTE|DIGIT|VCHAR|OCTET|ALPHA|CHAR|CRLF|HTAB|LWSP|BIT|CTL|WSP|LF|SP|CR)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z][a-zA-Z0-9-]+\b">
|
||||
<token type="NameClass"/>
|
||||
</rule>
|
||||
<rule pattern="(=/|=|/)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[\[\]()]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern=".">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
68
lexers/actionscript.xml
Normal file
68
lexers/actionscript.xml
Normal file
@ -0,0 +1,68 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>ActionScript</name>
|
||||
<alias>as</alias>
|
||||
<alias>actionscript</alias>
|
||||
<filename>*.as</filename>
|
||||
<mime_type>application/x-actionscript</mime_type>
|
||||
<mime_type>text/x-actionscript</mime_type>
|
||||
<mime_type>text/actionscript</mime_type>
|
||||
<dot_all>true</dot_all>
|
||||
<not_multiline>true</not_multiline>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/\*.*?\*/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\\\|\\/|[^/\n])*/[gim]*">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="[~^*!%&<>|+=:;,/?\\-]+">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[{}\[\]();.]+">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(instanceof|arguments|continue|default|typeof|switch|return|catch|break|while|throw|each|this|with|else|case|var|new|for|try|if|do|in)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(implements|protected|namespace|interface|intrinsic|override|function|internal|private|package|extends|dynamic|import|native|return|public|static|class|const|super|final|get|set)\b">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="(true|false|null|NaN|Infinity|-Infinity|undefined|Void)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(IDynamicPropertyOutputIDynamicPropertyWriter|DisplacmentMapFilterMode|AccessibilityProperties|ContextMenuBuiltInItems|SharedObjectFlushStatus|DisplayObjectContainer|IllegalOperationError|DisplacmentMapFilter|InterpolationMethod|URLLoaderDataFormat|PrintJobOrientation|ActionScriptVersion|BitmapFilterQuality|GradientBevelFilter|GradientGlowFilter|DeleteObjectSample|StackOverflowError|SoundLoaderContext|ScriptTimeoutError|SecurityErrorEvent|InteractiveObject|StageDisplayState|FileReferenceList|TextFieldAutoSize|ApplicationDomain|BitmapDataChannel|ColorMatrixFilter|ExternalInterface|IMEConversionMode|DropShadowFilter|URLRequestHeader|ContextMenuEvent|ConvultionFilter|URLRequestMethod|BitmapFilterType|IEventDispatcher|ContextMenuItem|LocalConnection|InvalidSWFError|AsyncErrorEvent|MovieClipLoader|IBitmapDrawable|PrintJobOptions|EventDispatcher|NewObjectSample|HTTPStatusEvent|TextFormatAlign|IExternalizable|FullScreenEvent|DefinitionError|TextLineMetrics|NetStatusEvent|ColorTransform|ObjectEncoding|SecurityDomain|StageScaleMode|FocusDirection|ReferenceError|SoundTransform|KeyboardEvent|DisplayObject|PixelSnapping|LoaderContext|NetConnection|SecurityPanel|SecurityError|FileReference|AsBroadcaster|LineScaleMode|AntiAliasType|Accessibility|TextFieldType|URLVariabeles|ActivityEvent|ProgressEvent|TextColorType|StageQuality|TextSnapshot|Capabilities|BitmapFilter|SpreadMethod|GradientType|TextRenderer|SoundChannel|SharedObject|IOErrorEvent|SimpleButton|ContextMenu|InvokeEvent|CSMSettings|SyntaxError|StatusEvent|KeyLocation|IDataOutput|VerifyError|XMLDocument|XMLNodeType|MemoryError|GridFitType|BevelFilter|ErrorEvent|FrameLabel|GlowFilter|LoaderInfo|Microphone|MorphShape|BlurFilter|MouseEvent|FocusEvent|SoundMixer|FileFilter|TimerEvent|JointStyle|EventPhase|StageAlign|Dictionary|URLRequest|StyleSheet|SWFVersion|IDataInput|StaticText|RangeError|BitmapData|TextFormat|StackFrame|Namespace|SyncEvent|Rectangle|URLLoader|TypeError|Responder|NetStream|BlendMode|CapsStyle|DataEvent|ByteArray|MovieClip|Transform|TextField|Selection|AVM1Movie|XMLSocket|URLStream|FontStyle|EvalError|FontType|LoadVars|Graphics|Security|IMEEvent|URIError|Keyboard|Function|EOFError|PrintJob|IOError|XMLList|Boolean|ID3Info|XMLNode|Bitmap|String|RegExp|Sample|Object|Sprite|System|Endian|Matrix|Camera|Locale|Number|Loader|Socket|QName|Class|Timer|Sound|Shape|XMLUI|Mouse|Scene|Stage|Color|Point|Video|Error|Event|Proxy|Array|Date|uint|Math|Font|int|Key|IME|XML)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(decodeURIComponent|updateAfterEvent|clearInterval|setInterval|getVersion|parseFloat|fscommand|isXMLName|encodeURI|decodeURI|getTimer|unescape|isFinite|parseInt|getURL|escape|trace|isNaN|eval)\b">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="[$a-zA-Z_]\w*">
|
||||
<token type="NameOther"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0x[0-9a-f]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9]+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="'(\\\\|\\'|[^'])*'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
163
lexers/actionscript_3.xml
Normal file
163
lexers/actionscript_3.xml
Normal file
@ -0,0 +1,163 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>ActionScript 3</name>
|
||||
<alias>as3</alias>
|
||||
<alias>actionscript3</alias>
|
||||
<filename>*.as</filename>
|
||||
<mime_type>application/x-actionscript3</mime_type>
|
||||
<mime_type>text/x-actionscript3</mime_type>
|
||||
<mime_type>text/actionscript3</mime_type>
|
||||
<dot_all>true</dot_all>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="funcparams">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="(\s*)(\.\.\.)?([$a-zA-Z_]\w*)(\s*)(:)(\s*)([$a-zA-Z_]\w*(?:\.<\w+>)?|\*)(\s*)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Name"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
<token type="Text"/>
|
||||
<token type="KeywordType"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="defval"/>
|
||||
</rule>
|
||||
<rule pattern="\)">
|
||||
<token type="Operator"/>
|
||||
<push state="type"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="type">
|
||||
<rule pattern="(\s*)(:)(\s*)([$a-zA-Z_]\w*(?:\.<\w+>)?|\*)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
<token type="Text"/>
|
||||
<token type="KeywordType"/>
|
||||
</bygroups>
|
||||
<pop depth="2"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
<pop depth="2"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="2"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="defval">
|
||||
<rule pattern="(=)(\s*)([^(),]+)(\s*)(,?)">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="Text"/>
|
||||
<usingself state="root"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern=",">
|
||||
<token type="Operator"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="(function\s+)([$a-zA-Z_]\w*)(\s*)(\()">
|
||||
<bygroups>
|
||||
<token type="KeywordDeclaration"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
<push state="funcparams"/>
|
||||
</rule>
|
||||
<rule pattern="(var|const)(\s+)([$a-zA-Z_]\w*)(\s*)(:)(\s*)([$a-zA-Z_]\w*(?:\.<\w+>)?)">
|
||||
<bygroups>
|
||||
<token type="KeywordDeclaration"/>
|
||||
<token type="Text"/>
|
||||
<token type="Name"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="KeywordType"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(import|package)(\s+)((?:[$a-zA-Z_]\w*|\.)+)(\s*)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameNamespace"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(new)(\s+)([$a-zA-Z_]\w*(?:\.<\w+>)?)(\s*)(\()">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="KeywordType"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/\*.*?\*/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\\\|\\/|[^\n])*/[gisx]*">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="(\.)([$a-zA-Z_]\w*)">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="NameAttribute"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(case|default|for|each|in|while|do|break|return|continue|if|else|throw|try|catch|with|new|typeof|arguments|instanceof|this|switch|import|include|as|is)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(class|public|final|internal|native|override|private|protected|static|import|extends|implements|interface|intrinsic|return|super|dynamic|function|const|get|namespace|package|set)\b">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="(true|false|null|NaN|Infinity|-Infinity|undefined|void)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(decodeURI|decodeURIComponent|encodeURI|escape|eval|isFinite|isNaN|isXMLName|clearInterval|fscommand|getTimer|getURL|getVersion|isFinite|parseFloat|parseInt|setInterval|trace|updateAfterEvent|unescape)\b">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="[$a-zA-Z_]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0x[0-9a-f]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9]+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="'(\\\\|\\'|[^'])*'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="[~^*!%&<>|+=:;,/?\\{}\[\]().-]+">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
321
lexers/ada.xml
Normal file
321
lexers/ada.xml
Normal file
@ -0,0 +1,321 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Ada</name>
|
||||
<alias>ada</alias>
|
||||
<alias>ada95</alias>
|
||||
<alias>ada2005</alias>
|
||||
<filename>*.adb</filename>
|
||||
<filename>*.ads</filename>
|
||||
<filename>*.ada</filename>
|
||||
<mime_type>text/x-ada</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="end">
|
||||
<rule pattern="(if|case|record|loop|select)">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern=""[^"]+"|[\w.]+">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern=";">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="array_def">
|
||||
<rule pattern=";">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(\w+)(\s+)(range)">
|
||||
<bygroups>
|
||||
<token type="KeywordType"/>
|
||||
<token type="Text"/>
|
||||
<token type="KeywordReserved"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="package_instantiation">
|
||||
<rule pattern="("[^"]+"|\w+)(\s+)(=>)">
|
||||
<bygroups>
|
||||
<token type="NameVariable"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[\w.\'"]">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\)">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="subprogram">
|
||||
<rule pattern="\(">
|
||||
<token type="Punctuation"/>
|
||||
<push state="#pop" state="formal_part"/>
|
||||
</rule>
|
||||
<rule pattern=";">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="is\b">
|
||||
<token type="KeywordReserved"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern=""[^"]+"|\w+">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="type_def">
|
||||
<rule pattern=";">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="Punctuation"/>
|
||||
<push state="formal_part"/>
|
||||
</rule>
|
||||
<rule pattern="with|and|use">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="array\b">
|
||||
<token type="KeywordReserved"/>
|
||||
<push state="#pop" state="array_def"/>
|
||||
</rule>
|
||||
<rule pattern="record\b">
|
||||
<token type="KeywordReserved"/>
|
||||
<push state="record_def"/>
|
||||
</rule>
|
||||
<rule pattern="(null record)(;)">
|
||||
<bygroups>
|
||||
<token type="KeywordReserved"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="import">
|
||||
<rule pattern="[\w.]+">
|
||||
<token type="NameNamespace"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="formal_part">
|
||||
<rule pattern="\)">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\w+">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern=",|:[^=]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(in|not|null|out|access)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="package">
|
||||
<rule pattern="body">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="is\s+new|renames">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="is">
|
||||
<token type="KeywordReserved"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern=";">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="Punctuation"/>
|
||||
<push state="package_instantiation"/>
|
||||
</rule>
|
||||
<rule pattern="([\w.]+)">
|
||||
<token type="NameClass"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="attribute">
|
||||
<rule pattern="(')(\w+)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameAttribute"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="record_def">
|
||||
<rule pattern="end record">
|
||||
<token type="KeywordReserved"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="[^\S\n]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="--.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="[^\S\n]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="function|procedure|entry">
|
||||
<token type="KeywordDeclaration"/>
|
||||
<push state="subprogram"/>
|
||||
</rule>
|
||||
<rule pattern="(subtype|type)(\s+)(\w+)">
|
||||
<bygroups>
|
||||
<token type="KeywordDeclaration"/>
|
||||
<token type="Text"/>
|
||||
<token type="KeywordType"/>
|
||||
</bygroups>
|
||||
<push state="type_def"/>
|
||||
</rule>
|
||||
<rule pattern="task|protected">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="(subtype)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordDeclaration"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(end)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordReserved"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="end"/>
|
||||
</rule>
|
||||
<rule pattern="(pragma)(\s+)(\w+)">
|
||||
<bygroups>
|
||||
<token type="KeywordReserved"/>
|
||||
<token type="Text"/>
|
||||
<token type="CommentPreproc"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(true|false|null)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(Short_Short_Integer|Short_Short_Float|Long_Long_Integer|Long_Long_Float|Wide_Character|Reference_Type|Short_Integer|Long_Integer|Wide_String|Short_Float|Controlled|Long_Float|Character|Generator|File_Type|File_Mode|Positive|Duration|Boolean|Natural|Integer|Address|Cursor|String|Count|Float|Byte)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(and(\s+then)?|in|mod|not|or(\s+else)|rem)\b">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
<rule pattern="generic|private">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="package">
|
||||
<token type="KeywordDeclaration"/>
|
||||
<push state="package"/>
|
||||
</rule>
|
||||
<rule pattern="array\b">
|
||||
<token type="KeywordReserved"/>
|
||||
<push state="array_def"/>
|
||||
</rule>
|
||||
<rule pattern="(with|use)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="import"/>
|
||||
</rule>
|
||||
<rule pattern="(\w+)(\s*)(:)(\s*)(constant)">
|
||||
<bygroups>
|
||||
<token type="NameConstant"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="KeywordReserved"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="<<\w+>>">
|
||||
<token type="NameLabel"/>
|
||||
</rule>
|
||||
<rule pattern="(\w+)(\s*)(:)(\s*)(declare|begin|loop|for|while)">
|
||||
<bygroups>
|
||||
<token type="NameLabel"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="KeywordReserved"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b(synchronized|overriding|terminate|interface|exception|protected|separate|constant|abstract|renames|reverse|subtype|aliased|declare|requeue|limited|return|tagged|access|record|select|accept|digits|others|pragma|entry|elsif|delta|delay|array|until|range|raise|while|begin|abort|else|loop|when|type|null|then|body|task|goto|case|exit|end|for|abs|xor|all|new|out|is|of|if|or|do|at)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern=""[^"]*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="attribute"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="numbers"/>
|
||||
</rule>
|
||||
<rule pattern="'[^']'">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="(\w+)(\s*|[(,])">
|
||||
<bygroups>
|
||||
<token type="Name"/>
|
||||
<usingself state="root"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(<>|=>|:=|[()|:;,.'])">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[*<>+=/&-]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\n+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="numbers">
|
||||
<rule pattern="[0-9_]+#[0-9a-f]+#">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9_]+\.[0-9_]*">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9_]+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
66
lexers/agda.xml
Normal file
66
lexers/agda.xml
Normal file
@ -0,0 +1,66 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Agda</name>
|
||||
<alias>agda</alias>
|
||||
<filename>*.agda</filename>
|
||||
<mime_type>text/x-agda</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="^(\s*)([^\s(){}]+)(\s*)(:)(\s*)"><bygroups><token type="TextWhitespace"/><token type="NameFunction"/><token type="TextWhitespace"/><token type="OperatorWord"/><token type="TextWhitespace"/></bygroups></rule>
|
||||
<rule pattern="--(?![!#$%&*+./<=>?@^|_~:\\]).*?$"><token type="CommentSingle"/></rule>
|
||||
<rule pattern="\{-"><token type="CommentMultiline"/><push state="comment"/></rule>
|
||||
<rule pattern="\{!"><token type="CommentMultiline"/><push state="hole"/></rule>
|
||||
<rule pattern="\b(abstract|codata|coinductive|constructor|data|do|eta-equality|field|forall|hiding|in|inductive|infix|infixl|infixr|instance|interleaved|let|macro|mutual|no-eta-equality|open|overlap|pattern|postulate|primitive|private|quote|quoteTerm|record|renaming|rewrite|syntax|tactic|unquote|unquoteDecl|unquoteDef|using|variable|where|with)(?!\')\b"><token type="KeywordReserved"/></rule>
|
||||
<rule pattern="(import|module)(\s+)"><bygroups><token type="KeywordReserved"/><token type="TextWhitespace"/></bygroups><push state="module"/></rule>
|
||||
<rule pattern="\b(Set|Prop)[\u2080-\u2089]*\b"><token type="KeywordType"/></rule>
|
||||
<rule pattern="(\(|\)|\{|\})"><token type="Operator"/></rule>
|
||||
<rule pattern="(\.{1,3}|\||\u03BB|\u2200|\u2192|:|=|->)"><token type="OperatorWord"/></rule>
|
||||
<rule pattern="\d+[eE][+-]?\d+"><token type="LiteralNumberFloat"/></rule>
|
||||
<rule pattern="\d+\.\d+([eE][+-]?\d+)?"><token type="LiteralNumberFloat"/></rule>
|
||||
<rule pattern="0[xX][\da-fA-F]+"><token type="LiteralNumberHex"/></rule>
|
||||
<rule pattern="\d+"><token type="LiteralNumberInteger"/></rule>
|
||||
<rule pattern="'"><token type="LiteralStringChar"/><push state="character"/></rule>
|
||||
<rule pattern="""><token type="LiteralString"/><push state="string"/></rule>
|
||||
<rule pattern="[^\s(){}]+"><token type="Text"/></rule>
|
||||
<rule pattern="\s+?"><token type="TextWhitespace"/></rule>
|
||||
</state>
|
||||
<state name="hole">
|
||||
<rule pattern="[^!{}]+"><token type="CommentMultiline"/></rule>
|
||||
<rule pattern="\{!"><token type="CommentMultiline"/><push/></rule>
|
||||
<rule pattern="!\}"><token type="CommentMultiline"/><pop depth="1"/></rule>
|
||||
<rule pattern="[!{}]"><token type="CommentMultiline"/></rule>
|
||||
</state>
|
||||
<state name="module">
|
||||
<rule pattern="\{-"><token type="CommentMultiline"/><push state="comment"/></rule>
|
||||
<rule pattern="[a-zA-Z][\w.\']*"><token type="Name"/><pop depth="1"/></rule>
|
||||
<rule pattern="[\W0-9_]+"><token type="Text"/></rule>
|
||||
</state>
|
||||
<state name="comment">
|
||||
<rule pattern="[^-{}]+"><token type="CommentMultiline"/></rule>
|
||||
<rule pattern="\{-"><token type="CommentMultiline"/><push/></rule>
|
||||
<rule pattern="-\}"><token type="CommentMultiline"/><pop depth="1"/></rule>
|
||||
<rule pattern="[-{}]"><token type="CommentMultiline"/></rule>
|
||||
</state>
|
||||
<state name="character">
|
||||
<rule pattern="[^\\']'"><token type="LiteralStringChar"/><pop depth="1"/></rule>
|
||||
<rule pattern="\\"><token type="LiteralStringEscape"/><push state="escape"/></rule>
|
||||
<rule pattern="'"><token type="LiteralStringChar"/><pop depth="1"/></rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern="[^\\"]+"><token type="LiteralString"/></rule>
|
||||
<rule pattern="\\"><token type="LiteralStringEscape"/><push state="escape"/></rule>
|
||||
<rule pattern="""><token type="LiteralString"/><pop depth="1"/></rule>
|
||||
</state>
|
||||
<state name="escape">
|
||||
<rule pattern="[abfnrtv"\'&\\]"><token type="LiteralStringEscape"/><pop depth="1"/></rule>
|
||||
<rule pattern="\^[][A-ZÀ-ÖØ-ÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸ-ŹŻŽƁ-ƂƄƆ-ƇƉ-ƋƎ-ƑƓ-ƔƖ-ƘƜ-ƝƟ-ƠƢƤƦ-ƧƩƬƮ-ƯƱ-ƳƵƷ-ƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶ-ǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺ-ȻȽ-ȾɁɃ-ɆɈɊɌɎͰͲͶͿΆΈ-ΊΌΎ-ΏΑ-ΡΣ-ΫϏϒ-ϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹ-ϺϽ-ЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀ-ӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԨԪԬԮԱ-ՖႠ-ჅჇჍᎠ-ᏵᲐ-ᲺᲽ-ᲿḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈ-ἏἘ-ἝἨ-ἯἸ-ἿὈ-ὍὙὛὝὟὨ-ὯᾸ-ΆῈ-ΉῘ-ΊῨ-ῬῸ-Ώℂℇℋ-ℍℐ-ℒℕℙ-ℝℤΩℨK-ℭℰ-ℳℾ-ℿⅅↃⰀ-ⰮⱠⱢ-ⱤⱧⱩⱫⱭ-ⱰⱲⱵⱾ-ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙠꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꚘꚚꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝽ-ꝾꞀꞂꞄꞆꞋꞍꞐꞒꞖꞘꞚꞜꞞꞠꞢꞤꞦꞨꞪ-ꞮꞰ-ꞴꞶꞸA-Z𐐀-𐐧𐒰-𐓓𐲀-𐲲𑢠-𑢿𖹀-𖹟𝐀-𝐙𝐴-𝑍𝑨-𝒁𝒜𝒞-𝒟𝒢𝒥-𝒦𝒩-𝒬𝒮-𝒵𝓐-𝓩𝔄-𝔅𝔇-𝔊𝔍-𝔔𝔖-𝔜𝔸-𝔹𝔻-𝔾𝕀-𝕄𝕆𝕊-𝕐𝕬-𝖅𝖠-𝖹𝗔-𝗭𝘈-𝘡𝘼-𝙕𝙰-𝚉𝚨-𝛀𝛢-𝛺𝜜-𝜴𝝖-𝝮𝞐-𝞨𝟊𞤀-𞤡@^_]"><token type="LiteralStringEscape"/><pop depth="1"/></rule>
|
||||
<rule pattern="NUL|SOH|[SE]TX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|S[OI]|DLE|DC[1-4]|NAK|SYN|ETB|CAN|EM|SUB|ESC|[FGRU]S|SP|DEL"><token type="LiteralStringEscape"/><pop depth="1"/></rule>
|
||||
<rule pattern="o[0-7]+"><token type="LiteralStringEscape"/><pop depth="1"/></rule>
|
||||
<rule pattern="x[\da-fA-F]+"><token type="LiteralStringEscape"/><pop depth="1"/></rule>
|
||||
<rule pattern="\d+"><token type="LiteralStringEscape"/><pop depth="1"/></rule>
|
||||
<rule pattern="(\s+)(\\)"><bygroups><token type="TextWhitespace"/><token type="LiteralStringEscape"/></bygroups><pop depth="1"/></rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
||||
|
75
lexers/al.xml
Normal file
75
lexers/al.xml
Normal file
@ -0,0 +1,75 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>AL</name>
|
||||
<alias>al</alias>
|
||||
<filename>*.al</filename>
|
||||
<filename>*.dal</filename>
|
||||
<mime_type>text/x-al</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
<dot_all>true</dot_all>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="(?s)\/\*.*?\\*\*\/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="(?s)//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\"([^\"])*\"">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="'([^'])*'">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\b(?i:(ARRAY|ASSERTERROR|BEGIN|BREAK|CASE|DO|DOWNTO|ELSE|END|EVENT|EXIT|FOR|FOREACH|FUNCTION|IF|IMPLEMENTS|IN|INDATASET|INTERFACE|INTERNAL|LOCAL|OF|PROCEDURE|PROGRAM|PROTECTED|REPEAT|RUNONCLIENT|SECURITYFILTERING|SUPPRESSDISPOSE|TEMPORARY|THEN|TO|TRIGGER|UNTIL|VAR|WHILE|WITH|WITHEVENTS))\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\b(?i:(AND|DIV|MOD|NOT|OR|XOR))\b">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
<rule pattern="\b(?i:(AVERAGE|CONST|COUNT|EXIST|FIELD|FILTER|LOOKUP|MAX|MIN|ORDER|SORTING|SUM|TABLEDATA|UPPERLIMIT|WHERE|ASCENDING|DESCENDING))\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\b(?i:(CODEUNIT|PAGE|PAGEEXTENSION|PAGECUSTOMIZATION|DOTNET|ENUM|ENUMEXTENSION|VALUE|QUERY|REPORT|TABLE|TABLEEXTENSION|XMLPORT|PROFILE|CONTROLADDIN|REPORTEXTENSION|INTERFACE|PERMISSIONSET|PERMISSIONSETEXTENSION|ENTITLEMENT))\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\b(?i:(Action|Array|Automation|BigInteger|BigText|Blob|Boolean|Byte|Char|ClientType|Code|Codeunit|CompletionTriggerErrorLevel|ConnectionType|Database|DataClassification|DataScope|Date|DateFormula|DateTime|Decimal|DefaultLayout|Dialog|Dictionary|DotNet|DotNetAssembly|DotNetTypeDeclaration|Duration|Enum|ErrorInfo|ErrorType|ExecutionContext|ExecutionMode|FieldClass|FieldRef|FieldType|File|FilterPageBuilder|Guid|InStream|Integer|Joker|KeyRef|List|ModuleDependencyInfo|ModuleInfo|None|Notification|NotificationScope|ObjectType|Option|OutStream|Page|PageResult|Query|Record|RecordId|RecordRef|Report|ReportFormat|SecurityFilter|SecurityFiltering|Table|TableConnectionType|TableFilter|TestAction|TestField|TestFilterField|TestPage|TestPermissions|TestRequestPage|Text|TextBuilder|TextConst|TextEncoding|Time|TransactionModel|TransactionType|Variant|Verbosity|Version|XmlPort|HttpContent|HttpHeaders|HttpClient|HttpRequestMessage|HttpResponseMessage|JsonToken|JsonValue|JsonArray|JsonObject|View|Views|XmlAttribute|XmlAttributeCollection|XmlComment|XmlCData|XmlDeclaration|XmlDocument|XmlDocumentType|XmlElement|XmlNamespaceManager|XmlNameTable|XmlNode|XmlNodeList|XmlProcessingInstruction|XmlReadOptions|XmlText|XmlWriteOptions|WebServiceActionContext|WebServiceActionResultCode|SessionSettings))\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\b([<>]=|<>|<|>)\b?">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\b(\-|\+|\/|\*)\b">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\s*(\:=|\+=|-=|\/=|\*=)\s*?">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\b(?i:(ADD|ADDFIRST|ADDLAST|ADDAFTER|ADDBEFORE|ACTION|ACTIONS|AREA|ASSEMBLY|CHARTPART|CUEGROUP|CUSTOMIZES|COLUMN|DATAITEM|DATASET|ELEMENTS|EXTENDS|FIELD|FIELDGROUP|FIELDATTRIBUTE|FIELDELEMENT|FIELDGROUPS|FIELDS|FILTER|FIXED|GRID|GROUP|MOVEAFTER|MOVEBEFORE|KEY|KEYS|LABEL|LABELS|LAYOUT|MODIFY|MOVEFIRST|MOVELAST|MOVEBEFORE|MOVEAFTER|PART|REPEATER|USERCONTROL|REQUESTPAGE|SCHEMA|SEPARATOR|SYSTEMPART|TABLEELEMENT|TEXTATTRIBUTE|TEXTELEMENT|TYPE))\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\s*[(\.\.)&\|]\s*">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\b">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="[;:,]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="#[ \t]*(if|else|elif|endif|define|undef|region|endregion|pragma)\b.*?\n">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="\w+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern=".">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
58
lexers/alloy.xml
Normal file
58
lexers/alloy.xml
Normal file
@ -0,0 +1,58 @@
|
||||
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Alloy</name>
|
||||
<alias>alloy</alias>
|
||||
<filename>*.als</filename>
|
||||
<mime_type>text/x-alloy</mime_type>
|
||||
<dot_all>true</dot_all>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="sig">
|
||||
<rule pattern="(extends)\b"><token type="Keyword"/><pop depth="1"/></rule>
|
||||
<rule pattern="[a-zA-Z_][\w]*"*"><token type="Name"/></rule>
|
||||
<rule pattern="[^\S\n]+"><token type="TextWhitespace"/></rule>
|
||||
<rule pattern=","><token type="Punctuation"/></rule>
|
||||
<rule pattern="\{"><token type="Operator"/><pop depth="1"/></rule>
|
||||
</state>
|
||||
<state name="module">
|
||||
<rule pattern="[^\S\n]+"><token type="TextWhitespace"/></rule>
|
||||
<rule pattern="[a-zA-Z_][\w]*"*"><token type="Name"/><pop depth="1"/></rule>
|
||||
</state>
|
||||
<state name="fun">
|
||||
<rule pattern="[^\S\n]+"><token type="TextWhitespace"/></rule>
|
||||
<rule pattern="\{"><token type="Operator"/><pop depth="1"/></rule>
|
||||
<rule pattern="[a-zA-Z_][\w]*"*"><token type="Name"/><pop depth="1"/></rule>
|
||||
</state>
|
||||
<state name="fact">
|
||||
<rule><include state="fun"/></rule>
|
||||
<rule pattern=""\b(\\\\|\\[^\\]|[^"\\])*""><token type="LiteralString"/><pop depth="1"/></rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="--.*?$"><token type="CommentSingle"/></rule>
|
||||
<rule pattern="//.*?$"><token type="CommentSingle"/></rule>
|
||||
<rule pattern="/\*.*?\*/"><token type="CommentMultiline"/></rule>
|
||||
<rule pattern="[^\S\n]+"><token type="TextWhitespace"/></rule>
|
||||
<rule pattern="(module|open)(\s+)"><bygroups><token type="KeywordNamespace"/><token type="TextWhitespace"/></bygroups><push state="module"/></rule>
|
||||
<rule pattern="(sig|enum)(\s+)"><bygroups><token type="KeywordDeclaration"/><token type="TextWhitespace"/></bygroups><push state="sig"/></rule>
|
||||
<rule pattern="(iden|univ|none)\b"><token type="KeywordConstant"/></rule>
|
||||
<rule pattern="(int|Int)\b"><token type="KeywordType"/></rule>
|
||||
<rule pattern="(var|this|abstract|extends|set|seq|one|lone|let)\b"><token type="Keyword"/></rule>
|
||||
<rule pattern="(all|some|no|sum|disj|when|else)\b"><token type="Keyword"/></rule>
|
||||
<rule pattern="(run|check|for|but|exactly|expect|as|steps)\b"><token type="Keyword"/></rule>
|
||||
<rule pattern="(always|after|eventually|until|release)\b"><token type="Keyword"/></rule>
|
||||
<rule pattern="(historically|before|once|since|triggered)\b"><token type="Keyword"/></rule>
|
||||
<rule pattern="(and|or|implies|iff|in)\b"><token type="OperatorWord"/></rule>
|
||||
<rule pattern="(fun|pred|assert)(\s+)"><bygroups><token type="Keyword"/><token type="TextWhitespace"/></bygroups><push state="fun"/></rule>
|
||||
<rule pattern="(fact)(\s+)"><bygroups><token type="Keyword"/><token type="TextWhitespace"/></bygroups><push state="fact"/></rule>
|
||||
<rule pattern="!|#|&&|\+\+|<<|>>|>=|<=>|<=|\.\.|\.|->"><token type="Operator"/></rule>
|
||||
<rule pattern="[-+/*%=<>&!^|~{}\[\]().\';]"><token type="Operator"/></rule>
|
||||
<rule pattern="[a-zA-Z_][\w]*"*"><token type="Name"/></rule>
|
||||
<rule pattern="[:,]"><token type="Punctuation"/></rule>
|
||||
<rule pattern="[0-9]+"><token type="LiteralNumberInteger"/></rule>
|
||||
<rule pattern=""\b(\\\\|\\[^\\]|[^"\\])*""><token type="LiteralString"/></rule>
|
||||
<rule pattern="\n"><token type="TextWhitespace"/></rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
||||
|
108
lexers/angular2.xml
Normal file
108
lexers/angular2.xml
Normal file
@ -0,0 +1,108 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Angular2</name>
|
||||
<alias>ng2</alias>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="attr">
|
||||
<rule pattern="".*?"">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="'.*?'">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[^\s>]+">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="[^{([*#]+">
|
||||
<token type="Other"/>
|
||||
</rule>
|
||||
<rule pattern="(\{\{)(\s*)">
|
||||
<bygroups>
|
||||
<token type="CommentPreproc"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="ngExpression"/>
|
||||
</rule>
|
||||
<rule pattern="([([]+)([\w:.-]+)([\])]+)(\s*)(=)(\s*)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameAttribute"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="attr"/>
|
||||
</rule>
|
||||
<rule pattern="([([]+)([\w:.-]+)([\])]+)(\s*)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameAttribute"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="([*#])([\w:.-]+)(\s*)(=)(\s*)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameAttribute"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
<push state="attr"/>
|
||||
</rule>
|
||||
<rule pattern="([*#])([\w:.-]+)(\s*)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameAttribute"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="ngExpression">
|
||||
<rule pattern="\s+(\|\s+)?">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\}\}">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern=":?(true|false)">
|
||||
<token type="LiteralStringBoolean"/>
|
||||
</rule>
|
||||
<rule pattern=":?"(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern=":?'(\\\\|\\'|[^'])*'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z][\w-]*(\(.*\))?">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="\.[\w-]+(\(.*\))?">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="(\?)(\s*)([^}\s]+)(\s*)(:)(\s*)([^}\s]+)(\s*)">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralString"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralString"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
317
lexers/antlr.xml
Normal file
317
lexers/antlr.xml
Normal file
@ -0,0 +1,317 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>ANTLR</name>
|
||||
<alias>antlr</alias>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="nested-arg-action">
|
||||
<rule pattern="([^$\[\]\'"/]+|"(\\\\|\\"|[^"])*"|'(\\\\|\\'|[^'])*'|//.*$\n?|/\*(.|\n)*?\*/|/(?!\*)(\\\\|\\/|[^/])*/|/)+">
|
||||
<token type="Other"/>
|
||||
</rule>
|
||||
<rule pattern="\[">
|
||||
<token type="Punctuation"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\]">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(\$[a-zA-Z]+)(\.?)(text|value)?">
|
||||
<bygroups>
|
||||
<token type="NameVariable"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameProperty"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\\\\|\\\]|\\\[|[^\[\]])+">
|
||||
<token type="Other"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="exception">
|
||||
<rule pattern="\n">
|
||||
<token type="TextWhitespace"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\s">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="comments"/>
|
||||
</rule>
|
||||
<rule pattern="\[">
|
||||
<token type="Punctuation"/>
|
||||
<push state="nested-arg-action"/>
|
||||
</rule>
|
||||
<rule pattern="\{">
|
||||
<token type="Punctuation"/>
|
||||
<push state="action"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="whitespace">
|
||||
<rule pattern="\s+">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="comments"/>
|
||||
</rule>
|
||||
<rule pattern="(lexer|parser|tree)?(\s*)(grammar\b)(\s*)([A-Za-z]\w*)(;)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="NameClass"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="options\b">
|
||||
<token type="Keyword"/>
|
||||
<push state="options"/>
|
||||
</rule>
|
||||
<rule pattern="tokens\b">
|
||||
<token type="Keyword"/>
|
||||
<push state="tokens"/>
|
||||
</rule>
|
||||
<rule pattern="(scope)(\s*)([A-Za-z]\w*)(\s*)(\{)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="NameVariable"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="action"/>
|
||||
</rule>
|
||||
<rule pattern="(catch|finally)\b">
|
||||
<token type="Keyword"/>
|
||||
<push state="exception"/>
|
||||
</rule>
|
||||
<rule pattern="(@[A-Za-z]\w*)(\s*)(::)?(\s*)([A-Za-z]\w*)(\s*)(\{)">
|
||||
<bygroups>
|
||||
<token type="NameLabel"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="NameLabel"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="action"/>
|
||||
</rule>
|
||||
<rule pattern="((?:protected|private|public|fragment)\b)?(\s*)([A-Za-z]\w*)(!)?">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="NameLabel"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="rule-alts" state="rule-prelims"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="tokens">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="comments"/>
|
||||
</rule>
|
||||
<rule pattern="\{">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="([A-Z]\w*)(\s*)(=)?(\s*)(\'(?:\\\\|\\\'|[^\']*)\')?(\s*)(;)">
|
||||
<bygroups>
|
||||
<token type="NameLabel"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="LiteralString"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\}">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="options">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="comments"/>
|
||||
</rule>
|
||||
<rule pattern="\{">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="([A-Za-z]\w*)(\s*)(=)(\s*)([A-Za-z]\w*|\'(?:\\\\|\\\'|[^\']*)\'|[0-9]+|\*)(\s*)(;)">
|
||||
<bygroups>
|
||||
<token type="NameVariable"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="Text"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\}">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="rule-alts">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="comments"/>
|
||||
</rule>
|
||||
<rule pattern="options\b">
|
||||
<token type="Keyword"/>
|
||||
<push state="options"/>
|
||||
</rule>
|
||||
<rule pattern=":">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="'(\\\\|\\'|[^'])*'">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="<<([^>]|>[^>])>>">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\$?[A-Z_]\w*">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="\$?[a-z_]\w*">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="(\+|\||->|=>|=|\(|\)|\.\.|\.|\?|\*|\^|!|\#|~)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern=",">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\[">
|
||||
<token type="Punctuation"/>
|
||||
<push state="nested-arg-action"/>
|
||||
</rule>
|
||||
<rule pattern="\{">
|
||||
<token type="Punctuation"/>
|
||||
<push state="action"/>
|
||||
</rule>
|
||||
<rule pattern=";">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="rule-prelims">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="comments"/>
|
||||
</rule>
|
||||
<rule pattern="returns\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\[">
|
||||
<token type="Punctuation"/>
|
||||
<push state="nested-arg-action"/>
|
||||
</rule>
|
||||
<rule pattern="\{">
|
||||
<token type="Punctuation"/>
|
||||
<push state="action"/>
|
||||
</rule>
|
||||
<rule pattern="(throws)(\s+)([A-Za-z]\w*)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="NameLabel"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(,)(\s*)([A-Za-z]\w*)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="NameLabel"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="options\b">
|
||||
<token type="Keyword"/>
|
||||
<push state="options"/>
|
||||
</rule>
|
||||
<rule pattern="(scope)(\s+)(\{)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="action"/>
|
||||
</rule>
|
||||
<rule pattern="(scope)(\s+)([A-Za-z]\w*)(\s*)(;)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="NameLabel"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(@[A-Za-z]\w*)(\s*)(\{)">
|
||||
<bygroups>
|
||||
<token type="NameLabel"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="action"/>
|
||||
</rule>
|
||||
<rule pattern=":">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="action">
|
||||
<rule pattern="([^${}\'"/\\]+|"(\\\\|\\"|[^"])*"|'(\\\\|\\'|[^'])*'|//.*$\n?|/\*(.|\n)*?\*/|/(?!\*)(\\\\|\\/|[^/])*/|\\(?!%)|/)+">
|
||||
<token type="Other"/>
|
||||
</rule>
|
||||
<rule pattern="(\\)(%)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Other"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\$[a-zA-Z]+)(\.?)(text|value)?">
|
||||
<bygroups>
|
||||
<token type="NameVariable"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameProperty"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\{">
|
||||
<token type="Punctuation"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\}">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="comments">
|
||||
<rule pattern="//.*$">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="/\*(.|\n)*?\*/">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
74
lexers/apacheconf.xml
Normal file
74
lexers/apacheconf.xml
Normal file
@ -0,0 +1,74 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>ApacheConf</name>
|
||||
<alias>apacheconf</alias>
|
||||
<alias>aconf</alias>
|
||||
<alias>apache</alias>
|
||||
<filename>.htaccess</filename>
|
||||
<filename>apache.conf</filename>
|
||||
<filename>apache2.conf</filename>
|
||||
<mime_type>text/x-apacheconf</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="(#.*?)$">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="(<[^\s>]+)(?:(\s+)(.*?))?(>)">
|
||||
<bygroups>
|
||||
<token type="NameTag"/>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralString"/>
|
||||
<token type="NameTag"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="([a-z]\w*)(\s+)">
|
||||
<bygroups>
|
||||
<token type="NameBuiltin"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="value"/>
|
||||
</rule>
|
||||
<rule pattern="\.+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="value">
|
||||
<rule pattern="\\\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="$">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="[^\S\n]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\d+\.\d+\.\d+\.\d+(?:/\d+)?">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\d+">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="/([a-z0-9][\w./-]+)">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="(on|off|none|any|all|double|email|dns|min|minimal|os|productonly|full|emerg|alert|crit|error|warn|notice|info|debug|registry|script|inetd|standalone|user|group)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern=""([^"\\]*(?:\\.[^"\\]*)*)"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="[^\s"\\]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
59
lexers/apl.xml
Normal file
59
lexers/apl.xml
Normal file
@ -0,0 +1,59 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>APL</name>
|
||||
<alias>apl</alias>
|
||||
<filename>*.apl</filename>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="[⍝#].*$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\'((\'\')|[^\'])*\'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern=""(("")|[^"])*"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="[⋄◇()]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[\[\];]">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="⎕[A-Za-zΔ∆⍙][A-Za-zΔ∆⍙_¯0-9]*">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="[A-Za-zΔ∆⍙_][A-Za-zΔ∆⍙_¯0-9]*">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="¯?(0[Xx][0-9A-Fa-f]+|[0-9]*\.?[0-9]+([Ee][+¯]?[0-9]+)?|¯|∞)([Jj]¯?(0[Xx][0-9A-Fa-f]+|[0-9]*\.?[0-9]+([Ee][+¯]?[0-9]+)?|¯|∞))?">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="[\.\\/⌿⍀¨⍣⍨⍠⍤∘⍥@⌺⌶⍢]">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
<rule pattern="[+\-×÷⌈⌊∣|⍳?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⌸⍯↗⊆⍸]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="⍬">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="[⎕⍞]">
|
||||
<token type="NameVariableGlobal"/>
|
||||
</rule>
|
||||
<rule pattern="[←→]">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="[⍺⍵⍶⍹∇:]">
|
||||
<token type="NameBuiltinPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="[{}]">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
130
lexers/applescript.xml
Normal file
130
lexers/applescript.xml
Normal file
@ -0,0 +1,130 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>AppleScript</name>
|
||||
<alias>applescript</alias>
|
||||
<filename>*.applescript</filename>
|
||||
<dot_all>true</dot_all>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="¬\n">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="'s\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="(--|#).*?$">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="\(\*">
|
||||
<token type="CommentMultiline"/>
|
||||
<push state="comment"/>
|
||||
</rule>
|
||||
<rule pattern="[(){}!,.:]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(«)([^»]+)(»)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="NameBuiltin"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b((?:considering|ignoring)\s*)(application responses|case|diacriticals|hyphens|numeric strings|punctuation|white space)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="NameBuiltin"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(-|\*|\+|&|≠|>=?|<=?|=|≥|≤|/|÷|\^)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\b(and|or|is equal|equals|(is )?equal to|is not|isn't|isn't equal( to)?|is not equal( to)?|doesn't equal|does not equal|(is )?greater than|comes after|is not less than or equal( to)?|isn't less than or equal( to)?|(is )?less than|comes before|is not greater than or equal( to)?|isn't greater than or equal( to)?|(is )?greater than or equal( to)?|is not less than|isn't less than|does not come before|doesn't come before|(is )?less than or equal( to)?|is not greater than|isn't greater than|does not come after|doesn't come after|starts? with|begins? with|ends? with|contains?|does not contain|doesn't contain|is in|is contained by|is not in|is not contained by|isn't contained by|div|mod|not|(a )?(ref( to)?|reference to)|is|does)\b">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
<rule pattern="^(\s*(?:on|end)\s+)(zoomed|write to file|will zoom|will show|will select tab view item|will resize( sub views)?|will resign active|will quit|will pop up|will open|will move|will miniaturize|will hide|will finish launching|will display outline cell|will display item cell|will display cell|will display browser cell|will dismiss|will close|will become active|was miniaturized|was hidden|update toolbar item|update parameters|update menu item|shown|should zoom|should selection change|should select tab view item|should select row|should select item|should select column|should quit( after last window closed)?|should open( untitled)?|should expand item|should end editing|should collapse item|should close|should begin editing|selection changing|selection changed|selected tab view item|scroll wheel|rows changed|right mouse up|right mouse dragged|right mouse down|resized( sub views)?|resigned main|resigned key|resigned active|read from file|prepare table drop|prepare table drag|prepare outline drop|prepare outline drag|prepare drop|plugin loaded|parameters updated|panel ended|opened|open untitled|number of rows|number of items|number of browser rows|moved|mouse up|mouse moved|mouse exited|mouse entered|mouse dragged|mouse down|miniaturized|load data representation|launched|keyboard up|keyboard down|items changed|item value changed|item value|item expandable|idle|exposed|end editing|drop|drag( (entered|exited|updated))?|double clicked|document nib name|dialog ended|deminiaturized|data representation|conclude drop|column resized|column moved|column clicked|closed|clicked toolbar item|clicked|choose menu item|child of item|changed|change item value|change cell value|cell value changed|cell value|bounds changed|begin editing|became main|became key|awake from nib|alert ended|activated|action|accept table drop|accept outline drop)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="^(\s*)(in|on|script|to)(\s+)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b(as )(alias |application |boolean |class |constant |date |file |integer |list |number |POSIX file |real |record |reference |RGB color |script |text |unit types|(?:Unicode )?text|string)\b">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b(AppleScript|current application|false|linefeed|missing value|pi|quote|result|return|space|tab|text item delimiters|true|version)\b">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="\b(ASCII (character|number)|activate|beep|choose URL|choose application|choose color|choose file( name)?|choose folder|choose from list|choose remote application|clipboard info|close( access)?|copy|count|current date|delay|delete|display (alert|dialog)|do shell script|duplicate|exists|get eof|get volume settings|info for|launch|list (disks|folder)|load script|log|make|mount volume|new|offset|open( (for access|location))?|path to|print|quit|random number|read|round|run( script)?|say|scripting components|set (eof|the clipboard to|volume)|store script|summarize|system attribute|system info|the clipboard|time to GMT|write|quoted form)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="\b(considering|else|error|exit|from|if|ignoring|in|repeat|tell|then|times|to|try|until|using terms from|while|with|with timeout( of)?|with transaction|by|continue|end|its?|me|my|return|of|as)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\b(global|local|prop(erty)?|set|get)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\b(but|put|returning|the)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="\b(attachment|attribute run|character|day|month|paragraph|word|year)s?\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="\b(about|above|against|apart from|around|aside from|at|below|beneath|beside|between|for|given|instead of|on|onto|out of|over|since)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="\b(accepts arrow key|action method|active|alignment|allowed identifiers|allows branch selection|allows column reordering|allows column resizing|allows column selection|allows customization|allows editing text attributes|allows empty selection|allows mixed state|allows multiple selection|allows reordering|allows undo|alpha( value)?|alternate image|alternate increment value|alternate title|animation delay|associated file name|associated object|auto completes|auto display|auto enables items|auto repeat|auto resizes( outline column)?|auto save expanded items|auto save name|auto save table columns|auto saves configuration|auto scroll|auto sizes all columns to fit|auto sizes cells|background color|bezel state|bezel style|bezeled|border rect|border type|bordered|bounds( rotation)?|box type|button returned|button type|can choose directories|can choose files|can draw|can hide|cell( (background color|size|type))?|characters|class|click count|clicked( data)? column|clicked data item|clicked( data)? row|closeable|collating|color( (mode|panel))|command key down|configuration|content(s| (size|view( margins)?))?|context|continuous|control key down|control size|control tint|control view|controller visible|coordinate system|copies( on scroll)?|corner view|current cell|current column|current( field)? editor|current( menu)? item|current row|current tab view item|data source|default identifiers|delta (x|y|z)|destination window|directory|display mode|displayed cell|document( (edited|rect|view))?|double value|dragged column|dragged distance|dragged items|draws( cell)? background|draws grid|dynamically scrolls|echos bullets|edge|editable|edited( data)? column|edited data item|edited( data)? row|enabled|enclosing scroll view|ending page|error handling|event number|event type|excluded from windows menu|executable path|expanded|fax number|field editor|file kind|file name|file type|first responder|first visible column|flipped|floating|font( panel)?|formatter|frameworks path|frontmost|gave up|grid color|has data items|has horizontal ruler|has horizontal scroller|has parent data item|has resize indicator|has shadow|has sub menu|has vertical ruler|has vertical scroller|header cell|header view|hidden|hides when deactivated|highlights by|horizontal line scroll|horizontal page scroll|horizontal ruler view|horizontally resizable|icon image|id|identifier|ignores multiple clicks|image( (alignment|dims when disabled|frame style|scaling))?|imports graphics|increment value|indentation per level|indeterminate|index|integer value|intercell spacing|item height|key( (code|equivalent( modifier)?|window))?|knob thickness|label|last( visible)? column|leading offset|leaf|level|line scroll|loaded|localized sort|location|loop mode|main( (bunde|menu|window))?|marker follows cell|matrix mode|maximum( content)? size|maximum visible columns|menu( form representation)?|miniaturizable|miniaturized|minimized image|minimized title|minimum column width|minimum( content)? size|modal|modified|mouse down state|movie( (controller|file|rect))?|muted|name|needs display|next state|next text|number of tick marks|only tick mark values|opaque|open panel|option key down|outline table column|page scroll|pages across|pages down|palette label|pane splitter|parent data item|parent window|pasteboard|path( (names|separator))?|playing|plays every frame|plays selection only|position|preferred edge|preferred type|pressure|previous text|prompt|properties|prototype cell|pulls down|rate|released when closed|repeated|requested print time|required file type|resizable|resized column|resource path|returns records|reuses columns|rich text|roll over|row height|rulers visible|save panel|scripts path|scrollable|selectable( identifiers)?|selected cell|selected( data)? columns?|selected data items?|selected( data)? rows?|selected item identifier|selection by rect|send action on arrow key|sends action when done editing|separates columns|separator item|sequence number|services menu|shared frameworks path|shared support path|sheet|shift key down|shows alpha|shows state by|size( mode)?|smart insert delete enabled|sort case sensitivity|sort column|sort order|sort type|sorted( data rows)?|sound|source( mask)?|spell checking enabled|starting page|state|string value|sub menu|super menu|super view|tab key traverses cells|tab state|tab type|tab view|table view|tag|target( printer)?|text color|text container insert|text container origin|text returned|tick mark position|time stamp|title(d| (cell|font|height|position|rect))?|tool tip|toolbar|trailing offset|transparent|treat packages as directories|truncated labels|types|unmodified characters|update views|use sort indicator|user defaults|uses data source|uses ruler|uses threaded animation|uses title from previous column|value wraps|version|vertical( (line scroll|page scroll|ruler view))?|vertically resizable|view|visible( document rect)?|volume|width|window|windows menu|wraps|zoomable|zoomed)\b">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
<rule pattern="\b(action cell|alert reply|application|box|browser( cell)?|bundle|button( cell)?|cell|clip view|color well|color-panel|combo box( item)?|control|data( (cell|column|item|row|source))?|default entry|dialog reply|document|drag info|drawer|event|font(-panel)?|formatter|image( (cell|view))?|matrix|menu( item)?|item|movie( view)?|open-panel|outline view|panel|pasteboard|plugin|popup button|progress indicator|responder|save-panel|scroll view|secure text field( cell)?|slider|sound|split view|stepper|tab view( item)?|table( (column|header cell|header view|view))|text( (field( cell)?|view))?|toolbar( item)?|user-defaults|view|window)s?\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="\b(animate|append|call method|center|close drawer|close panel|display|display alert|display dialog|display panel|go|hide|highlight|increment|item for|load image|load movie|load nib|load panel|load sound|localized string|lock focus|log|open drawer|path for|pause|perform action|play|register|resume|scroll|select( all)?|show|size to fit|start|step back|step forward|stop|synchronize|unlock focus|update)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="\b((in )?back of|(in )?front of|[0-9]+(st|nd|rd|th)|first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|after|back|before|behind|every|front|index|last|middle|some|that|through|thru|where|whose)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="\b([a-zA-Z]\w*)\b">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="[-+]?(\d+\.\d*|\d*\.\d+)(E[-+][0-9]+)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="[-+]?\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="comment">
|
||||
<rule pattern="\(\*">
|
||||
<token type="CommentMultiline"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\*\)">
|
||||
<token type="CommentMultiline"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[^*(]+">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="[*(]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
174
lexers/arangodb_aql.xml
Normal file
174
lexers/arangodb_aql.xml
Normal file
@ -0,0 +1,174 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>ArangoDB AQL</name>
|
||||
<alias>aql</alias>
|
||||
<filename>*.aql</filename>
|
||||
<mime_type>text/x-aql</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
<dot_all>true</dot_all>
|
||||
<ensure_nl>true</ensure_nl>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="comments-and-whitespace">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/\*">
|
||||
<token type="CommentMultiline"/>
|
||||
<push state="multiline-comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="multiline-comment">
|
||||
<rule pattern="[^*]+">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="\*/">
|
||||
<token type="CommentMultiline"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\*">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="double-quote">
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="[^"\\]+">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="single-quote">
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="[^'\\]+">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="backtick">
|
||||
<rule pattern="\\.">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="[^`\\]+">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="`">
|
||||
<token type="Name"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="forwardtick">
|
||||
<rule pattern="\\.">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="[^´\\]+">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="´">
|
||||
<token type="Name"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="identifier">
|
||||
<rule pattern="(?:\$?|_+)[a-z]+[_a-z0-9]*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="`">
|
||||
<token type="Name"/>
|
||||
<push state="backtick"/>
|
||||
</rule>
|
||||
<rule pattern="´">
|
||||
<token type="Name"/>
|
||||
<push state="forwardtick"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="comments-and-whitespace"/>
|
||||
</rule>
|
||||
<rule pattern="0b[01]+">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="0x[0-9a-f]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="(?:0|[1-9][0-9]*)(?![\.e])">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="(?:(?:0|[1-9][0-9]*)(?:\.[0-9]+)?|\.[0-9]+)(?:e[\-\+]?[0-9]+)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="@@(?:_+[a-z0-9]+[a-z0-9_]*|[a-z0-9][a-z0-9_]*)">
|
||||
<token type="NameVariableGlobal"/>
|
||||
</rule>
|
||||
<rule pattern="@(?:_+[a-z0-9]+[a-z0-9_]*|[a-z0-9][a-z0-9_]*)">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="=~|!~|[=!<>]=?|[%?:/*+-]|\.\.|&&|\|\|">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[.,(){}\[\]]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z0-9][a-zA-Z0-9_]*(?:::[a-zA-Z0-9_]+)+(?=\s*\()">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="(WITH)(\s+)(COUNT)(\s+)(INTO)\b">
|
||||
<bygroups>
|
||||
<token type="KeywordReserved"/>
|
||||
<token type="Text"/>
|
||||
<token type="KeywordPseudo"/>
|
||||
<token type="Text"/>
|
||||
<token type="KeywordReserved"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(?:KEEP|PRUNE|SEARCH|TO)\b">
|
||||
<token type="KeywordPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="OPTIONS(?=\s*\{)">
|
||||
<token type="KeywordPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="(?:AGGREGATE|ALL|ALL_SHORTEST_PATHS|AND|ANY|ASC|AT LEAST|COLLECT|DESC|DISTINCT|FILTER|FOR|GRAPH|IN|INBOUND|INSERT|INTO|K_PATHS|K_SHORTEST_PATHS|LIKE|LIMIT|NONE|NOT|OR|OUTBOUND|REMOVE|REPLACE|RETURN|SHORTEST_PATH|SORT|UPDATE|UPSERT|WITH|WINDOW)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="LET\b">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="(?:true|false|null)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(?-i)(?:CURRENT|NEW|OLD)\b">
|
||||
<token type="NameBuiltinPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="(?:to_bool|to_number|to_char|to_string|to_array|to_list|is_null|is_bool|is_number|is_string|is_array|is_list|is_object|is_document|is_datestring|typename|json_stringify|json_parse|concat|concat_separator|char_length|lower|upper|substring|substring_bytes|left|right|trim|reverse|repeat|contains|log|log2|log10|exp|exp2|sin|cos|tan|asin|acos|atan|atan2|radians|degrees|pi|regex_test|regex_replace|like|floor|ceil|round|abs|rand|random|sqrt|pow|length|count|min|max|average|avg|sum|product|median|variance_population|variance_sample|variance|percentile|bit_and|bit_or|bit_xor|bit_negate|bit_test|bit_popcount|bit_shift_left|bit_shift_right|bit_construct|bit_deconstruct|bit_to_string|bit_from_string|first|last|unique|outersection|interleave|in_range|jaccard|matches|merge|merge_recursive|has|attributes|keys|values|entries|unset|unset_recursive|keep|keep_recursive|near|within|within_rectangle|is_in_polygon|distance|fulltext|stddev_sample|stddev_population|stddev|slice|nth|position|contains_array|translate|zip|call|apply|push|append|pop|shift|unshift|remove_value|remove_values|remove_nth|replace_nth|date_now|date_timestamp|date_iso8601|date_dayofweek|date_year|date_month|date_day|date_hour|date_minute|date_second|date_millisecond|date_dayofyear|date_isoweek|date_isoweekyear|date_leapyear|date_quarter|date_days_in_month|date_trunc|date_round|date_add|date_subtract|date_diff|date_compare|date_format|date_utctolocal|date_localtoutc|date_timezone|date_timezones|fail|passthru|v8|sleep|schema_get|schema_validate|shard_id|version|noopt|noeval|not_null|first_list|first_document|parse_identifier|parse_collection|parse_key|current_user|current_database|collection_count|pregel_result|collections|document|decode_rev|range|union|union_distinct|minus|intersection|flatten|is_same_collection|check_document|ltrim|rtrim|find_first|find_last|split|substitute|ipv4_to_number|ipv4_from_number|is_ipv4|md5|sha1|sha256|sha512|crc32|fnv64|hash|random_token|to_base64|to_hex|encode_uri_component|soundex|assert|warn|is_key|sorted|sorted_unique|count_distinct|count_unique|levenshtein_distance|levenshtein_match|regex_matches|regex_split|ngram_match|ngram_similarity|ngram_positional_similarity|uuid|tokens|exists|starts_with|phrase|min_match|bm25|tfidf|boost|analyzer|offset_info|value|cosine_similarity|decay_exp|decay_gauss|decay_linear|l1_distance|l2_distance|minhash|minhash_count|minhash_error|minhash_match|geo_point|geo_multipoint|geo_polygon|geo_multipolygon|geo_linestring|geo_multilinestring|geo_contains|geo_intersects|geo_equals|geo_distance|geo_area|geo_in_range)(?=\s*\()">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<push state="double-quote"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
<push state="single-quote"/>
|
||||
</rule>
|
||||
<rule pattern="#\d+\b">
|
||||
<token type="NameLabel"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="identifier"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
309
lexers/arduino.xml
Normal file
309
lexers/arduino.xml
Normal file
@ -0,0 +1,309 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Arduino</name>
|
||||
<alias>arduino</alias>
|
||||
<filename>*.ino</filename>
|
||||
<mime_type>text/x-arduino</mime_type>
|
||||
<ensure_nl>true</ensure_nl>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="whitespace">
|
||||
<rule pattern="^#if\s+0">
|
||||
<token type="CommentPreproc"/>
|
||||
<push state="if0"/>
|
||||
</rule>
|
||||
<rule pattern="^#">
|
||||
<token type="CommentPreproc"/>
|
||||
<push state="macro"/>
|
||||
</rule>
|
||||
<rule pattern="^(\s*(?:/[*].*?[*]/\s*)?)(#if\s+0)">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="CommentPreproc"/>
|
||||
</bygroups>
|
||||
<push state="if0"/>
|
||||
</rule>
|
||||
<rule pattern="^(\s*(?:/[*].*?[*]/\s*)?)(#)">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="CommentPreproc"/>
|
||||
</bygroups>
|
||||
<push state="macro"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="//(\n|[\w\W]*?[^\\]\n)">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\\n)?[*][\w\W]*?[*](\\\n)?/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\\n)?[*][\w\W]*">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\"\n]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="macro">
|
||||
<rule pattern="(include)(\s*(?:/[*].*?[*]/\s*)?)([^\n]+)">
|
||||
<bygroups>
|
||||
<token type="CommentPreproc"/>
|
||||
<token type="Text"/>
|
||||
<token type="CommentPreprocFile"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[^/\n]+">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="/[*](.|\n)*?[*]/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="/">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=\\)\n">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="statements">
|
||||
<rule pattern="(reinterpret_cast|static_assert|dynamic_cast|thread_local|static_cast|const_cast|protected|constexpr|namespace|restrict|noexcept|override|operator|typename|template|explicit|decltype|nullptr|private|alignof|virtual|mutable|alignas|typeid|friend|throws|export|public|delete|final|using|throw|catch|this|try|new)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="char(16_t|32_t)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(class)\b">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="classname"/>
|
||||
</rule>
|
||||
<rule pattern="(R)(")([^\\()\s]{,16})(\()((?:.|\n)*?)(\)\3)(")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralString"/>
|
||||
<token type="LiteralStringDelimiter"/>
|
||||
<token type="LiteralStringDelimiter"/>
|
||||
<token type="LiteralString"/>
|
||||
<token type="LiteralStringDelimiter"/>
|
||||
<token type="LiteralString"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(u8|u|U)(")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralString"/>
|
||||
</bygroups>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="(L?)(")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralString"/>
|
||||
</bygroups>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="(L?)(')(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])(')">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralStringChar"/>
|
||||
<token type="LiteralStringChar"/>
|
||||
<token type="LiteralStringChar"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="(\d+\.\d*|\.\d+|\d+[fF])[fF]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0x[0-9a-fA-F]+[LlUu]*">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="0[0-7]+[LlUu]*">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="\d+[LlUu]*">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="\*/">
|
||||
<token type="Error"/>
|
||||
</rule>
|
||||
<rule pattern="[~!%^&*+=|?:<>/-]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[()\[\],.]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(restricted|volatile|continue|register|default|typedef|struct|extern|switch|sizeof|static|return|union|while|const|break|goto|enum|else|case|auto|for|asm|if|do)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(_Bool|_Complex|_Imaginary|array|atomic_bool|atomic_char|atomic_int|atomic_llong|atomic_long|atomic_schar|atomic_short|atomic_uchar|atomic_uint|atomic_ullong|atomic_ulong|atomic_ushort|auto|bool|boolean|BooleanVariables|Byte|byte|Char|char|char16_t|char32_t|class|complex|Const|const|const_cast|delete|double|dynamic_cast|enum|explicit|extern|Float|float|friend|inline|Int|int|int16_t|int32_t|int64_t|int8_t|Long|long|new|NULL|null|operator|private|PROGMEM|protected|public|register|reinterpret_cast|short|signed|sizeof|Static|static|static_cast|String|struct|typedef|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|virtual|Void|void|Volatile|volatile|word)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(and|final|If|Loop|loop|not|or|override|setup|Setup|throw|try|xor)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(ANALOG_MESSAGE|BIN|CHANGE|DEC|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FALLING|FIRMATA_STRING|HALF_PI|HEX|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL1V1|INTERNAL2V56|INTERNAL2V56|LED_BUILTIN|LED_BUILTIN_RX|LED_BUILTIN_TX|LOW|LSBFIRST|MSBFIRST|OCT|OUTPUT|PI|REPORT_ANALOG|REPORT_DIGITAL|RISING|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET|TWO_PI)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(boolean|const|byte|word|string|String|array)\b">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="(Keyboard|KeyboardController|MouseController|SoftwareSerial|EthernetServer|EthernetClient|LiquidCrystal|RobotControl|GSMVoiceCall|EthernetUDP|EsploraTFT|HttpClient|RobotMotor|WiFiClient|GSMScanner|FileSystem|Scheduler|GSMServer|YunClient|YunServer|IPAddress|GSMClient|GSMModem|Keyboard|Ethernet|Console|GSMBand|Esplora|Stepper|Process|WiFiUDP|GSM_SMS|Mailbox|USBHost|Firmata|PImage|Client|Server|GSMPIN|FileIO|Bridge|Serial|EEPROM|Stream|Mouse|Audio|Servo|File|Task|GPRS|WiFi|Wire|TFT|GSM|SPI|SD)\b">
|
||||
<token type="NameClass"/>
|
||||
</rule>
|
||||
<rule pattern="(abs|Abs|accept|ACos|acos|acosf|addParameter|analogRead|AnalogRead|analogReadResolution|AnalogReadResolution|analogReference|AnalogReference|analogWrite|AnalogWrite|analogWriteResolution|AnalogWriteResolution|answerCall|asin|ASin|asinf|atan|ATan|atan2|ATan2|atan2f|atanf|attach|attached|attachGPRS|attachInterrupt|AttachInterrupt|autoscroll|available|availableForWrite|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|Bit|BitClear|bitClear|bitRead|BitRead|bitSet|BitSet|BitWrite|bitWrite|blink|blinkVersion|BSSID|buffer|byte|cbrt|cbrtf|Ceil|ceil|ceilf|changePIN|char|charAt|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compareTo|compassRead|concat|config|connect|connected|constrain|Constrain|copysign|copysignf|cos|Cos|cosf|cosh|coshf|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|degrees|Delay|delay|DelayMicroseconds|delayMicroseconds|detach|DetachInterrupt|detachInterrupt|DigitalPinToInterrupt|digitalPinToInterrupt|DigitalRead|digitalRead|DigitalWrite|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endsWith|endTransmission|endWrite|equals|equalsIgnoreCase|exists|exitValue|Exp|exp|expf|fabs|fabsf|fdim|fdimf|fill|find|findUntil|float|floor|Floor|floorf|flush|fma|fmaf|fmax|fmaxf|fmin|fminf|fmod|fmodf|gatewayIP|get|getAsynchronously|getBand|getButton|getBytes|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|HighByte|home|hypot|hypotf|image|indexOf|int|interrupts|IPAddress|IRread|isActionDone|isAlpha|isAlphaNumeric|isAscii|isControl|isDigit|isDirectory|isfinite|isGraph|isHexadecimalDigit|isinf|isListening|isLowerCase|isnan|isPIN|isPressed|isPrintable|isPunct|isSpace|isUpperCase|isValid|isWhitespace|keyboardRead|keyPressed|keyReleased|knobRead|lastIndexOf|ldexp|ldexpf|leftToRight|length|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|log|Log|log10|log10f|logf|long|lowByte|LowByte|lrint|lrintf|lround|lroundf|macAddress|maintain|map|Map|Max|max|messageAvailable|Micros|micros|millis|Millis|Min|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|NoInterrupts|noListenOnLocalhost|noStroke|noTone|NoTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|PinMode|pinMode|playFile|playMelody|point|pointTo|position|Pow|pow|powf|prepare|press|print|printFirmwareVersion|println|printVersion|process|processInput|PulseIn|pulseIn|pulseInLong|PulseInLong|put|radians|random|Random|randomSeed|RandomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|replace|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|round|roundf|RSSI|run|runAsynchronously|running|runShellCommand|runShellCommandAsynchronously|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|Serial_Available|Serial_Begin|Serial_End|Serial_Flush|Serial_Peek|Serial_Print|Serial_Println|Serial_Read|serialEvent|setBand|setBitOrder|setCharAt|setClockDivider|setCursor|setDataMode|setDNS|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|ShiftIn|shiftIn|ShiftOut|shiftOut|shutdown|signbit|sin|Sin|sinf|sinh|sinhf|size|sizeof|Sq|sq|Sqrt|sqrt|sqrtf|SSID|startLoop|startsWith|step|stop|stroke|subnetMask|substring|switchPIN|tan|Tan|tanf|tanh|tanhf|tempoWrite|text|toCharArray|toInt|toLowerCase|tone|Tone|toUpperCase|transfer|trim|trunc|truncf|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|WiFiServer|word|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRed|writeRGB|yield|Yield)\b">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="(typename|__inline|restrict|_inline|thread|inline|naked)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="(__m(128i|128d|128|64))\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="__(forceinline|identifier|unaligned|declspec|fastcall|finally|stdcall|wchar_t|assume|except|int32|cdecl|int16|leave|based|raise|int64|noop|int8|w64|try|asm)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="(true|false|NULL)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="([a-zA-Z_]\w*)(\s*)(:)(?!:)">
|
||||
<bygroups>
|
||||
<token type="NameLabel"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="function">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="statements"/>
|
||||
</rule>
|
||||
<rule pattern=";">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\{">
|
||||
<token type="Punctuation"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\}">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="if0">
|
||||
<rule pattern="^\s*#if.*?(?<!\\)\n">
|
||||
<token type="CommentPreproc"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="^\s*#el(?:se|if).*\n">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="^\s*#endif.*?(?<!\\)\n">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern=".*?\n">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="classname">
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="NameClass"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\s*(?=>)">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="statement">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="statements"/>
|
||||
</rule>
|
||||
<rule pattern="[{}]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern=";">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule pattern="((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;{]*)(\{)">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="NameFunction"/>
|
||||
<usingself state="root"/>
|
||||
<usingself state="root"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="function"/>
|
||||
</rule>
|
||||
<rule pattern="((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;]*)(;)">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="NameFunction"/>
|
||||
<usingself state="root"/>
|
||||
<usingself state="root"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule>
|
||||
<push state="statement"/>
|
||||
</rule>
|
||||
<rule pattern="__(multiple_inheritance|virtual_inheritance|single_inheritance|interface|uuidof|super|event)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="__(offload|blockingoffload|outer)\b">
|
||||
<token type="KeywordPseudo"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
126
lexers/armasm.xml
Normal file
126
lexers/armasm.xml
Normal file
@ -0,0 +1,126 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>ArmAsm</name>
|
||||
<alias>armasm</alias>
|
||||
<filename>*.s</filename>
|
||||
<filename>*.S</filename>
|
||||
<mime_type>text/x-armasm</mime_type>
|
||||
<mime_type>text/x-asm</mime_type>
|
||||
<ensure_nl>true</ensure_nl>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="commentsandwhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="(\.\w+)([ \t]+\w+\s+?)?">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="NameLabel"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\w+)(:)(\s+\.\w+\s+)">
|
||||
<bygroups>
|
||||
<token type="NameLabel"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="KeywordNamespace"/>
|
||||
</bygroups>
|
||||
<push state="literal"/>
|
||||
</rule>
|
||||
<rule pattern="(\w+)(:)">
|
||||
<bygroups>
|
||||
<token type="NameLabel"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="svc\s+\w+">
|
||||
<token type="NameNamespace"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z]+">
|
||||
<token type="Text"/>
|
||||
<push state="opcode"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="commentsandwhitespace">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="[@;].*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/\*.*?\*/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="literal">
|
||||
<rule pattern="0b[01]+">
|
||||
<token type="LiteralNumberBin"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="0x\w{1,8}">
|
||||
<token type="LiteralNumberHex"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="0\d+">
|
||||
<token type="LiteralNumberOct"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\d+?\.\d+?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(")(.+)(")">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="LiteralStringDouble"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(')(.{1}|\\.{1})(')">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="LiteralStringChar"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="opcode">
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(@|;).*\n">
|
||||
<token type="CommentSingle"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(\s+|,)">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="[rapcfxwbhsdqv]\d{1,2}">
|
||||
<token type="NameClass"/>
|
||||
</rule>
|
||||
<rule pattern="=0x\w+">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="NameLabel"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(=)(\w+)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="NameLabel"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="#">
|
||||
<token type="Text"/>
|
||||
<push state="literal"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
78
lexers/autohotkey.xml
Normal file
78
lexers/autohotkey.xml
Normal file
@ -0,0 +1,78 @@
|
||||
|
||||
<lexer>
|
||||
<config>
|
||||
<name>AutoHotkey</name>
|
||||
<alias>autohotkey</alias>
|
||||
<alias>ahk</alias>
|
||||
<filename>*.ahk</filename>
|
||||
<filename>*.ahkl</filename>
|
||||
<mime_type>text/x-autohotkey</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="^(\s*)(/\*)"><bygroups><token type="Text"/><token type="CommentMultiline"/></bygroups><push state="incomment"/></rule>
|
||||
<rule pattern="^(\s*)(\()"><bygroups><token type="Text"/><token type="Generic"/></bygroups><push state="incontinuation"/></rule>
|
||||
<rule pattern="\s+;.*?$"><token type="CommentSingle"/></rule>
|
||||
<rule pattern="^;.*?$"><token type="CommentSingle"/></rule>
|
||||
<rule pattern="[]{}(),;[]"><token type="Punctuation"/></rule>
|
||||
<rule pattern="(in|is|and|or|not)\b"><token type="OperatorWord"/></rule>
|
||||
<rule pattern="\%[a-zA-Z_#@$][\w#@$]*\%"><token type="NameVariable"/></rule>
|
||||
<rule pattern="!=|==|:=|\.=|<<|>>|[-~+/*%=<>&^|?:!.]"><token type="Operator"/></rule>
|
||||
<rule><include state="commands"/></rule>
|
||||
<rule><include state="labels"/></rule>
|
||||
<rule><include state="builtInFunctions"/></rule>
|
||||
<rule><include state="builtInVariables"/></rule>
|
||||
<rule pattern="""><token type="LiteralString"/><combined state="stringescape" state="dqs"/></rule>
|
||||
<rule><include state="numbers"/></rule>
|
||||
<rule pattern="[a-zA-Z_#@$][\w#@$]*"><token type="Name"/></rule>
|
||||
<rule pattern="\\|\'"><token type="Text"/></rule>
|
||||
<rule pattern="\`([,%`abfnrtv\-+;])"><token type="LiteralStringEscape"/></rule>
|
||||
<rule><include state="garbage"/></rule>
|
||||
</state>
|
||||
<state name="incomment">
|
||||
<rule pattern="^\s*\*/"><token type="CommentMultiline"/><pop depth="1"/></rule>
|
||||
<rule pattern="[^*]+"><token type="CommentMultiline"/></rule>
|
||||
<rule pattern="\*"><token type="CommentMultiline"/></rule>
|
||||
</state>
|
||||
<state name="incontinuation">
|
||||
<rule pattern="^\s*\)"><token type="Generic"/><pop depth="1"/></rule>
|
||||
<rule pattern="[^)]"><token type="Generic"/></rule>
|
||||
<rule pattern="[)]"><token type="Generic"/></rule>
|
||||
</state>
|
||||
<state name="commands">
|
||||
<rule pattern="(?i)^(\s*)(global|local|static|#AllowSameLineComments|#ClipboardTimeout|#CommentFlag|#ErrorStdOut|#EscapeChar|#HotkeyInterval|#HotkeyModifierTimeout|#Hotstring|#IfWinActive|#IfWinExist|#IfWinNotActive|#IfWinNotExist|#IncludeAgain|#Include|#InstallKeybdHook|#InstallMouseHook|#KeyHistory|#LTrim|#MaxHotkeysPerInterval|#MaxMem|#MaxThreads|#MaxThreadsBuffer|#MaxThreadsPerHotkey|#NoEnv|#NoTrayIcon|#Persistent|#SingleInstance|#UseHook|#WinActivateForce|AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGetFocus|ControlGetPos|ControlGetText|ControlGet|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|Edit|Else|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|IfEqual|IfExist|IfGreaterOrEqual|IfGreater|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|If |ImageSearch|IniDelete|IniRead|IniWrite|InputBox|Input|KeyHistory|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClickDrag|MouseClick|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|RunAs|RunWait|Run|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|Send|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|While|WinActivate|WinActivateBottom|WinClose|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinGet|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimizeAllUndo|WinMinimizeAll|WinMinimize|WinMove|WinRestore|WinSetTitle|WinSet|WinShow|WinWaitActive|WinWaitClose|WinWaitNotActive|WinWait)\b"><bygroups><token type="Text"/><token type="NameBuiltin"/></bygroups></rule>
|
||||
</state>
|
||||
<state name="builtInFunctions">
|
||||
<rule pattern="(?i)(Abs|ACos|Asc|ASin|ATan|Ceil|Chr|Cos|DllCall|Exp|FileExist|Floor|GetKeyState|IL_Add|IL_Create|IL_Destroy|InStr|IsFunc|IsLabel|Ln|Log|LV_Add|LV_Delete|LV_DeleteCol|LV_GetCount|LV_GetNext|LV_GetText|LV_Insert|LV_InsertCol|LV_Modify|LV_ModifyCol|LV_SetImageList|Mod|NumGet|NumPut|OnMessage|RegExMatch|RegExReplace|RegisterCallback|Round|SB_SetIcon|SB_SetParts|SB_SetText|Sin|Sqrt|StrLen|SubStr|Tan|TV_Add|TV_Delete|TV_GetChild|TV_GetCount|TV_GetNext|TV_Get|TV_GetParent|TV_GetPrev|TV_GetSelection|TV_GetText|TV_Modify|VarSetCapacity|WinActive|WinExist|Object|ComObjActive|ComObjArray|ComObjEnwrap|ComObjUnwrap|ComObjParameter|ComObjType|ComObjConnect|ComObjCreate|ComObjGet|ComObjError|ComObjValue|Insert|MinIndex|MaxIndex|Remove|SetCapacity|GetCapacity|GetAddress|_NewEnum|FileOpen|Read|Write|ReadLine|WriteLine|ReadNumType|WriteNumType|RawRead|RawWrite|Seek|Tell|Close|Next|IsObject|StrPut|StrGet|Trim|LTrim|RTrim)\b"><token type="NameFunction"/></rule>
|
||||
</state>
|
||||
<state name="builtInVariables">
|
||||
<rule pattern="(?i)(A_AhkPath|A_AhkVersion|A_AppData|A_AppDataCommon|A_AutoTrim|A_BatchLines|A_CaretX|A_CaretY|A_ComputerName|A_ControlDelay|A_Cursor|A_DDDD|A_DDD|A_DD|A_DefaultMouseSpeed|A_Desktop|A_DesktopCommon|A_DetectHiddenText|A_DetectHiddenWindows|A_EndChar|A_EventInfo|A_ExitReason|A_FormatFloat|A_FormatInteger|A_Gui|A_GuiEvent|A_GuiControl|A_GuiControlEvent|A_GuiHeight|A_GuiWidth|A_GuiX|A_GuiY|A_Hour|A_IconFile|A_IconHidden|A_IconNumber|A_IconTip|A_Index|A_IPAddress1|A_IPAddress2|A_IPAddress3|A_IPAddress4|A_ISAdmin|A_IsCompiled|A_IsCritical|A_IsPaused|A_IsSuspended|A_KeyDelay|A_Language|A_LastError|A_LineFile|A_LineNumber|A_LoopField|A_LoopFileAttrib|A_LoopFileDir|A_LoopFileExt|A_LoopFileFullPath|A_LoopFileLongPath|A_LoopFileName|A_LoopFileShortName|A_LoopFileShortPath|A_LoopFileSize|A_LoopFileSizeKB|A_LoopFileSizeMB|A_LoopFileTimeAccessed|A_LoopFileTimeCreated|A_LoopFileTimeModified|A_LoopReadLine|A_LoopRegKey|A_LoopRegName|A_LoopRegSubkey|A_LoopRegTimeModified|A_LoopRegType|A_MDAY|A_Min|A_MM|A_MMM|A_MMMM|A_Mon|A_MouseDelay|A_MSec|A_MyDocuments|A_Now|A_NowUTC|A_NumBatchLines|A_OSType|A_OSVersion|A_PriorHotkey|A_ProgramFiles|A_Programs|A_ProgramsCommon|A_ScreenHeight|A_ScreenWidth|A_ScriptDir|A_ScriptFullPath|A_ScriptName|A_Sec|A_Space|A_StartMenu|A_StartMenuCommon|A_Startup|A_StartupCommon|A_StringCaseSense|A_Tab|A_Temp|A_ThisFunc|A_ThisHotkey|A_ThisLabel|A_ThisMenu|A_ThisMenuItem|A_ThisMenuItemPos|A_TickCount|A_TimeIdle|A_TimeIdlePhysical|A_TimeSincePriorHotkey|A_TimeSinceThisHotkey|A_TitleMatchMode|A_TitleMatchModeSpeed|A_UserName|A_WDay|A_WinDelay|A_WinDir|A_WorkingDir|A_YDay|A_YEAR|A_YWeek|A_YYYY|Clipboard|ClipboardAll|ComSpec|ErrorLevel|ProgramFiles|True|False|A_IsUnicode|A_FileEncoding|A_OSVersion|A_PtrSize)\b"><token type="NameVariable"/></rule>
|
||||
</state>
|
||||
<state name="labels">
|
||||
<rule pattern="(^\s*)([^:\s("]+?:{1,2})"><bygroups><token type="Text"/><token type="NameLabel"/></bygroups></rule>
|
||||
<rule pattern="(^\s*)(::[^:\s]+?::)"><bygroups><token type="Text"/><token type="NameLabel"/></bygroups></rule>
|
||||
</state>
|
||||
<state name="numbers">
|
||||
<rule pattern="(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?"><token type="LiteralNumberFloat"/></rule>
|
||||
<rule pattern="\d+[eE][+-]?[0-9]+"><token type="LiteralNumberFloat"/></rule>
|
||||
<rule pattern="0\d+"><token type="LiteralNumberOct"/></rule>
|
||||
<rule pattern="0[xX][a-fA-F0-9]+"><token type="LiteralNumberHex"/></rule>
|
||||
<rule pattern="\d+L"><token type="LiteralNumberIntegerLong"/></rule>
|
||||
<rule pattern="\d+"><token type="LiteralNumberInteger"/></rule>
|
||||
</state>
|
||||
<state name="stringescape">
|
||||
<rule pattern="\"\"|\`([,%`abfnrtv])"><token type="LiteralStringEscape"/></rule>
|
||||
</state>
|
||||
<state name="strings">
|
||||
<rule pattern="[^"\n]+"><token type="LiteralString"/></rule>
|
||||
</state>
|
||||
<state name="dqs">
|
||||
<rule pattern="""><token type="LiteralString"/><pop depth="1"/></rule>
|
||||
<rule><include state="strings"/></rule>
|
||||
</state>
|
||||
<state name="garbage">
|
||||
<rule pattern="[^\S\n]"><token type="Text"/></rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
||||
|
70
lexers/autoit.xml
Normal file
70
lexers/autoit.xml
Normal file
File diff suppressed because one or more lines are too long
95
lexers/awk.xml
Normal file
95
lexers/awk.xml
Normal file
@ -0,0 +1,95 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Awk</name>
|
||||
<alias>awk</alias>
|
||||
<alias>gawk</alias>
|
||||
<alias>mawk</alias>
|
||||
<alias>nawk</alias>
|
||||
<filename>*.awk</filename>
|
||||
<mime_type>application/x-awk</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="^(?=\s|/)">
|
||||
<token type="Text"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="commentsandwhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="\+\+|--|\|\||&&|in\b|\$|!?~|\|&|(\*\*|[-<>+*%\^/!=|])=?">
|
||||
<token type="Operator"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule pattern="[{(\[;,]">
|
||||
<token type="Punctuation"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule pattern="[})\].]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(break|continue|do|while|exit|for|if|else|return|switch|case|default)\b">
|
||||
<token type="Keyword"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule pattern="function\b">
|
||||
<token type="KeywordDeclaration"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule pattern="(atan2|cos|exp|int|log|rand|sin|sqrt|srand|gensub|gsub|index|length|match|split|patsplit|sprintf|sub|substr|tolower|toupper|close|fflush|getline|next(file)|print|printf|strftime|systime|mktime|delete|system|strtonum|and|compl|lshift|or|rshift|asorti?|isarray|bindtextdomain|dcn?gettext|@(include|load|namespace))\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="(ARGC|ARGIND|ARGV|BEGIN(FILE)?|BINMODE|CONVFMT|ENVIRON|END(FILE)?|ERRNO|FIELDWIDTHS|FILENAME|FNR|FPAT|FS|IGNORECASE|LINT|NF|NR|OFMT|OFS|ORS|PROCINFO|RLENGTH|RS|RSTART|RT|SUBSEP|TEXTDOMAIN)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="[@$a-zA-Z_]\w*">
|
||||
<token type="NameOther"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0x[0-9a-fA-F]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9]+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="'(\\\\|\\'|[^'])*'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="commentsandwhitespace">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="#.*$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="slashstartsregex">
|
||||
<rule>
|
||||
<include state="commentsandwhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/\B">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(?=/)">
|
||||
<token type="Text"/>
|
||||
<push state="#pop" state="badregex"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="badregex">
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
97
lexers/ballerina.xml
Normal file
97
lexers/ballerina.xml
Normal file
@ -0,0 +1,97 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Ballerina</name>
|
||||
<alias>ballerina</alias>
|
||||
<filename>*.bal</filename>
|
||||
<mime_type>text/x-ballerina</mime_type>
|
||||
<dot_all>true</dot_all>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="[^\S\n]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/\*.*?\*/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="(break|catch|continue|done|else|finally|foreach|forever|fork|if|lock|match|return|throw|transaction|try|while)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)((?:[^\W\d]|\$)[\w$]*)(\s*)(\()">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="@[^\W\d][\w.]*">
|
||||
<token type="NameDecorator"/>
|
||||
</rule>
|
||||
<rule pattern="(annotation|bind|but|endpoint|error|function|object|private|public|returns|service|type|var|with|worker)\b">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="(boolean|byte|decimal|float|int|json|map|nil|record|string|table|xml)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(true|false|null)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(import)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="import"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="(\.)((?:[^\W\d]|\$)[\w$]*)">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="NameAttribute"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="^\s*([^\W\d]|\$)[\w$]*:">
|
||||
<token type="NameLabel"/>
|
||||
</rule>
|
||||
<rule pattern="([^\W\d]|\$)[\w$]*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="([0-9][0-9_]*\.([0-9][0-9_]*)?|\.[0-9][0-9_]*)([eE][+\-]?[0-9][0-9_]*)?[fFdD]?|[0-9][eE][+\-]?[0-9][0-9_]*[fFdD]?|[0-9]([eE][+\-]?[0-9][0-9_]*)?[fFdD]|0[xX]([0-9a-fA-F][0-9a-fA-F_]*\.?|([0-9a-fA-F][0-9a-fA-F_]*)?\.[0-9a-fA-F][0-9a-fA-F_]*)[pP][+\-]?[0-9][0-9_]*[fFdD]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="0[bB][01][01_]*[lL]?">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="0[0-7_]+[lL]?">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="0|[1-9][0-9_]*[lL]?">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="[~^*!%&\[\](){}<>|+=:;,./?-]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="import">
|
||||
<rule pattern="[\w.]+">
|
||||
<token type="NameNamespace"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
220
lexers/bash.xml
Normal file
220
lexers/bash.xml
Normal file
@ -0,0 +1,220 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Bash</name>
|
||||
<alias>bash</alias>
|
||||
<alias>sh</alias>
|
||||
<alias>ksh</alias>
|
||||
<alias>zsh</alias>
|
||||
<alias>shell</alias>
|
||||
<filename>*.sh</filename>
|
||||
<filename>*.ksh</filename>
|
||||
<filename>*.bash</filename>
|
||||
<filename>*.ebuild</filename>
|
||||
<filename>*.eclass</filename>
|
||||
<filename>.env</filename>
|
||||
<filename>*.env</filename>
|
||||
<filename>*.exheres-0</filename>
|
||||
<filename>*.exlib</filename>
|
||||
<filename>*.zsh</filename>
|
||||
<filename>*.zshrc</filename>
|
||||
<filename>.bashrc</filename>
|
||||
<filename>bashrc</filename>
|
||||
<filename>.bash_*</filename>
|
||||
<filename>bash_*</filename>
|
||||
<filename>zshrc</filename>
|
||||
<filename>.zshrc</filename>
|
||||
<filename>PKGBUILD</filename>
|
||||
<mime_type>application/x-sh</mime_type>
|
||||
<mime_type>application/x-shellscript</mime_type>
|
||||
<analyse first="true" >
|
||||
<regex pattern="(?m)^#!.*/bin/(?:env |)(?:bash|zsh|sh|ksh)" score="1.0" />
|
||||
</analyse>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="data">
|
||||
<rule pattern="(?s)\$?"(\\\\|\\[0-7]+|\\.|[^"\\$])*"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="(?s)\$'(\\\\|\\[0-7]+|\\.|[^'\\])*'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="(?s)'.*?'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern=";">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="&">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\|">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\d+(?= |$)">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="[^=\s\[\]{}()$"\'`\\<&|;]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="<">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(?s)(\\\\|\\[0-7]+|\\.|[^"\\$])+">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interp"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="interp">
|
||||
<rule pattern="\$\(\(">
|
||||
<token type="Keyword"/>
|
||||
<push state="math"/>
|
||||
</rule>
|
||||
<rule pattern="\$\(">
|
||||
<token type="Keyword"/>
|
||||
<push state="paren"/>
|
||||
</rule>
|
||||
<rule pattern="\$\{#?">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push state="curly"/>
|
||||
</rule>
|
||||
<rule pattern="\$[a-zA-Z_]\w*">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="\$(?:\d+|[#$?!_*@-])">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="\$">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="paren">
|
||||
<rule pattern="\)">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="math">
|
||||
<rule pattern="\)\)">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[-+*/%^|&]|\*\*|\|\|">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\d+#\d+">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\d+#(?! )">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\d+">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="backticks">
|
||||
<rule pattern="`">
|
||||
<token type="LiteralStringBacktick"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="basic"/>
|
||||
</rule>
|
||||
<rule pattern="`">
|
||||
<token type="LiteralStringBacktick"/>
|
||||
<push state="backticks"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="data"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interp"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="basic">
|
||||
<rule pattern="\b(if|fi|else|while|do|done|for|then|return|function|case|select|continue|until|esac|elif)(\s*)\b">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b(alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|declare|dirs|disown|echo|enable|eval|exec|exit|export|false|fc|fg|getopts|hash|help|history|jobs|kill|let|local|logout|popd|printf|pushd|pwd|read|readonly|set|shift|shopt|source|suspend|test|time|times|trap|true|type|typeset|ulimit|umask|unalias|unset|wait)(?=[\s)`])">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="\A#!.+\n">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="#.*(\S|$)">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\\[\w\W]">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="(\b\w+)(\s*)(\+?=)">
|
||||
<bygroups>
|
||||
<token type="NameVariable"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[\[\]{}()=]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="<<<">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="<<-?\s*(\'?)\\?(\w+)[\w\W]+?\2">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="&&|\|\|">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="curly">
|
||||
<rule pattern="\}">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern=":-">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\w+">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="[^}:"\'`$\\]+">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern=":">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
25
lexers/bash_session.xml
Normal file
25
lexers/bash_session.xml
Normal file
@ -0,0 +1,25 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Bash Session</name>
|
||||
<alias>bash-session</alias>
|
||||
<alias>console</alias>
|
||||
<alias>shell-session</alias>
|
||||
<filename>*.sh-session</filename>
|
||||
<mime_type>text/x-sh</mime_type>
|
||||
<ensure_nl>true</ensure_nl>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="^((?:\[[^]]+@[^]]+\]\s?)?[#$%>])(\s*)(.*\n?)">
|
||||
<bygroups>
|
||||
<token type="GenericPrompt"/>
|
||||
<token type="Text"/>
|
||||
<using lexer="bash"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="^.+\n?">
|
||||
<token type="GenericOutput"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
660
lexers/batchfile.xml
Normal file
660
lexers/batchfile.xml
Normal file
@ -0,0 +1,660 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Batchfile</name>
|
||||
<alias>bat</alias>
|
||||
<alias>batch</alias>
|
||||
<alias>dosbatch</alias>
|
||||
<alias>winbatch</alias>
|
||||
<filename>*.bat</filename>
|
||||
<filename>*.cmd</filename>
|
||||
<mime_type>application/x-dos-batch</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="arithmetic">
|
||||
<rule pattern="0[0-7]+">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="0x[\da-f]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="[(),]+">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="([=+\-*/!~]|%|\^\^)+">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="((?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(\^[\n\x1a]?)?[^()=+\-*/!~%^"\n\x1a&<>|\t\v\f\r ,;=\xa0]|\^[\n\x1a\t\v\f\r ,;=\xa0]?[\w\W])+">
|
||||
<usingself state="variable"/>
|
||||
</rule>
|
||||
<rule pattern="(?=[\x00|&])">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="follow"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="else?">
|
||||
<rule pattern="(?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)">
|
||||
<usingself state="text"/>
|
||||
</rule>
|
||||
<rule pattern="else(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="sqstring">
|
||||
<rule>
|
||||
<include state="variable-or-escape"/>
|
||||
</rule>
|
||||
<rule pattern="[^%]+|%">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="\)((?=\()|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))(?:(?:[^\n\x1a^]|\^[\n\x1a]?[\w\W])*)">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="(?=((?:(?<=^[^:])|^[^:]?)[\t\v\f\r ,;=\xa0]*)(:))">
|
||||
<token type="Text"/>
|
||||
<push state="follow"/>
|
||||
</rule>
|
||||
<rule pattern="(?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)">
|
||||
<usingself state="text"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="redirect"/>
|
||||
</rule>
|
||||
<rule pattern="[\n\x1a]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="Punctuation"/>
|
||||
<push state="root/compound"/>
|
||||
</rule>
|
||||
<rule pattern="@+">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="((?:for|if|rem)(?:(?=(?:\^[\n\x1a]?)?/)|(?:(?!\^)|(?<=m))(?:(?=\()|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+)?(?:\^[\n\x1a]?)?/(?:\^[\n\x1a]?)?\?)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
</bygroups>
|
||||
<push state="follow"/>
|
||||
</rule>
|
||||
<rule pattern="(goto(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(]))((?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|[^"%\n\x1a&<>|])*(?:\^[\n\x1a]?)?/(?:\^[\n\x1a]?)?\?(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|[^"%\n\x1a&<>|])*)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
</bygroups>
|
||||
<push state="follow"/>
|
||||
</rule>
|
||||
<rule pattern="(setlocal|endlocal|prompt|verify|rename|mklink|rmdir|shift|start|color|dpath|title|chdir|erase|pushd|ftype|break|pause|mkdir|assoc|date|path|time|popd|keys|exit|type|copy|echo|move|dir|del|ren|ver|cls|vol|rd|md|cd)(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(])">
|
||||
<token type="Keyword"/>
|
||||
<push state="follow"/>
|
||||
</rule>
|
||||
<rule pattern="(call)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)(:)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="call"/>
|
||||
</rule>
|
||||
<rule pattern="call(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(])">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(for(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])(?!\^))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))(/f(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
<push state="for/f" state="for"/>
|
||||
</rule>
|
||||
<rule pattern="(for(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])(?!\^))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))(/l(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
<push state="for/l" state="for"/>
|
||||
</rule>
|
||||
<rule pattern="for(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])(?!\^)">
|
||||
<token type="Keyword"/>
|
||||
<push state="for2" state="for"/>
|
||||
</rule>
|
||||
<rule pattern="(goto(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(]))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)(:?)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="label"/>
|
||||
</rule>
|
||||
<rule pattern="(if(?:(?=\()|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))(?!\^))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)((?:/i(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))?)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)((?:not(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))?)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
</bygroups>
|
||||
<push state="(?" state="if"/>
|
||||
</rule>
|
||||
<rule pattern="rem(((?=\()|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))(?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?(?:[&<>|]+|(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+))+)?.*|(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(])(?:(?:[^\n\x1a^]|\^[\n\x1a]?[\w\W])*))">
|
||||
<token type="CommentSingle"/>
|
||||
<push state="follow"/>
|
||||
</rule>
|
||||
<rule pattern="(set(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(]))((?:(?:\^[\n\x1a]?)?[^\S\n])*)(/a)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
<push state="arithmetic"/>
|
||||
</rule>
|
||||
<rule pattern="(set(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(]))((?:(?:\^[\n\x1a]?)?[^\S\n])*)((?:/p)?)((?:(?:\^[\n\x1a]?)?[^\S\n])*)((?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|^=]|\^[\n\x1a]?[^"=])+)?)((?:(?:\^[\n\x1a]?)?=)?)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<usingself state="variable"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="follow"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<push state="follow"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="follow">
|
||||
<rule pattern="((?:(?<=^[^:])|^[^:]?)[\t\v\f\r ,;=\xa0]*)(:)([\t\v\f\r ,;=\xa0]*)((?:(?:[^\n\x1a&<>|\t\v\f\r ,;=\xa0+:^]|\^[\n\x1a]?[\w\W])*))(.*)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameLabel"/>
|
||||
<token type="CommentSingle"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="redirect"/>
|
||||
</rule>
|
||||
<rule pattern="(?=[\n\x1a])">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\|\|?|&&?">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="bqstring">
|
||||
<rule>
|
||||
<include state="variable-or-escape"/>
|
||||
</rule>
|
||||
<rule pattern="[^%]+|%">
|
||||
<token type="LiteralStringBacktick"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="for2">
|
||||
<rule pattern="\)">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))(do(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))">
|
||||
<bygroups>
|
||||
<usingself state="text"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[\n\x1a]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="follow"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="label/compound">
|
||||
<rule pattern="(?=\))">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="((?:(?:[^\n\x1a&<>|\t\v\f\r ,;=\xa0+:^)]|\^[\n\x1a]?[^)])*)?)((?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|\^[\n\x1a]?[^)]|[^"%^\n\x1a&<>|)])*)">
|
||||
<bygroups>
|
||||
<token type="NameLabel"/>
|
||||
<token type="CommentSingle"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="for">
|
||||
<rule pattern="((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))(in)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))(\()">
|
||||
<bygroups>
|
||||
<usingself state="text"/>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="follow"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="redirect/compound">
|
||||
<rule pattern="((?:(?<=[\n\x1a\t\v\f\r ,;=\xa0])\d)?)(>>?&|<&)([\n\x1a\t\v\f\r ,;=\xa0]*)(\d)">
|
||||
<bygroups>
|
||||
<token type="LiteralNumberInteger"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="((?:(?<=[\n\x1a\t\v\f\r ,;=\xa0])(?<!\^[\n\x1a])\d)?)(>>?|<)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?(?:[&<>|]+|(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0)])+))+))">
|
||||
<bygroups>
|
||||
<token type="LiteralNumberInteger"/>
|
||||
<token type="Punctuation"/>
|
||||
<usingself state="text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="if">
|
||||
<rule pattern="((?:cmdextversion|errorlevel)(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))(\d+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(defined(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))((?:[&<>|]+|(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+))+))">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<usingself state="variable"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(exist(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)(?:[&<>|]+|(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+))+))">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="((?:-?(?:0[0-7]+|0x[\da-f]+|\d+)(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))(?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))((?:equ|geq|gtr|leq|lss|neq))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)(?:-?(?:0[0-7]+|0x[\da-f]+|\d+)(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])))">
|
||||
<bygroups>
|
||||
<usingself state="arithmetic"/>
|
||||
<token type="OperatorWord"/>
|
||||
<usingself state="arithmetic"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(?:[&<>|]+|(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+))+)">
|
||||
<usingself state="text"/>
|
||||
<push state="#pop" state="if2"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root/compound">
|
||||
<rule pattern="\)">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(?=((?:(?<=^[^:])|^[^:]?)[\t\v\f\r ,;=\xa0]*)(:))">
|
||||
<token type="Text"/>
|
||||
<push state="follow/compound"/>
|
||||
</rule>
|
||||
<rule pattern="(?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)">
|
||||
<usingself state="text"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="redirect/compound"/>
|
||||
</rule>
|
||||
<rule pattern="[\n\x1a]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="Punctuation"/>
|
||||
<push state="root/compound"/>
|
||||
</rule>
|
||||
<rule pattern="@+">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="((?:for|if|rem)(?:(?=(?:\^[\n\x1a]?)?/)|(?:(?!\^)|(?<=m))(?:(?=\()|(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])))))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0)])+)?(?:\^[\n\x1a]?)?/(?:\^[\n\x1a]?)?\?)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
</bygroups>
|
||||
<push state="follow/compound"/>
|
||||
</rule>
|
||||
<rule pattern="(goto(?:(?=\))|(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(])))((?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|[^"%\n\x1a&<>|)])*(?:\^[\n\x1a]?)?/(?:\^[\n\x1a]?)?\?(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|[^"%\n\x1a&<>|)])*)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
</bygroups>
|
||||
<push state="follow/compound"/>
|
||||
</rule>
|
||||
<rule pattern="(setlocal|endlocal|prompt|verify|rename|mklink|rmdir|shift|start|color|dpath|title|chdir|erase|pushd|ftype|break|pause|mkdir|assoc|date|path|time|popd|keys|exit|type|copy|echo|move|dir|del|ren|ver|cls|vol|rd|md|cd)(?:(?=\))|(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(]))">
|
||||
<token type="Keyword"/>
|
||||
<push state="follow/compound"/>
|
||||
</rule>
|
||||
<rule pattern="(call)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)(:)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="call/compound"/>
|
||||
</rule>
|
||||
<rule pattern="call(?:(?=\))|(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(]))">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(for(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))(?!\^))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))(/f(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])))">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
<push state="for/f" state="for"/>
|
||||
</rule>
|
||||
<rule pattern="(for(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))(?!\^))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))(/l(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])))">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
<push state="for/l" state="for"/>
|
||||
</rule>
|
||||
<rule pattern="for(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a]))(?!\^)">
|
||||
<token type="Keyword"/>
|
||||
<push state="for2" state="for"/>
|
||||
</rule>
|
||||
<rule pattern="(goto(?:(?=\))|(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(])))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)(:?)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="label/compound"/>
|
||||
</rule>
|
||||
<rule pattern="(if(?:(?=\()|(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])))(?!\^))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)((?:/i(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])))?)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)((?:not(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])))?)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
</bygroups>
|
||||
<push state="(?" state="if"/>
|
||||
</rule>
|
||||
<rule pattern="rem(((?=\()|(?:(?=\))|(?=\^?[\t\v\f\r ,;=\xa0]|[&<>|\n\x1a])))(?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?(?:[&<>|]+|(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+))+)?.*|(?:(?=\))|(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(]))(?:(?:[^\n\x1a^)]|\^[\n\x1a]?[^)])*))">
|
||||
<token type="CommentSingle"/>
|
||||
<push state="follow/compound"/>
|
||||
</rule>
|
||||
<rule pattern="(set(?:(?=\))|(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(])))((?:(?:\^[\n\x1a]?)?[^\S\n])*)(/a)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
<push state="arithmetic/compound"/>
|
||||
</rule>
|
||||
<rule pattern="(set(?:(?=\))|(?=(?:\^[\n\x1a]?)?[\t\v\f\r ,;=\xa0+./:[\\\]]|[\n\x1a&<>|(])))((?:(?:\^[\n\x1a]?)?[^\S\n])*)((?:/p)?)((?:(?:\^[\n\x1a]?)?[^\S\n])*)((?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|^=)]|\^[\n\x1a]?[^"=])+)?)((?:(?:\^[\n\x1a]?)?=)?)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<token type="Keyword"/>
|
||||
<usingself state="text"/>
|
||||
<usingself state="variable"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="follow/compound"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<push state="follow/compound"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="follow/compound">
|
||||
<rule pattern="(?=\))">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="((?:(?<=^[^:])|^[^:]?)[\t\v\f\r ,;=\xa0]*)(:)([\t\v\f\r ,;=\xa0]*)((?:(?:[^\n\x1a&<>|\t\v\f\r ,;=\xa0+:^)]|\^[\n\x1a]?[^)])*))(.*)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameLabel"/>
|
||||
<token type="CommentSingle"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="redirect/compound"/>
|
||||
</rule>
|
||||
<rule pattern="(?=[\n\x1a])">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\|\|?|&&?">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="text">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="variable-or-escape"/>
|
||||
</rule>
|
||||
<rule pattern="[^"%^\n\x1a&<>|\t\v\f\r ,;=\xa0\d)]+|.">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="redirect">
|
||||
<rule pattern="((?:(?<=[\n\x1a\t\v\f\r ,;=\xa0])\d)?)(>>?&|<&)([\n\x1a\t\v\f\r ,;=\xa0]*)(\d)">
|
||||
<bygroups>
|
||||
<token type="LiteralNumberInteger"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="((?:(?<=[\n\x1a\t\v\f\r ,;=\xa0])(?<!\^[\n\x1a])\d)?)(>>?|<)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?(?:[&<>|]+|(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+))+))">
|
||||
<bygroups>
|
||||
<token type="LiteralNumberInteger"/>
|
||||
<token type="Punctuation"/>
|
||||
<usingself state="text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="label">
|
||||
<rule pattern="((?:(?:[^\n\x1a&<>|\t\v\f\r ,;=\xa0+:^]|\^[\n\x1a]?[\w\W])*)?)((?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|\^[\n\x1a]?[\w\W]|[^"%^\n\x1a&<>|])*)">
|
||||
<bygroups>
|
||||
<token type="NameLabel"/>
|
||||
<token type="CommentSingle"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="arithmetic/compound">
|
||||
<rule pattern="(?=\))">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="0[0-7]+">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="0x[\da-f]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="[(),]+">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="([=+\-*/!~]|%|\^\^)+">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="((?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(\^[\n\x1a]?)?[^()=+\-*/!~%^"\n\x1a&<>|\t\v\f\r ,;=\xa0]|\^[\n\x1a\t\v\f\r ,;=\xa0]?[^)])+">
|
||||
<usingself state="variable"/>
|
||||
</rule>
|
||||
<rule pattern="(?=[\x00|&])">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="follow"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="\^!|%%">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="[^"%^\n\x1a]+|[%^]">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="variable">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="variable-or-escape"/>
|
||||
</rule>
|
||||
<rule pattern="[^"%^\n\x1a]+|.">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="call/compound">
|
||||
<rule pattern="(?=\))">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(:?)((?:(?:[^\n\x1a&<>|\t\v\f\r ,;=\xa0+:^)]|\^[\n\x1a]?[^)])*))">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameLabel"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="for/f">
|
||||
<rule pattern="(")((?:(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|[^"])*?")([\n\x1a\t\v\f\r ,;=\xa0]*)(\))">
|
||||
<bygroups>
|
||||
<token type="LiteralStringDouble"/>
|
||||
<usingself state="string"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<push state="#pop" state="for2" state="string"/>
|
||||
</rule>
|
||||
<rule pattern="('(?:%%|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|[\w\W])*?')([\n\x1a\t\v\f\r ,;=\xa0]*)(\))">
|
||||
<bygroups>
|
||||
<usingself state="sqstring"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(`(?:%%|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|[\w\W])*?`)([\n\x1a\t\v\f\r ,;=\xa0]*)(\))">
|
||||
<bygroups>
|
||||
<usingself state="bqstring"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="for2"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="for/l">
|
||||
<rule pattern="-?\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="for2"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="if2">
|
||||
<rule pattern="((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?)(==)((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)?(?:[&<>|]+|(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+))+))">
|
||||
<bygroups>
|
||||
<usingself state="text"/>
|
||||
<token type="Operator"/>
|
||||
<usingself state="text"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+))((?:equ|geq|gtr|leq|lss|neq))((?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)(?:[&<>|]+|(?:(?:"[^\n\x1a"]*(?:"|(?=[\n\x1a])))|(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))|(?:(?:(?:\^[\n\x1a]?)?[^"\n\x1a&<>|\t\v\f\r ,;=\xa0])+))+))">
|
||||
<bygroups>
|
||||
<usingself state="text"/>
|
||||
<token type="OperatorWord"/>
|
||||
<usingself state="text"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="(?">
|
||||
<rule pattern="(?:(?:(?:\^[\n\x1a])?[\t\v\f\r ,;=\xa0])+)">
|
||||
<usingself state="text"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="Punctuation"/>
|
||||
<push state="#pop" state="else?" state="root/compound"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="call">
|
||||
<rule pattern="(:?)((?:(?:[^\n\x1a&<>|\t\v\f\r ,;=\xa0+:^]|\^[\n\x1a]?[\w\W])*))">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameLabel"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="variable-or-escape">
|
||||
<rule pattern="(?:(?:%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|[^%:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%\n\x1a^]|\^[^%\n\x1a])[^=\n\x1a]*=(?:[^%\n\x1a^]|\^[^%\n\x1a])*)?)?%))|(?:\^?![^!:\n\x1a]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^!\n\x1a^]|\^[^!\n\x1a])[^=\n\x1a]*=(?:[^!\n\x1a^]|\^[^!\n\x1a])*)?)?\^?!))">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="%%|\^[\n\x1a]?(\^!|[\w\W])">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
152
lexers/bibtex.xml
Normal file
152
lexers/bibtex.xml
Normal file
@ -0,0 +1,152 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>BibTeX</name>
|
||||
<alias>bib</alias>
|
||||
<alias>bibtex</alias>
|
||||
<filename>*.bib</filename>
|
||||
<mime_type>text/x-bibtex</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
<not_multiline>true</not_multiline>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="closing-brace">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule pattern="[})]">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="braced-string">
|
||||
<rule pattern="\{">
|
||||
<token type="LiteralString"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\}">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[^\{\}]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="whitespace">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="value">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule pattern="[a-z_@!$&*+\-./:;<>?\[\\\]^`|~][\w@!$&*+\-./:;<>?\[\\\]^`|~]*">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="quoted-string"/>
|
||||
</rule>
|
||||
<rule pattern="\{">
|
||||
<token type="LiteralString"/>
|
||||
<push state="braced-string"/>
|
||||
</rule>
|
||||
<rule pattern="[\d]+">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="#">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="quoted-string">
|
||||
<rule pattern="\{">
|
||||
<token type="LiteralString"/>
|
||||
<push state="braced-string"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[^\{\"]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule pattern="@comment">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="@preamble">
|
||||
<token type="NameClass"/>
|
||||
<push state="closing-brace" state="value" state="opening-brace"/>
|
||||
</rule>
|
||||
<rule pattern="@string">
|
||||
<token type="NameClass"/>
|
||||
<push state="closing-brace" state="field" state="opening-brace"/>
|
||||
</rule>
|
||||
<rule pattern="@[a-z_@!$&*+\-./:;<>?\[\\\]^`|~][\w@!$&*+\-./:;<>?\[\\\]^`|~]*">
|
||||
<token type="NameClass"/>
|
||||
<push state="closing-brace" state="command-body" state="opening-brace"/>
|
||||
</rule>
|
||||
<rule pattern=".+">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="command-body">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule pattern="[^\s\,\}]+">
|
||||
<token type="NameLabel"/>
|
||||
<push state="#pop" state="fields"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="fields">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule pattern=",">
|
||||
<token type="Punctuation"/>
|
||||
<push state="field"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="=">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule pattern="=">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="field">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule pattern="[a-z_@!$&*+\-./:;<>?\[\\\]^`|~][\w@!$&*+\-./:;<>?\[\\\]^`|~]*">
|
||||
<token type="NameAttribute"/>
|
||||
<push state="value" state="="/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="opening-brace">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule pattern="[{(]">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
84
lexers/bicep.xml
Normal file
84
lexers/bicep.xml
Normal file
@ -0,0 +1,84 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Bicep</name>
|
||||
<alias>bicep</alias>
|
||||
<filename>*.bicep</filename>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="interp">
|
||||
<rule pattern="'">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\$\{">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push state="interp-inside"/>
|
||||
</rule>
|
||||
<rule pattern="\$">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="[^'\\$]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="interp-inside">
|
||||
<rule pattern="\}">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="commentsandwhitespace">
|
||||
<rule pattern="//[^\n\r]+">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/\*.*?\*/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="commentsandwhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="'''.*?'''">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="LiteralString"/>
|
||||
<push state="interp"/>
|
||||
</rule>
|
||||
<rule pattern="#[\w-]+\b">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="[\w_]+(?=\()">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="\b(metadata|targetScope|resource|module|param|var|output|for|in|if|existing|import|as|type|with|using|func|assert)\b">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="\b(true|false|null)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(>=|>|<=|<|==|!=|=~|!~|::|&&|\?\?|!|-|%|\*|\/|\+)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="(\(|\)|\[|\]|\.|:|\?|{|}|@|,|\||=>|=)">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[\w_]+">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9]+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
141
lexers/blitzbasic.xml
Normal file
141
lexers/blitzbasic.xml
Normal file
@ -0,0 +1,141 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>BlitzBasic</name>
|
||||
<alias>blitzbasic</alias>
|
||||
<alias>b3d</alias>
|
||||
<alias>bplus</alias>
|
||||
<filename>*.bb</filename>
|
||||
<filename>*.decls</filename>
|
||||
<mime_type>text/x-bb</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="string">
|
||||
<rule pattern="""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern=""C?">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[^"]+">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="[ \t]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern=";.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9]+\.[0-9]*(?!\.)">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="\.[0-9]+(?!\.)">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9]+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="\$[0-9a-f]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="\%[10]+">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="\b(Before|Handle|After|First|Float|Last|Sgn|Abs|Not|And|Int|Mod|Str|Sar|Shr|Shl|Or)\b">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="([+\-*/~=<>^])">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[(),:\[\]\\]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\.([ \t]*)([a-z]\w*)">
|
||||
<token type="NameLabel"/>
|
||||
</rule>
|
||||
<rule pattern="\b(New)\b([ \t]+)([a-z]\w*)">
|
||||
<bygroups>
|
||||
<token type="KeywordReserved"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b(Gosub|Goto)\b([ \t]+)([a-z]\w*)">
|
||||
<bygroups>
|
||||
<token type="KeywordReserved"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameLabel"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b(Object)\b([ \t]*)([.])([ \t]*)([a-z]\w*)\b">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b([a-z]\w*)(?:([ \t]*)(@{1,2}|[#$%])|([ \t]*)([.])([ \t]*)(?:([a-z]\w*)))?\b([ \t]*)(\()">
|
||||
<bygroups>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="KeywordType"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b(Function)\b([ \t]+)([a-z]\w*)(?:([ \t]*)(@{1,2}|[#$%])|([ \t]*)([.])([ \t]*)(?:([a-z]\w*)))?">
|
||||
<bygroups>
|
||||
<token type="KeywordReserved"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="KeywordType"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b(Type)([ \t]+)([a-z]\w*)">
|
||||
<bygroups>
|
||||
<token type="KeywordReserved"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b(Pi|True|False|Null)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="\b(Local|Global|Const|Field|Dim)\b">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="\b(Function|Restore|Default|Forever|Include|Return|Repeat|ElseIf|Delete|Insert|Select|EndIf|Until|While|Gosub|Type|Goto|Else|Data|Next|Step|Each|Case|Wend|Exit|Read|Then|For|New|Asc|Len|Chr|End|To|If)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="([a-z]\w*)(?:([ \t]*)(@{1,2}|[#$%])|([ \t]*)([.])([ \t]*)(?:([a-z]\w*)))?">
|
||||
<bygroups>
|
||||
<token type="NameVariable"/>
|
||||
<token type="Text"/>
|
||||
<token type="KeywordType"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
28
lexers/bnf.xml
Normal file
28
lexers/bnf.xml
Normal file
@ -0,0 +1,28 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>BNF</name>
|
||||
<alias>bnf</alias>
|
||||
<filename>*.bnf</filename>
|
||||
<mime_type>text/x-bnf</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="(<)([ -;=?-~]+)(>)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameClass"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="::=">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[^<>:]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern=".">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
83
lexers/bqn.xml
Normal file
83
lexers/bqn.xml
Normal file
@ -0,0 +1,83 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>BQN</name>
|
||||
<alias>bqn</alias>
|
||||
<filename>*.bqn</filename>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="\A#!.+$">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="#.*$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern=""(?:[^"]|"")*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="[{}]">
|
||||
<token type="KeywordPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="[⟨⟩\[\]‿]">
|
||||
<token type="KeywordPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="[()]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[:;?]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[⋄,]">
|
||||
<token type="KeywordPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="[←⇐↩→]">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="'.'">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="[˙˜˘¨⌜⁼´˝`]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[∘○⊸⟜⌾⊘◶⎉⚇⍟⎊]">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
<rule pattern="[𝔽𝔾𝕎𝕏𝕊+\-×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍⋈↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!⍕⍎]">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="[𝕗𝕘𝕨𝕩𝕤]">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="·">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="@">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="\d+(?:\.\d+)?[eE]¯?\d+">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="[¯∞π]?(?:\d*\.?\b\d+(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π))?">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="(•?[a-z][A-Z_a-z0-9π∞¯]*|𝕣)">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="•?[A-Z][A-Z_a-z0-9π∞¯]*">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="(•?_[A-Za-z][A-Z_a-z0-9π∞¯]*|_𝕣)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="(•?_[A-Za-z][A-Z_a-z0-9π∞¯]*_|_𝕣_)">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
<rule pattern="\.">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
51
lexers/brainfuck.xml
Normal file
51
lexers/brainfuck.xml
Normal file
@ -0,0 +1,51 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Brainfuck</name>
|
||||
<alias>brainfuck</alias>
|
||||
<alias>bf</alias>
|
||||
<filename>*.bf</filename>
|
||||
<filename>*.b</filename>
|
||||
<mime_type>application/x-brainfuck</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="common">
|
||||
<rule pattern="[.,]+">
|
||||
<token type="NameTag"/>
|
||||
</rule>
|
||||
<rule pattern="[+-]+">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="[<>]+">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="[^.,+\-<>\[\]]+">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="\[">
|
||||
<token type="Keyword"/>
|
||||
<push state="loop"/>
|
||||
</rule>
|
||||
<rule pattern="\]">
|
||||
<token type="Error"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="common"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="loop">
|
||||
<rule pattern="\[">
|
||||
<token type="Keyword"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\]">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="common"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
121
lexers/c#.xml
Normal file
121
lexers/c#.xml
Normal file
@ -0,0 +1,121 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>C#</name>
|
||||
<alias>csharp</alias>
|
||||
<alias>c#</alias>
|
||||
<filename>*.cs</filename>
|
||||
<mime_type>text/x-csharp</mime_type>
|
||||
<dot_all>true</dot_all>
|
||||
<ensure_nl>true</ensure_nl>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="^\s*\[.*?\]">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
<rule pattern="[^\S\n]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="///[^\n\r]*">
|
||||
<token type="CommentSpecial"/>
|
||||
</rule>
|
||||
<rule pattern="//[^\n\r]*">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/[*].*?[*]/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="[~!%^&*()+=|\[\]:;,.<>/?-]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[{}]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="@"(""|[^"])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\$@?"(""|[^"])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"\n])*["\n]">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="'\\.'|'[^\\]'">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="0[xX][0-9a-fA-F]+[Ll]?|\d[_\d]*(\.\d*)?([eE][+-]?\d+)?[flFLdD]?">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="#[ \t]*(if|endif|else|elif|define|undef|line|error|warning|region|endregion|pragma|nullable)\b">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="\b(extern)(\s+)(alias)\b">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(as|await|base|break|by|case|catch|checked|continue|default|delegate|do|else|event|finally|fixed|for|foreach|goto|if|in|init|is|let|lock|new|on|out|params|readonly|ref|return|sizeof|stackalloc|switch|this|throw|try|typeof|unchecked|virtual|void|while|get|set|new|yield|add|remove|value|alias|ascending|descending|from|group|into|orderby|select|thenby|where|join|equals)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(global)(::)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(abstract|async|const|enum|explicit|extern|implicit|internal|operator|override|partial|private|protected|public|static|sealed|unsafe|volatile)\b">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="(bool|byte|char|decimal|double|dynamic|float|int|long|object|sbyte|short|string|uint|ulong|ushort|var)\b\??">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(true|false|null)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(class|struct|record|interface)(\s+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="class"/>
|
||||
</rule>
|
||||
<rule pattern="(namespace|using)(\s+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="namespace"/>
|
||||
</rule>
|
||||
<rule pattern="@?[_a-zA-Z]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="class">
|
||||
<rule pattern="@?[_a-zA-Z]\w*">
|
||||
<token type="NameClass"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="namespace">
|
||||
<rule pattern="(?=\()">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(@?[_a-zA-Z]\w*|\.)+">
|
||||
<token type="NameNamespace"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
331
lexers/c++.xml
Normal file
331
lexers/c++.xml
Normal file
@ -0,0 +1,331 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>C++</name>
|
||||
<alias>cpp</alias>
|
||||
<alias>c++</alias>
|
||||
<filename>*.cpp</filename>
|
||||
<filename>*.hpp</filename>
|
||||
<filename>*.c++</filename>
|
||||
<filename>*.h++</filename>
|
||||
<filename>*.cc</filename>
|
||||
<filename>*.hh</filename>
|
||||
<filename>*.cxx</filename>
|
||||
<filename>*.hxx</filename>
|
||||
<filename>*.C</filename>
|
||||
<filename>*.H</filename>
|
||||
<filename>*.cp</filename>
|
||||
<filename>*.CPP</filename>
|
||||
<filename>*.tpp</filename>
|
||||
<mime_type>text/x-c++hdr</mime_type>
|
||||
<mime_type>text/x-c++src</mime_type>
|
||||
<ensure_nl>true</ensure_nl>
|
||||
<analyse first="true">
|
||||
<regex pattern="#include <[a-z_]+>" score="0.2" />
|
||||
<regex pattern="using namespace " score="0.4" />
|
||||
</analyse>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="classname">
|
||||
<rule pattern="(\[\[.+\]\])(\s*)">
|
||||
<bygroups>
|
||||
<token type="NameAttribute"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="NameClass"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\s*(?=[>{])">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="whitespace">
|
||||
<rule pattern="^#if\s+0">
|
||||
<token type="CommentPreproc"/>
|
||||
<push state="if0"/>
|
||||
</rule>
|
||||
<rule pattern="^#">
|
||||
<token type="CommentPreproc"/>
|
||||
<push state="macro"/>
|
||||
</rule>
|
||||
<rule pattern="^(\s*(?:/[*].*?[*]/\s*)?)(#if\s+0)">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="CommentPreproc"/>
|
||||
</bygroups>
|
||||
<push state="if0"/>
|
||||
</rule>
|
||||
<rule pattern="^(\s*(?:/[*].*?[*]/\s*)?)(#)">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="CommentPreproc"/>
|
||||
</bygroups>
|
||||
<push state="macro"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="//(\n|[\w\W]*?[^\\]\n)">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\\n)?[*][\w\W]*?[*](\\\n)?/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\\n)?[*][\w\W]*">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="macro">
|
||||
<rule pattern="(include)(\s+)("[^"]+?"|<[^>]+?>)">
|
||||
<bygroups>
|
||||
<token type="CommentPreproc"/>
|
||||
<token type="Text"/>
|
||||
<token type="CommentPreprocFile"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[^/\n]+">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="/[*](.|\n)*?[*]/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="/">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=\\)\n">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="statements">
|
||||
<rule pattern="(reinterpret_cast|static_assert|thread_local|dynamic_cast|static_cast|const_cast|co_return|protected|namespace|consteval|constexpr|typename|co_await|co_yield|operator|restrict|explicit|template|override|noexcept|requires|decltype|alignof|private|alignas|virtual|mutable|nullptr|concept|export|friend|typeid|throws|public|delete|final|throw|catch|using|this|new|try)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(enum)\b(\s+)(class)\b(\s*)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="classname"/>
|
||||
</rule>
|
||||
<rule pattern="(class|struct|enum|union)\b(\s*)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="classname"/>
|
||||
</rule>
|
||||
<rule pattern="\[\[.+\]\]">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
<rule pattern="(R)(")([^\\()\s]{,16})(\()((?:.|\n)*?)(\)\3)(")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralString"/>
|
||||
<token type="LiteralStringDelimiter"/>
|
||||
<token type="LiteralStringDelimiter"/>
|
||||
<token type="LiteralString"/>
|
||||
<token type="LiteralStringDelimiter"/>
|
||||
<token type="LiteralString"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(u8|u|U)(")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralString"/>
|
||||
</bygroups>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="(L?)(")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralString"/>
|
||||
</bygroups>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="(L?)(')(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])(')">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralStringChar"/>
|
||||
<token type="LiteralStringChar"/>
|
||||
<token type="LiteralStringChar"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="(\d+\.\d*|\.\d+|\d+[fF])[fF]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0[xX]([0-9A-Fa-f]('?[0-9A-Fa-f]+)*)[LlUu]*">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="0('?[0-7]+)+[LlUu]*">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="0[Bb][01]('?[01]+)*[LlUu]*">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9]('?[0-9]+)*[LlUu]*">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="\*/">
|
||||
<token type="Error"/>
|
||||
</rule>
|
||||
<rule pattern="[~!%^&*+=|?:<>/-]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[()\[\],.]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(restricted|volatile|continue|register|default|typedef|struct|extern|switch|sizeof|static|return|union|while|const|break|goto|enum|else|case|auto|for|asm|if|do)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(bool|int|long|float|short|double|char((8|16|32)_t)?|wchar_t|unsigned|signed|void|u?int(_fast|_least|)(8|16|32|64)_t)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(typename|__inline|restrict|_inline|thread|inline|naked)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="(__m(128i|128d|128|64))\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="__(forceinline|identifier|unaligned|declspec|fastcall|stdcall|finally|except|assume|int32|cdecl|int64|based|leave|int16|raise|noop|int8|w64|try|asm)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="(true|false|NULL)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="([a-zA-Z_]\w*)(\s*)(:)(?!:)">
|
||||
<bygroups>
|
||||
<token type="NameLabel"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="function">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="statements"/>
|
||||
</rule>
|
||||
<rule pattern=";">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\{">
|
||||
<token type="Punctuation"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\}">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\"\n]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="if0">
|
||||
<rule pattern="^\s*#if.*?(?<!\\)\n">
|
||||
<token type="CommentPreproc"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="^\s*#el(?:se|if).*\n">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="^\s*#endif.*?(?<!\\)\n">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern=".*?\n">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule pattern="((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;{]*)(\{)">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="NameFunction"/>
|
||||
<usingself state="root"/>
|
||||
<usingself state="root"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="function"/>
|
||||
</rule>
|
||||
<rule pattern="((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;]*)(;)">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="NameFunction"/>
|
||||
<usingself state="root"/>
|
||||
<usingself state="root"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule>
|
||||
<push state="statement"/>
|
||||
</rule>
|
||||
<rule pattern="__(multiple_inheritance|virtual_inheritance|single_inheritance|interface|uuidof|super|event)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="__(offload|blockingoffload|outer)\b">
|
||||
<token type="KeywordPseudo"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="statement">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="statements"/>
|
||||
</rule>
|
||||
<rule pattern="[{]">
|
||||
<token type="Punctuation"/>
|
||||
<push state="root"/>
|
||||
</rule>
|
||||
<rule pattern="[;}]">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
260
lexers/c.xml
Normal file
260
lexers/c.xml
Normal file
@ -0,0 +1,260 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>C</name>
|
||||
<alias>c</alias>
|
||||
<filename>*.c</filename>
|
||||
<filename>*.h</filename>
|
||||
<filename>*.idc</filename>
|
||||
<filename>*.x[bp]m</filename>
|
||||
<mime_type>text/x-chdr</mime_type>
|
||||
<mime_type>text/x-csrc</mime_type>
|
||||
<mime_type>image/x-xbitmap</mime_type>
|
||||
<mime_type>image/x-xpixmap</mime_type>
|
||||
<ensure_nl>true</ensure_nl>
|
||||
<analyse first="true" >
|
||||
<regex pattern="(?m)^\s*#include <" score="0.1" />
|
||||
<regex pattern="(?m)^\s*#ifn?def " score="0.1" />
|
||||
</analyse>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="statement">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="statements"/>
|
||||
</rule>
|
||||
<rule pattern="[{}]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern=";">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="function">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="statements"/>
|
||||
</rule>
|
||||
<rule pattern=";">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\{">
|
||||
<token type="Punctuation"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\}">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\"\n]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="macro">
|
||||
<rule pattern="(include)(\s*(?:/[*].*?[*]/\s*)?)([^\n]+)">
|
||||
<bygroups>
|
||||
<token type="CommentPreproc"/>
|
||||
<token type="Text"/>
|
||||
<token type="CommentPreprocFile"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[^/\n]+">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="/[*](.|\n)*?[*]/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="/">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=\\)\n">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="if0">
|
||||
<rule pattern="^\s*#if.*?(?<!\\)\n">
|
||||
<token type="CommentPreproc"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="^\s*#el(?:se|if).*\n">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="^\s*#endif.*?(?<!\\)\n">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern=".*?\n">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="whitespace">
|
||||
<rule pattern="^#if\s+0">
|
||||
<token type="CommentPreproc"/>
|
||||
<push state="if0"/>
|
||||
</rule>
|
||||
<rule pattern="^#">
|
||||
<token type="CommentPreproc"/>
|
||||
<push state="macro"/>
|
||||
</rule>
|
||||
<rule pattern="^(\s*(?:/[*].*?[*]/\s*)?)(#if\s+0)">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="CommentPreproc"/>
|
||||
</bygroups>
|
||||
<push state="if0"/>
|
||||
</rule>
|
||||
<rule pattern="^(\s*(?:/[*].*?[*]/\s*)?)(#)">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="CommentPreproc"/>
|
||||
</bygroups>
|
||||
<push state="macro"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="//(\n|[\w\W]*?[^\\]\n)">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\\n)?[*][\w\W]*?[*](\\\n)?/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\\n)?[*][\w\W]*">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="statements">
|
||||
<rule pattern="(L?)(")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralString"/>
|
||||
</bygroups>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="(L?)(')(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])(')">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralStringChar"/>
|
||||
<token type="LiteralStringChar"/>
|
||||
<token type="LiteralStringChar"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="(\d+\.\d*|\.\d+|\d+[fF])[fF]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0x[0-9a-fA-F]+[LlUu]*">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="0[0-7]+[LlUu]*">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="\d+[LlUu]*">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="\*/">
|
||||
<token type="Error"/>
|
||||
</rule>
|
||||
<rule pattern="[~!%^&*+=|?:<>/-]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[()\[\],.]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(restricted|volatile|continue|register|default|typedef|struct|extern|switch|sizeof|static|return|union|while|const|break|goto|enum|else|case|auto|for|asm|if|do)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(bool|int|long|float|short|double|char((8|16|32)_t)?|unsigned|signed|void|u?int(_fast|_least|)(8|16|32|64)_t)\b|\b[a-z]\w*_t\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(typename|__inline|restrict|_inline|thread|inline|naked)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="(__m(128i|128d|128|64))\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="__(forceinline|identifier|unaligned|declspec|fastcall|finally|stdcall|wchar_t|assume|except|int32|cdecl|int16|leave|based|raise|int64|noop|int8|w64|try|asm)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="(true|false|NULL)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="([a-zA-Z_]\w*)(\s*)(:)(?!:)">
|
||||
<bygroups>
|
||||
<token type="NameLabel"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b[A-Za-z_]\w*(?=\s*\()">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule pattern="((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;{]*)(\{)">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="NameFunction"/>
|
||||
<usingself state="root"/>
|
||||
<usingself state="root"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="function"/>
|
||||
</rule>
|
||||
<rule pattern="((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;]*)(;)">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="NameFunction"/>
|
||||
<usingself state="root"/>
|
||||
<usingself state="root"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule>
|
||||
<push state="statement"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
122
lexers/cap_n_proto.xml
Normal file
122
lexers/cap_n_proto.xml
Normal file
@ -0,0 +1,122 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Cap'n Proto</name>
|
||||
<alias>capnp</alias>
|
||||
<filename>*.capnp</filename>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="#.*?$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="@[0-9a-zA-Z]*">
|
||||
<token type="NameDecorator"/>
|
||||
</rule>
|
||||
<rule pattern="=">
|
||||
<token type="Literal"/>
|
||||
<push state="expression"/>
|
||||
</rule>
|
||||
<rule pattern=":">
|
||||
<token type="NameClass"/>
|
||||
<push state="type"/>
|
||||
</rule>
|
||||
<rule pattern="\$">
|
||||
<token type="NameAttribute"/>
|
||||
<push state="annotation"/>
|
||||
</rule>
|
||||
<rule pattern="(struct|enum|interface|union|import|using|const|annotation|extends|in|of|on|as|with|from|fixed)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="[\w.]+">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="[^#@=:$\w]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="type">
|
||||
<rule pattern="[^][=;,(){}$]+">
|
||||
<token type="NameClass"/>
|
||||
</rule>
|
||||
<rule pattern="[[(]">
|
||||
<token type="NameClass"/>
|
||||
<push state="parentype"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="parentype">
|
||||
<rule pattern="[^][;()]+">
|
||||
<token type="NameClass"/>
|
||||
</rule>
|
||||
<rule pattern="[[(]">
|
||||
<token type="NameClass"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="[])]">
|
||||
<token type="NameClass"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="expression">
|
||||
<rule pattern="[^][;,(){}$]+">
|
||||
<token type="Literal"/>
|
||||
</rule>
|
||||
<rule pattern="[[(]">
|
||||
<token type="Literal"/>
|
||||
<push state="parenexp"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="parenexp">
|
||||
<rule pattern="[^][;()]+">
|
||||
<token type="Literal"/>
|
||||
</rule>
|
||||
<rule pattern="[[(]">
|
||||
<token type="Literal"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="[])]">
|
||||
<token type="Literal"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="annotation">
|
||||
<rule pattern="[^][;,(){}=:]+">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
<rule pattern="[[(]">
|
||||
<token type="NameAttribute"/>
|
||||
<push state="annexp"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="annexp">
|
||||
<rule pattern="[^][;()]+">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
<rule pattern="[[(]">
|
||||
<token type="NameAttribute"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="[])]">
|
||||
<token type="NameAttribute"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
137
lexers/cassandra_cql.xml
Normal file
137
lexers/cassandra_cql.xml
Normal file
@ -0,0 +1,137 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Cassandra CQL</name>
|
||||
<alias>cassandra</alias>
|
||||
<alias>cql</alias>
|
||||
<filename>*.cql</filename>
|
||||
<mime_type>text/x-cql</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
<not_multiline>true</not_multiline>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="string">
|
||||
<rule pattern="[^']+">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="''">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="quoted-ident">
|
||||
<rule pattern="[^"]+">
|
||||
<token type="LiteralStringName"/>
|
||||
</rule>
|
||||
<rule pattern="""">
|
||||
<token type="LiteralStringName"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringName"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="dollar-string">
|
||||
<rule pattern="[^\$]+">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
</rule>
|
||||
<rule pattern="\$\$">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="(--|\/\/).*\n?">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/\*">
|
||||
<token type="CommentMultiline"/>
|
||||
<push state="multiline-comments"/>
|
||||
</rule>
|
||||
<rule pattern="(ascii|bigint|blob|boolean|counter|date|decimal|double|float|frozen|inet|int|list|map|set|smallint|text|time|timestamp|timeuuid|tinyint|tuple|uuid|varchar|varint)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(DURABLE_WRITES|LOCAL_QUORUM|MATERIALIZED|COLUMNFAMILY|REPLICATION|NORECURSIVE|NOSUPERUSER|PERMISSIONS|EACH_QUORUM|CONSISTENCY|PERMISSION|CLUSTERING|WRITETIME|SUPERUSER|KEYSPACES|AUTHORIZE|LOCAL_ONE|AGGREGATE|FINALFUNC|PARTITION|FILTERING|UNLOGGED|CONTAINS|DISTINCT|FUNCTION|LANGUAGE|INFINITY|INITCOND|TRUNCATE|KEYSPACE|PASSWORD|REPLACE|OPTIONS|TRIGGER|STORAGE|ENTRIES|RETURNS|COMPACT|PRIMARY|EXISTS|STATIC|PAGING|UPDATE|CUSTOM|VALUES|INSERT|DELETE|MODIFY|CREATE|SELECT|SCHEMA|LOGGED|REVOKE|RENAME|QUORUM|CALLED|STYPE|ORDER|ALTER|BATCH|BEGIN|COUNT|ROLES|APPLY|WHERE|SFUNC|LEVEL|INPUT|LOGIN|INDEX|TABLE|THREE|ALLOW|TOKEN|LIMIT|USING|USERS|GRANT|FROM|KEYS|JSON|USER|INTO|ROLE|TYPE|VIEW|DESC|WITH|DROP|FULL|ASC|TTL|OFF|PER|KEY|USE|ADD|NAN|ONE|ALL|ANY|TWO|AND|NOT|AS|IN|IF|OF|IS|ON|TO|BY|OR)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="[+*/<>=~!@#%^&|`?-]+">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="(?s)(java|javascript)(\s+)(AS)(\s+)('|\$\$)(.*?)(\5)">
|
||||
<usingbygroup>
|
||||
<sublexer_name_group>1</sublexer_name_group>
|
||||
<code_group>6</code_group>
|
||||
<emitters>
|
||||
<token type="NameBuiltin"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
</emitters>
|
||||
</usingbygroup>
|
||||
</rule>
|
||||
<rule pattern="(true|false|null)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="0x[0-9a-f]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="\.[0-9]+(e[+-]?[0-9]+)?">
|
||||
<token type="Error"/>
|
||||
</rule>
|
||||
<rule pattern="-?[0-9]+(\.[0-9])?(e[+-]?[0-9]+)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9]+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringName"/>
|
||||
<push state="quoted-ident"/>
|
||||
</rule>
|
||||
<rule pattern="\$\$">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
<push state="dollar-string"/>
|
||||
</rule>
|
||||
<rule pattern="[a-z_]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern=":(['"]?)[a-z]\w*\b\1">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="[;:()\[\]\{\},.]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="multiline-comments">
|
||||
<rule pattern="/\*">
|
||||
<token type="CommentMultiline"/>
|
||||
<push state="multiline-comments"/>
|
||||
</rule>
|
||||
<rule pattern="\*/">
|
||||
<token type="CommentMultiline"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[^/*]+">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="[/*]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
151
lexers/ceylon.xml
Normal file
151
lexers/ceylon.xml
Normal file
@ -0,0 +1,151 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Ceylon</name>
|
||||
<alias>ceylon</alias>
|
||||
<filename>*.ceylon</filename>
|
||||
<mime_type>text/x-ceylon</mime_type>
|
||||
<dot_all>true</dot_all>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="class">
|
||||
<rule pattern="[A-Za-z_]\w*">
|
||||
<token type="NameClass"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="import">
|
||||
<rule pattern="[a-z][\w.]*">
|
||||
<token type="NameNamespace"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="comment">
|
||||
<rule pattern="[^*/]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="/\*">
|
||||
<token type="CommentMultiline"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\*/">
|
||||
<token type="CommentMultiline"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[*/]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)([a-zA-Z_]\w*)(\s*)(\()">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[^\S\n]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/\*">
|
||||
<token type="CommentMultiline"/>
|
||||
<push state="comment"/>
|
||||
</rule>
|
||||
<rule pattern="(shared|abstract|formal|default|actual|variable|deprecated|small|late|literal|doc|by|see|throws|optional|license|tagged|final|native|annotation|sealed)\b">
|
||||
<token type="NameDecorator"/>
|
||||
</rule>
|
||||
<rule pattern="(break|case|catch|continue|else|finally|for|in|if|return|switch|this|throw|try|while|is|exists|dynamic|nonempty|then|outer|assert|let)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(abstracts|extends|satisfies|super|given|of|out|assign)\b">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="(function|value|void|new)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(assembly|module|package)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(true|false|null)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(class|interface|object|alias)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordDeclaration"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="class"/>
|
||||
</rule>
|
||||
<rule pattern="(import)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="import"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="'\\.'|'[^\\]'|'\\\{#[0-9a-fA-F]{4}\}'">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="".*``.*``.*"">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
</rule>
|
||||
<rule pattern="(\.)([a-z_]\w*)">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="NameAttribute"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_]\w*:">
|
||||
<token type="NameLabel"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="[~^*!%&\[\](){}<>|+=:;,./?-]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\d{1,3}(_\d{3})+\.\d{1,3}(_\d{3})+[kMGTPmunpf]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="\d{1,3}(_\d{3})+\.[0-9]+([eE][+-]?[0-9]+)?[kMGTPmunpf]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9][0-9]*\.\d{1,3}(_\d{3})+[kMGTPmunpf]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9][0-9]*\.[0-9]+([eE][+-]?[0-9]+)?[kMGTPmunpf]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="#([0-9a-fA-F]{4})(_[0-9a-fA-F]{4})+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="#[0-9a-fA-F]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="\$([01]{4})(_[01]{4})+">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="\$[01]+">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="\d{1,3}(_\d{3})+[kMGTP]?">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9]+[kMGTP]?">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
197
lexers/cfengine3.xml
Normal file
197
lexers/cfengine3.xml
Normal file
@ -0,0 +1,197 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>CFEngine3</name>
|
||||
<alias>cfengine3</alias>
|
||||
<alias>cf3</alias>
|
||||
<filename>*.cf</filename>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="interpol">
|
||||
<rule pattern="\$[{(]">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="[})]">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[^${()}]+">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="arglist">
|
||||
<rule pattern="\)">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern=",">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\w+">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="#.*?\n">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="^@.*?\n">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="(body)(\s+)(\S+)(\s+)(control)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(body|bundle|promise)(\s+)(\S+)(\s+)(\w+)(\()">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="arglist"/>
|
||||
</rule>
|
||||
<rule pattern="(body|bundle|promise)(\s+)(\S+)(\s+)(\w+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\S+)(\s*)(=>)(\s*)">
|
||||
<bygroups>
|
||||
<token type="KeywordReserved"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="([\w.!&|()"$]+)(::)">
|
||||
<bygroups>
|
||||
<token type="NameClass"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="doublequotestring"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="LiteralString"/>
|
||||
<push state="singlequotestring"/>
|
||||
</rule>
|
||||
<rule pattern="`">
|
||||
<token type="LiteralString"/>
|
||||
<push state="backtickstring"/>
|
||||
</rule>
|
||||
<rule pattern="(\w+)(\()">
|
||||
<bygroups>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\w+)(:)">
|
||||
<bygroups>
|
||||
<token type="KeywordDeclaration"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="@[{(][^)}]+[})]">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="\$[(][^)]+[)]">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="[(){},;]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="=>">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="->">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\d+\.\d+">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="\w+">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="doublequotestring">
|
||||
<rule pattern="\$[{(]">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push state="interpol"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern=".">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="singlequotestring">
|
||||
<rule pattern="\$[{(]">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push state="interpol"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern=".">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="backtickstring">
|
||||
<rule pattern="\$[{(]">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push state="interpol"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="`">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern=".">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
92
lexers/cfstatement.xml
Normal file
92
lexers/cfstatement.xml
Normal file
@ -0,0 +1,92 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>cfstatement</name>
|
||||
<alias>cfs</alias>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
<not_multiline>true</not_multiline>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/\*(?:.|\n)*?\*/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="\+\+|--">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[-+*/^&=!]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="<=|>=|<|>|==">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="mod\b">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="(eq|lt|gt|lte|gte|not|is|and|or)\b">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\|\||&&">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\?">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="'.*?'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\d+">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="(if|else|len|var|xml|default|break|switch|component|property|function|do|try|catch|in|continue|for|return|while|required|any|array|binary|boolean|component|date|guid|numeric|query|string|struct|uuid|case)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(true|false|null)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(application|session|client|cookie|super|this|variables|arguments)\b">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="([a-z_$][\w.]*)(\s*)(\()">
|
||||
<bygroups>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[a-z_$][\w.]*">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="[()\[\]{};:,.\\]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern="""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="#.+?#">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
</rule>
|
||||
<rule pattern="[^"#]+">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="#">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
134
lexers/chaiscript.xml
Normal file
134
lexers/chaiscript.xml
Normal file
@ -0,0 +1,134 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>ChaiScript</name>
|
||||
<alias>chai</alias>
|
||||
<alias>chaiscript</alias>
|
||||
<filename>*.chai</filename>
|
||||
<mime_type>text/x-chaiscript</mime_type>
|
||||
<mime_type>application/x-chaiscript</mime_type>
|
||||
<dot_all>true</dot_all>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="dqstring">
|
||||
<rule pattern="\$\{[^"}]+?\}">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
</rule>
|
||||
<rule pattern="\$">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="\\\\">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="\\"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\"$]+">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="commentsandwhitespace">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/\*.*?\*/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="^\#.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="slashstartsregex">
|
||||
<rule>
|
||||
<include state="commentsandwhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/([gim]+\b|\B)">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(?=/)">
|
||||
<token type="Text"/>
|
||||
<push state="#pop" state="badregex"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="badregex">
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="commentsandwhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="[^\S\n]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|\.\.(<<|>>>?|==?|!=?|[-<>+*%&|^/])=?">
|
||||
<token type="Operator"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule pattern="[{(\[;,]">
|
||||
<token type="Punctuation"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule pattern="[})\].]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[=+\-*/]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="(for|in|while|do|break|return|continue|if|else|throw|try|catch)\b">
|
||||
<token type="Keyword"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule pattern="(var)\b">
|
||||
<token type="KeywordDeclaration"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule pattern="(attr|def|fun)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="(true|false)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(eval|throw)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="`\S+`">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="[$a-zA-Z_]\w*">
|
||||
<token type="NameOther"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0x[0-9a-fA-F]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9]+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<push state="dqstring"/>
|
||||
</rule>
|
||||
<rule pattern="'(\\\\|\\'|[^'])*'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
143
lexers/chapel.xml
Normal file
143
lexers/chapel.xml
Normal file
@ -0,0 +1,143 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Chapel</name>
|
||||
<alias>chapel</alias>
|
||||
<alias>chpl</alias>
|
||||
<filename>*.chpl</filename>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="procname">
|
||||
<rule pattern="([a-zA-Z_][.\w$]*|\~[a-zA-Z_][.\w$]*|[+*/!~%<>=&^|\-:]{1,2})">
|
||||
<token type="NameFunction"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="Punctuation"/>
|
||||
<push state="receivertype"/>
|
||||
</rule>
|
||||
<rule pattern="\)+\.">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="receivertype">
|
||||
<rule pattern="(unmanaged|borrowed|atomic|single|shared|owned|sync)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(complex|nothing|opaque|string|locale|bytes|range|imag|real|bool|uint|void|int)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="[^()]*">
|
||||
<token type="NameOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="\n">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="//(.*?)\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\\n)?[*](.|\n)*?[*](\\\n)?/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="(config|const|inout|param|type|out|ref|var|in)\b">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="(false|none|true|nil)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(complex|nothing|opaque|string|locale|bytes|range|imag|real|bool|uint|void|int)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(implements|forwarding|prototype|otherwise|subdomain|primitive|unmanaged|override|borrowed|lifetime|coforall|continue|private|require|dmapped|cobegin|foreach|lambda|sparse|shared|domain|pragma|reduce|except|export|extern|throws|forall|delete|return|noinit|single|import|select|public|inline|serial|atomic|defer|break|local|index|throw|catch|label|begin|where|while|align|yield|owned|only|this|sync|with|scan|else|enum|init|when|then|let|for|try|use|new|zip|if|by|as|on|do)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(iter)(\s+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="TextWhitespace"/>
|
||||
</bygroups>
|
||||
<push state="procname"/>
|
||||
</rule>
|
||||
<rule pattern="(proc)(\s+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="TextWhitespace"/>
|
||||
</bygroups>
|
||||
<push state="procname"/>
|
||||
</rule>
|
||||
<rule pattern="(operator)(\s+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="TextWhitespace"/>
|
||||
</bygroups>
|
||||
<push state="procname"/>
|
||||
</rule>
|
||||
<rule pattern="(class|interface|module|record|union)(\s+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="TextWhitespace"/>
|
||||
</bygroups>
|
||||
<push state="classname"/>
|
||||
</rule>
|
||||
<rule pattern="\d+i">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\d+\.\d*([Ee][-+]\d+)?i">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\.\d+([Ee][-+]\d+)?i">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\d+[Ee][-+]\d+i">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="(\d*\.\d+)([eE][+-]?[0-9]+)?i?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="\d+[eE][+-]?[0-9]+i?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0[bB][01]+">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="0[xX][0-9a-fA-F]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="0[oO][0-7]+">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9]+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="'(\\\\|\\'|[^'])*'">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="(=|\+=|-=|\*=|/=|\*\*=|%=|&=|\|=|\^=|&&=|\|\|=|<<=|>>=|<=>|<~>|\.\.|by|#|\.\.\.|&&|\|\||!|&|\||\^|~|<<|>>|==|!=|<=|>=|<|>|[+\-*/%]|\*\*)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[:;,.?()\[\]{}]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_][\w$]*">
|
||||
<token type="NameOther"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="classname">
|
||||
<rule pattern="[a-zA-Z_][\w$]*">
|
||||
<token type="NameClass"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
55
lexers/cheetah.xml
Normal file
55
lexers/cheetah.xml
Normal file
@ -0,0 +1,55 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Cheetah</name>
|
||||
<alias>cheetah</alias>
|
||||
<alias>spitfire</alias>
|
||||
<filename>*.tmpl</filename>
|
||||
<filename>*.spt</filename>
|
||||
<mime_type>application/x-cheetah</mime_type>
|
||||
<mime_type>application/x-spitfire</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="(##[^\n]*)$">
|
||||
<bygroups>
|
||||
<token type="Comment"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="#[*](.|\n)*?[*]#">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="#end[^#\n]*(?:#|$)">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="#slurp$">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="(#[a-zA-Z]+)([^#\n]*)(#|$)">
|
||||
<bygroups>
|
||||
<token type="CommentPreproc"/>
|
||||
<using lexer="Python"/>
|
||||
<token type="CommentPreproc"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\$)([a-zA-Z_][\w.]*\w)">
|
||||
<bygroups>
|
||||
<token type="CommentPreproc"/>
|
||||
<using lexer="Python"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\$\{!?)(.*?)(\})(?s)">
|
||||
<bygroups>
|
||||
<token type="CommentPreproc"/>
|
||||
<using lexer="Python"/>
|
||||
<token type="CommentPreproc"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(?sx)
 (.+?) # anything, followed by:
 (?:
 (?=\#[#a-zA-Z]*) | # an eval comment
 (?=\$[a-zA-Z_{]) | # a substitution
 \Z # end of string
 )
 ">
|
||||
<token type="Other"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
71
lexers/clojure.xml
Normal file
71
lexers/clojure.xml
Normal file
@ -0,0 +1,71 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Clojure</name>
|
||||
<alias>clojure</alias>
|
||||
<alias>clj</alias>
|
||||
<alias>edn</alias>
|
||||
<filename>*.clj</filename>
|
||||
<filename>*.edn</filename>
|
||||
<mime_type>text/x-clojure</mime_type>
|
||||
<mime_type>application/x-clojure</mime_type>
|
||||
<mime_type>application/edn</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern=";.*$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="[,\s]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="-?\d+\.\d+">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="-?\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="0x-?[abcdef\d]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="'(?!#)[\w!$%*+<=>?/.#-]+">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="\\(.|[a-z]+)">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="::?#?(?!#)[\w!$%*+<=>?/.#-]+">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="~@|[`\'#^~&@]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="(quote|loop|new|var|let|def|if|do|fn|\.) ">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(definterface|defprotocol|defproject|defstruct|definline|defmethod|defrecord|defmulti|defmacro|defonce|declare|deftype|defn-|def-|defn|ns) ">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="(clear-agent-errors|construct-proxy|bit-shift-right|get-proxy-class|special-symbol\?|with-local-vars|proxy-mappings|bit-shift-left|sorted-map-by|macroexpand-1|remove-method|create-struct|resultset-seq|inspect-table|inspect-tree|update-proxy|aset-boolean|agent-errors|with-out-str|insert-child|append-child|intersection|insert-right|to-array-2d|rename-keys|println-str|macroexpand|aset-double|select-keys|insert-left|aset-float|aset-short|interleave|re-pattern|make-array|identical\?|take-while|into-array|re-matches|re-matcher|complement|vector-zip|drop-while|when-first|map-invert|sorted-map|ns-resolve|difference|sorted-set|merge-with|ns-publics|split-with|ns-interns|ns-imports|constantly|struct-map|comparator|not-every\?|aset-long|print-str|re-groups|lazy-cons|remove-ns|namespace|await-for|contains\?|array-map|create-ns|make-node|with-meta|with-open|instance\?|ns-refers|aset-byte|aset-char|load-file|read-line|replicate|send-off|aset-int|distinct|not-any\?|take-nth|tree-seq|split-at|to-array|ns-unmap|identity|find-doc|find-var|hash-set|when-not|children|when-let|lazy-cat|hash-map|line-seq|rand-int|keyword\?|file-seq|accessor|replace|bit-not|find-ns|resolve|bit-and|println|binding|locking|vector\?|partial|nthrest|max-key|bit-xor|dotimes|ref-set|xml-seq|boolean|var-get|seq-zip|sort-by|branch\?|butlast|symbol\?|project|min-key|ns-name|comment|string\?|iterate|commute|alength|xml-zip|keyword|newline|re-find|reverse|var-set|prn-str|bit-or|import|re-seq|rights|assert|reduce|remove|gensym|rename|filter|ffirst|if-let|false\?|pr-str|every\?|vector|mapcat|ensure|rfirst|concat|second|double|select|dosync|symbol|subvec|if-not|ns-map|struct|zipper|zipmap|all-ns|dissoc|repeat|assoc|cycle|class|deref|zero\?|slurp|short|dorun|doseq|merge|memfn|agent|rrest|count|parse|right|float|flush|alter|fnseq|frest|doall|print|refer|in-ns|apply|union|await|list\*|proxy|lefts|true\?|index|first|range|left|keys|aset|join|into|last|read|rand|list|load|long|loop|conj|test|vals|pos\?|bean|peek|subs|path|time|find|rest|eval|end\?|edit|map\?|drop|root|aget|rseq|down|doto|meta|send|when|byte|take|seq\?|sync|name|neg\?|some|sort|cast|char|disj|next|not=|nil\?|node|comp|cond|cons|quot|var\?|max|new|rem|set|doc|seq|for|get|ref|inc|int|key|not|prn|min|map|val|nth|dec|pop|and|str|pr|\.\.|up|>=|->|==|<=|or|=|/|>|-|\*|\+|<) ">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=\()(?!#)[\w!$%*+<=>?/.#-]+">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="(?!#)[\w!$%*+<=>?/.#-]+">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="(\[|\])">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(\{|\})">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(\(|\))">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
90
lexers/cmake.xml
Normal file
90
lexers/cmake.xml
Normal file
@ -0,0 +1,90 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>CMake</name>
|
||||
<alias>cmake</alias>
|
||||
<filename>*.cmake</filename>
|
||||
<filename>CMakeLists.txt</filename>
|
||||
<mime_type>text/x-cmake</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="\b(\w+)([ \t]*)(\()">
|
||||
<bygroups>
|
||||
<token type="NameBuiltin"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="args"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="keywords"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="ws"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="args">
|
||||
<rule pattern="\(">
|
||||
<token type="Punctuation"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\)">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(\$\{)(.+?)(\})">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="NameVariable"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\$ENV\{)(.+?)(\})">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="NameVariable"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\$<)(.+?)(>)">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="NameVariable"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(?s)".*?"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="\\\S+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="[^)$"# \t\n]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="keywords"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="ws"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string"/>
|
||||
<state name="keywords">
|
||||
<rule pattern="\b(WIN32|UNIX|APPLE|CYGWIN|BORLAND|MINGW|MSVC|MSVC_IDE|MSVC60|MSVC70|MSVC71|MSVC80|MSVC90)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="ws">
|
||||
<rule pattern="[ \t]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="#.*\n">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
90
lexers/cobol.xml
Normal file
90
lexers/cobol.xml
Normal file
@ -0,0 +1,90 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>COBOL</name>
|
||||
<alias>cobol</alias>
|
||||
<filename>*.cob</filename>
|
||||
<filename>*.COB</filename>
|
||||
<filename>*.cpy</filename>
|
||||
<filename>*.CPY</filename>
|
||||
<mime_type>text/x-cobol</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="strings">
|
||||
<rule pattern=""[^"\n]*("|\n)">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="'[^'\n]*('|\n)">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="nums">
|
||||
<rule pattern="\d+(\s*|\.$|$)">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="[+-]?\d*\.\d+(E[-+]?\d+)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="[+-]?\d+\.\d*(E[-+]?\d+)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="comment"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="strings"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="core"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="nums"/>
|
||||
</rule>
|
||||
<rule pattern="[a-z0-9]([\w\-]*[a-z0-9]+)?">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="[ \t]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="comment">
|
||||
<rule pattern="(^.{6}[*/].*\n|^.{6}|\*>.*\n)">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="core">
|
||||
<rule pattern="(^|(?<=[^\w\-]))(ALL\s+)?((ZEROES)|(HIGH-VALUE|LOW-VALUE|QUOTE|SPACE|ZERO)(S)?)\s*($|(?=[^\w\-]))">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(^|(?<=[^\w\-]))(WORKING-STORAGE|IDENTIFICATION|LOCAL-STORAGE|CONFIGURATION|END-EVALUATE|FILE-CONTROL|END-UNSTRING|END-SUBTRACT|END-MULTIPLY|INPUT-OUTPUT|END-PERFORM|END-DISPLAY|END-OF-PAGE|END-COMPUTE|ENVIRONMENT|I-O-CONTROL|END-REWRITE|END-RETURN|INITIALIZE|END-ACCEPT|END-DIVIDE|PROGRAM-ID|END-STRING|END-DELETE|END-SEARCH|END-WRITE|PROCEDURE|END-START|TERMINATE|END-READ|MULTIPLY|CONTINUE|SUPPRESS|SUBTRACT|INITIATE|UNSTRING|DIVISION|VALIDATE|END-CALL|ALLOCATE|GENERATE|EVALUATE|PERFORM|FOREVER|LINKAGE|END-ADD|REWRITE|INSPECT|SECTION|RELEASE|COMPUTE|DISPLAY|END-IF|GOBACK|INVOKE|CANCEL|UNLOCK|SCREEN|SEARCH|DELETE|STRING|DIVIDE|ACCEPT|RETURN|RESUME|START|RAISE|MERGE|CLOSE|WRITE|FILE|STOP|FREE|READ|ELSE|THEN|SORT|EXIT|OPEN|CALL|MOVE|DATA|END|SET|ADD|USE|GO|FD|SD|IF)\s*($|(?=[^\w\-]))">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="(^|(?<=[^\w\-]))(ALPHANUMERIC-EDITED|PROCEDURE-POINTER|ENVIRONMENT-VALUE|ENVIRONMENT-NAME|ALPHABETIC-UPPER|FOREGROUND-COLOR|ALPHABETIC-LOWER|BACKGROUND-COLOR|OBJECT-COMPUTER|SOURCE-COMPUTER|PROGRAM-POINTER|ARGUMENT-NUMBER|NATIONAL-EDITED|NUMERIC-EDITED|LINAGE-COUNTER|UNSIGNED-SHORT|ARGUMENT-VALUE|PACKED-DECIMAL|SPECIAL-NAMES|AUTOTERMINATE|DECIMAL-POINT|CORRESPONDING|UNSIGNED-LONG|SEGMENT-LIMIT|REVERSE-VIDEO|SIGNED-SHORT|SYNCHRONIZED|ALPHANUMERIC|ALTERNATEANY|UNSIGNED-INT|ORGANIZATION|DECLARATIVES|COMMAND-LINE|FUNCTION-ID|SIGNED-LONG|INITIALIZED|FLOAT-SHORT|BYTE-LENGTH|DAY-OF-WEEK|DESCENDING|CHARACTERS|SEQUENTIAL|REPOSITORY|SIGNED-INT|SORT-MERGE|DUPLICATES|STANDARD-1|STANDARD-2|CONVERTING|FLOAT-LONG|ALPHABETIC|PROCEDURES|RECORDING|HIGHLIGHT|ADVANCING|RETURNING|REPLACING|UNDERLINE|TRANSFORM|REMAINDER|INTRINSIC|JUSTIFIED|REFERENCE|REDEFINES|EXCLUSIVE|RECURSIVE|EXCEPTION|COLLATING|ASCENDING|REPORTING|AUTO-SKIP|DEBUGGING|AUTOMATIC|CHARACTER|PARAGRAPH|DELIMITED|DELIMITER|DEPENDING|PREVIOUS|POSITIVE|POSITION|CHAINING|STANDARD|FUNCTION|OVERFLOW|PRINTING|CODE-SET|SEPARATE|OPTIONAL|SYMBOLIC|SEQUENCE|NEGATIVE|TALLYING|NATIONAL|REQUIRED|CURRENCY|MULTIPLE|TRAILING|LOWLIGHT|OVERLINE|SENTENCE|RELATIVE|ROLLBACK|CONTROLS|UNSIGNED|INDICATE|IGNORING|ALPHABET|CONTAINS|CONSTANT|EXTERNAL|YYYYMMDD|FILE-ID|CONTROL|RENAMES|REMOVAL|HEADING|YYYYDDD|RESERVE|VARYING|RECORDS|REPORTS|COLUMNS|PROGRAM|INDEXED|FOOTING|INITIAL|PROCEED|ROUNDED|DEFAULT|PRESENT|INVALID|POINTER|SHARING|PADDING|DYNAMIC|OMITTED|ADDRESS|LEADING|CONTENT|NUMBERS|THROUGH|NUMERIC|PRINTER|SELECT|COMMON|REPORT|LOCALE|ACCESS|LINAGE|MANUAL|MEMORY|LIMITS|FILLER|EXTEND|ESCAPE|GIVING|NATIVE|GLOBAL|COMMIT|ASSIGN|STATUS|OUTPUT|NUMBER|LENGTH|REWIND|CURSOR|BEFORE|OCCURS|SOURCE|IGNORE|VALUES|RECORD|BOTTOM|SIGNED|RANDOM|QUOTES|PROMPT|SCROLL|EBCDIC|FORMAT|SECURE|DETAIL|UPDATE|COLUMN|TIMES|USAGE|CLASS|FINAL|FIRST|USING|CYCLE|UNTIL|MINUS|INPUT|FIXED|INDEX|VALUE|OTHER|QUOTE|ENTRY|ORDER|RIGHT|BLOCK|LABEL|BLINK|BASED|AFTER|NULLS|COUNT|AREAS|WORDS|GROUP|ERASE|LIMIT|LINES|ALTER|COMMA|ERROR|BLANK|THRU|CORR|REEL|FROM|WITH|DATE|WHEN|CODE|SAME|WAIT|COPY|DISK|PLUS|COLS|INTO|UPON|DOWN|PAGE|SIGN|JUST|ONLY|LAST|ALSO|SIZE|UNIT|LINE|BELL|TYPE|BEEP|LOCK|AUTO|NULL|AREA|MODE|SYNC|TIME|NEXT|TAPE|TEST|FULL|LEFT|EOL|CRT|I-O|TOP|DAY|EOS|EOP|FOR|ARE|OFF|ALL|COL|SUM|KEY|RUN|UP|ON|IS|IN|BY|OF|ID|DE|AT|RD|TO|NO|AS)\s*($|(?=[^\w\-]))">
|
||||
<token type="KeywordPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="(^|(?<=[^\w\-]))(REPRESENTS-NOT-A-NUMBER|FUNCTION-POINTER|FLOAT-DECIMAL-34|FLOAT-DECIMAL-16|ENTRY-CONVENTION|EXCEPTION-OBJECT|OBJECT-REFERENCE|FLOAT-BINARY-34|FLOAT-BINARY-16|VALIDATE-STATUS|FLOAT-EXTENDED|CLASSIFICATION|FLOAT-BINARY-7|SYSTEM-DEFAULT|COMMUNICATION|PAGE-COUNTER|USER-DEFAULT|LINE-COUNTER|ACTIVE-CLASS|DATA-POINTER|INTERFACE-ID|DESTINATION|GROUP-USAGE|LC_MESSAGES|SUB-QUEUE-3|SUB-QUEUE-2|SUB-QUEUE-1|END-RECEIVE|LC_MONETARY|VAL-STATUS|LC_NUMERIC|IMPLEMENTS|LC_COLLATE|ARITHMETIC|STATEMENT|METHOD-ID|INTERFACE|ATTRIBUTE|PROTOTYPE|CONDITION|UNIVERSAL|LC_CTYPE|VALIDATE|PROPERTY|TERMINAL|INFINITY|INHERITS|CLASS-ID|RELATION|OVERRIDE|ANYCASE|DISABLE|ALIGNED|REPLACE|RAISING|EXPANDS|FACTORY|TYPEDEF|MESSAGE|RECEIVE|BOOLEAN|SECONDS|SOURCES|SEGMENT|LC_TIME|OPTIONS|METHOD|UTF-16|OBJECT|NORMAL|NESTED|CENTER|LC_ALL|RESUME|INVOKE|ENABLE|STRONG|FORMAT|SYMBOL|B-XOR|QUEUE|RESET|PURGE|RETRY|B-AND|VALID|B-NOT|UTF-8|SUPER|RAISE|UCS-4|TABLE|CHAIN|NONE|B-OR|STEP|SEND|SELF|TEXT|BIT|EMI|ESI|EGI|GET|CD|CF|EC|EO|PF|PH|RH|RF|CH)\s*($|(?=[^\w\-]))">
|
||||
<token type="Error"/>
|
||||
</rule>
|
||||
<rule pattern="(^|(?<=[^\w\-]))(PIC\s+.+?(?=(\s|\.\s))|PICTURE\s+.+?(?=(\s|\.\s))|(COMPUTATIONAL)(-[1-5X])?|(COMP)(-[1-5X])?|BINARY-C-LONG|BINARY-CHAR|BINARY-DOUBLE|BINARY-LONG|BINARY-SHORT|BINARY)\s*($|(?=[^\w\-]))">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(\*\*|\*|\+|-|/|<=|>=|<|>|==|/=|=)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="([(),;:&%.])">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(^|(?<=[^\w\-]))(ABS|ACOS|ANNUITY|ASIN|ATAN|BYTE-LENGTH|CHAR|COMBINED-DATETIME|CONCATENATE|COS|CURRENT-DATE|DATE-OF-INTEGER|DATE-TO-YYYYMMDD|DAY-OF-INTEGER|DAY-TO-YYYYDDD|EXCEPTION-(?:FILE|LOCATION|STATEMENT|STATUS)|EXP10|EXP|E|FACTORIAL|FRACTION-PART|INTEGER-OF-(?:DATE|DAY|PART)|INTEGER|LENGTH|LOCALE-(?:DATE|TIME(?:-FROM-SECONDS)?)|LOG(?:10)?|LOWER-CASE|MAX|MEAN|MEDIAN|MIDRANGE|MIN|MOD|NUMVAL(?:-C)?|ORD(?:-MAX|-MIN)?|PI|PRESENT-VALUE|RANDOM|RANGE|REM|REVERSE|SECONDS-FROM-FORMATTED-TIME|SECONDS-PAST-MIDNIGHT|SIGN|SIN|SQRT|STANDARD-DEVIATION|STORED-CHAR-LENGTH|SUBSTITUTE(?:-CASE)?|SUM|TAN|TEST-DATE-YYYYMMDD|TEST-DAY-YYYYDDD|TRIM|UPPER-CASE|VARIANCE|WHEN-COMPILED|YEAR-TO-YYYY)\s*($|(?=[^\w\-]))">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="(^|(?<=[^\w\-]))(true|false)\s*($|(?=[^\w\-]))">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(^|(?<=[^\w\-]))(equal|equals|ne|lt|le|gt|ge|greater|less|than|not|and|or)\s*($|(?=[^\w\-]))">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
210
lexers/coffeescript.xml
Normal file
210
lexers/coffeescript.xml
Normal file
@ -0,0 +1,210 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>CoffeeScript</name>
|
||||
<alias>coffee-script</alias>
|
||||
<alias>coffeescript</alias>
|
||||
<alias>coffee</alias>
|
||||
<filename>*.coffee</filename>
|
||||
<mime_type>text/coffeescript</mime_type>
|
||||
<dot_all>true</dot_all>
|
||||
<not_multiline>true</not_multiline>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="commentsandwhitespace">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="###[^#].*?###">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="#(?!##[^#]).*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="multilineregex">
|
||||
<rule pattern="[^/#]+">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="///([gim]+\b|\B)">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="#\{">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push state="interpoling_string"/>
|
||||
</rule>
|
||||
<rule pattern="[/#]">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="slashstartsregex">
|
||||
<rule>
|
||||
<include state="commentsandwhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="///">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<push state="#pop" state="multilineregex"/>
|
||||
</rule>
|
||||
<rule pattern="/(?! )(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/([gim]+\b|\B)">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="/">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="tsqs">
|
||||
<rule pattern="'''">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="#|\\.|\'|"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="strings"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="dqs">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\.|\'">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="#\{">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push state="interpoling_string"/>
|
||||
</rule>
|
||||
<rule pattern="#">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="strings"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="sqs">
|
||||
<rule pattern="'">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="#|\\.|"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="strings"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="tdqs">
|
||||
<rule pattern=""""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\.|\'|"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="#\{">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push state="interpoling_string"/>
|
||||
</rule>
|
||||
<rule pattern="#">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="strings"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="commentsandwhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="^(?=\s|/)">
|
||||
<token type="Text"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule pattern="\+\+|~|&&|\band\b|\bor\b|\bis\b|\bisnt\b|\bnot\b|\?|:|\|\||\\(?=\n)|(<<|>>>?|==?(?!>)|!=?|=(?!>)|-(?!>)|[<>+*`%&\|\^/])=?">
|
||||
<token type="Operator"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule pattern="(?:\([^()]*\))?\s*[=-]>">
|
||||
<token type="NameFunction"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule pattern="[{(\[;,]">
|
||||
<token type="Punctuation"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule pattern="[})\].]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(?<![.$])(for|own|in|of|while|until|loop|break|return|continue|switch|when|then|if|unless|else|throw|try|catch|finally|new|delete|typeof|instanceof|super|extends|this|class|by)\b">
|
||||
<token type="Keyword"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule pattern="(?<![.$])(true|false|yes|no|on|off|null|NaN|Infinity|undefined)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(Array|Boolean|Date|Error|Function|Math|netscape|Number|Object|Packages|RegExp|String|sun|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|document|window)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="[$a-zA-Z_][\w.:$]*\s*[:=]\s">
|
||||
<token type="NameVariable"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule pattern="@[$a-zA-Z_][\w.:$]*\s*[:=]\s">
|
||||
<token type="NameVariableInstance"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule pattern="@">
|
||||
<token type="NameOther"/>
|
||||
<push state="slashstartsregex"/>
|
||||
</rule>
|
||||
<rule pattern="@?[$a-zA-Z_][\w$]*">
|
||||
<token type="NameOther"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0x[0-9a-fA-F]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9]+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern=""""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="tdqs"/>
|
||||
</rule>
|
||||
<rule pattern="'''">
|
||||
<token type="LiteralString"/>
|
||||
<push state="tsqs"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="dqs"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="LiteralString"/>
|
||||
<push state="sqs"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="interpoling_string">
|
||||
<rule pattern="\}">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="strings">
|
||||
<rule pattern="[^#\\\'"]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
184
lexers/common_lisp.xml
Normal file
184
lexers/common_lisp.xml
Normal file
@ -0,0 +1,184 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Common Lisp</name>
|
||||
<alias>common-lisp</alias>
|
||||
<alias>cl</alias>
|
||||
<alias>lisp</alias>
|
||||
<filename>*.cl</filename>
|
||||
<filename>*.lisp</filename>
|
||||
<mime_type>text/x-common-lisp</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="body">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern=";.*$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="#\|">
|
||||
<token type="CommentMultiline"/>
|
||||
<push state="multiline-comment"/>
|
||||
</rule>
|
||||
<rule pattern="#\d*Y.*$">
|
||||
<token type="CommentSpecial"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\.|\\\n|[^"\\])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern=":(\|[^|]+\||(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~])(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~]|[#.:])*)">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="::(\|[^|]+\||(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~])(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~]|[#.:])*)">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern=":#(\|[^|]+\||(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~])(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~]|[#.:])*)">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="'(\|[^|]+\||(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~])(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~]|[#.:])*)">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="`">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[-+]?\d+\.?(?=[ "()\'\n,;`])">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="[-+]?\d+/\d+(?=[ "()\'\n,;`])">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="[-+]?(\d*\.\d+([defls][-+]?\d+)?|\d+(\.\d*)?[defls][-+]?\d+)(?=[ "()\'\n,;`])">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="#\\.(?=[ "()\'\n,;`])">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="#\\(\|[^|]+\||(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~])(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~]|[#.:])*)">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="#\(">
|
||||
<token type="Operator"/>
|
||||
<push state="body"/>
|
||||
</rule>
|
||||
<rule pattern="#\d*\*[01]*">
|
||||
<token type="LiteralOther"/>
|
||||
</rule>
|
||||
<rule pattern="#:(\|[^|]+\||(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~])(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~]|[#.:])*)">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="#[.,]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="#\'">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="#b[+-]?[01]+(/[01]+)?">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="#o[+-]?[0-7]+(/[0-7]+)?">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="#x[+-]?[0-9a-f]+(/[0-9a-f]+)?">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="#\d+r[+-]?[0-9a-z]+(/[0-9a-z]+)?">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="(#c)(\()">
|
||||
<bygroups>
|
||||
<token type="LiteralNumber"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="body"/>
|
||||
</rule>
|
||||
<rule pattern="(#\d+a)(\()">
|
||||
<bygroups>
|
||||
<token type="LiteralOther"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="body"/>
|
||||
</rule>
|
||||
<rule pattern="(#s)(\()">
|
||||
<bygroups>
|
||||
<token type="LiteralOther"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="body"/>
|
||||
</rule>
|
||||
<rule pattern="#p?"(\\.|[^"])*"">
|
||||
<token type="LiteralOther"/>
|
||||
</rule>
|
||||
<rule pattern="#\d+=">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="#\d+#">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="#+nil(?=[ "()\'\n,;`])\s*\(">
|
||||
<token type="CommentPreproc"/>
|
||||
<push state="commented-form"/>
|
||||
</rule>
|
||||
<rule pattern="#[+-]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="(,@|,|\.)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="(t|nil)(?=[ "()\'\n,;`])">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="\*(\|[^|]+\||(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~])(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~]|[#.:])*)\*">
|
||||
<token type="NameVariableGlobal"/>
|
||||
</rule>
|
||||
<rule pattern="(\|[^|]+\||(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~])(?:\\.|[\w!$%&*+-/<=>?@\[\]^{}~]|[#.:])*)">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="Punctuation"/>
|
||||
<push state="body"/>
|
||||
</rule>
|
||||
<rule pattern="\)">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<push state="body"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="multiline-comment">
|
||||
<rule pattern="#\|">
|
||||
<token type="CommentMultiline"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\|#">
|
||||
<token type="CommentMultiline"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[^|#]+">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="[|#]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="commented-form">
|
||||
<rule pattern="\(">
|
||||
<token type="CommentPreproc"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\)">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[^()]+">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
136
lexers/coq.xml
Normal file
136
lexers/coq.xml
Normal file
@ -0,0 +1,136 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Coq</name>
|
||||
<alias>coq</alias>
|
||||
<filename>*.v</filename>
|
||||
<mime_type>text/x-coq</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="string">
|
||||
<rule pattern="[^"]+">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="dotted">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\.">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[A-Z][\w\']*(?=\s*\.)">
|
||||
<token type="NameNamespace"/>
|
||||
</rule>
|
||||
<rule pattern="[A-Z][\w\']*">
|
||||
<token type="NameClass"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[a-z][a-z0-9_\']*">
|
||||
<token type="Name"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="false|true|\(\)|\[\]">
|
||||
<token type="NameBuiltinPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="\(\*">
|
||||
<token type="Comment"/>
|
||||
<push state="comment"/>
|
||||
</rule>
|
||||
<rule pattern="\b(Projections|Monomorphic|Polymorphic|Proposition|CoInductive|Hypothesis|CoFixpoint|Contextual|Definition|Parameters|Hypotheses|Structure|Inductive|Corollary|Implicits|Parameter|Variables|Arguments|Canonical|Printing|Coercion|Reserved|Universe|Notation|Instance|Fixpoint|Variable|Morphism|Relation|Existing|Implicit|Example|Theorem|Delimit|Defined|Rewrite|outside|Require|Resolve|Section|Context|Prenex|Strict|Module|Import|Export|Global|inside|Remark|Tactic|Search|Record|Scope|Unset|Check|Local|Close|Class|Graph|Proof|Lemma|Print|Axiom|Show|Goal|Open|Fact|Hint|Bind|Ltac|Save|View|Let|Set|All|End|Qed)\b">
|
||||
<token type="KeywordNamespace"/>
|
||||
</rule>
|
||||
<rule pattern="\b(exists2|nosimpl|struct|exists|return|forall|match|cofix|then|with|else|for|fix|let|fun|end|is|of|if|in|as)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\b(Type|Prop)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="\b(native_compute|setoid_rewrite|etransitivity|econstructor|transitivity|autorewrite|constructor|cutrewrite|vm_compute|bool_congr|generalize|inversion|induction|injection|nat_congr|intuition|destruct|suffices|erewrite|symmetry|nat_norm|replace|rewrite|compute|pattern|trivial|without|assert|unfold|change|eapply|intros|unlock|revert|rename|refine|eauto|tauto|after|right|congr|split|field|simpl|intro|clear|apply|using|subst|case|left|suff|loss|wlog|have|fold|ring|move|lazy|elim|pose|auto|red|cbv|hnf|cut|set)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\b(contradiction|discriminate|reflexivity|assumption|congruence|romega|omega|exact|solve|tauto|done|by)\b">
|
||||
<token type="KeywordPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="\b(repeat|first|idtac|last|try|do)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="\b([A-Z][\w\']*)">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="(λ|Π|\|\}|\{\||\\/|/\\|=>|~|\}|\|]|\||\{<|\{|`|_|]|\[\||\[>|\[<|\[|\?\?|\?|>\}|>]|>|=|<->|<-|<|;;|;|:>|:=|::|:|\.\.|\.|->|-\.|-|,|\+|\*|\)|\(|&&|&|#|!=)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="([=<>@^|&+\*/$%-]|[!?~])?[!$%&*+\./:<=>?@^|~-]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\b(unit|nat|bool|string|ascii|list)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="[^\W\d][\w']*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="\d[\d_]*">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="0[xX][\da-fA-F][\da-fA-F_]*">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="0[oO][0-7][0-7_]*">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="0[bB][01][01_]*">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="'.'">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="[~?][a-z][\w\']*:">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="comment">
|
||||
<rule pattern="[^(*)]+">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="\(\*">
|
||||
<token type="Comment"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\*\)">
|
||||
<token type="Comment"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[(*)]">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
762
lexers/crystal.xml
Normal file
762
lexers/crystal.xml
Normal file
@ -0,0 +1,762 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Crystal</name>
|
||||
<alias>cr</alias>
|
||||
<alias>crystal</alias>
|
||||
<filename>*.cr</filename>
|
||||
<mime_type>text/x-crystal</mime_type>
|
||||
<dot_all>true</dot_all>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="pa-intp-string">
|
||||
<rule pattern="\\[\(]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\)">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string-intp-escaped"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#()]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\#()]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="ab-regex">
|
||||
<rule pattern="\\[\\<>]">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="<">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern=">[imsx]*">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string-intp"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#<>]">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\#<>]+">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="cb-regex">
|
||||
<rule pattern="\\[\\{}]">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="\{">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\}[imsx]*">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string-intp"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#{}]">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\#{}]+">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="simple-backtick">
|
||||
<rule>
|
||||
<include state="string-intp-escaped"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\`#]+">
|
||||
<token type="LiteralStringBacktick"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#]">
|
||||
<token type="LiteralStringBacktick"/>
|
||||
</rule>
|
||||
<rule pattern="`">
|
||||
<token type="LiteralStringBacktick"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string-intp">
|
||||
<rule pattern="#\{">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push state="in-intp"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="interpolated-regex">
|
||||
<rule>
|
||||
<include state="string-intp"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#]">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\#]+">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="cb-string">
|
||||
<rule pattern="\\[\\{}]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\{">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\}">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#{}]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\#{}]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="in-macro-control">
|
||||
<rule pattern="\{%">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="%\}">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="for\b|in\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="interpolated-string">
|
||||
<rule>
|
||||
<include state="string-intp"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\#]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="in-macro-expr">
|
||||
<rule pattern="\{\{">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\}\}">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="simple-string">
|
||||
<rule>
|
||||
<include state="string-intp-escaped"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\"#]+">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#]">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="cb-intp-string">
|
||||
<rule pattern="\\[\{]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\{">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\}">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string-intp-escaped"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#{}]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\#{}]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string-intp-escaped">
|
||||
<rule>
|
||||
<include state="string-intp"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string-escaped"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="sb-regex">
|
||||
<rule pattern="\\[\\\[\]]">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="\[">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\][imsx]*">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string-intp"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#\[\]]">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\#\[\]]+">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="classname">
|
||||
<rule pattern="[A-Z_]\w*">
|
||||
<token type="NameClass"/>
|
||||
</rule>
|
||||
<rule pattern="(\()(\s*)([A-Z_]\w*)(\s*)(\))">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string-escaped">
|
||||
<rule pattern="\\([\\befnstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="sb-intp-string">
|
||||
<rule pattern="\\[\[]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\[">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\]">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string-intp-escaped"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#\[\]]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\#\[\]]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="pa-regex">
|
||||
<rule pattern="\\[\\()]">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\)[imsx]*">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string-intp"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#()]">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\#()]+">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="in-attr">
|
||||
<rule pattern="\[">
|
||||
<token type="Operator"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\]">
|
||||
<token type="Operator"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="ab-intp-string">
|
||||
<rule pattern="\\[<]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="<">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern=">">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string-intp-escaped"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#<>]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\#<>]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="in-intp">
|
||||
<rule pattern="\{">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\}">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="end-part">
|
||||
<rule pattern=".+">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="#.*?$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="(instance_sizeof|pointerof|protected|abstract|require|private|include|unless|typeof|sizeof|return|extend|ensure|rescue|ifdef|super|break|begin|until|while|elsif|yield|next|when|else|then|case|with|end|asm|if|do|as|of)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(false|true|nil)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(module|lib)(\s+)([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameNamespace"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(def|fun|macro)(\s+)((?:[a-zA-Z_]\w*::)*)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameNamespace"/>
|
||||
</bygroups>
|
||||
<push state="funcname"/>
|
||||
</rule>
|
||||
<rule pattern="def(?=[*%&^`~+-/\[<>=])">
|
||||
<token type="Keyword"/>
|
||||
<push state="funcname"/>
|
||||
</rule>
|
||||
<rule pattern="(class|struct|union|type|alias|enum)(\s+)((?:[a-zA-Z_]\w*::)*)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameNamespace"/>
|
||||
</bygroups>
|
||||
<push state="classname"/>
|
||||
</rule>
|
||||
<rule pattern="(self|out|uninitialized)\b|(is_a|responds_to)\?">
|
||||
<token type="KeywordPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="(def_equals_and_hash|assert_responds_to|forward_missing_to|def_equals|property|def_hash|parallel|delegate|debugger|getter|record|setter|spawn|pp)\b">
|
||||
<token type="NameBuiltinPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="getter[!?]|property[!?]|__(DIR|FILE|LINE)__\b">
|
||||
<token type="NameBuiltinPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="(?<!\.)(get_stack_top|StaticArray|Concurrent|with_color|Reference|Scheduler|read_line|Exception|at_exit|Pointer|Channel|Float64|sprintf|Float32|Process|Object|Struct|caller|UInt16|UInt32|UInt64|system|future|Number|printf|String|Symbol|Int32|Range|Slice|Regex|Mutex|sleep|Array|Class|raise|Tuple|Deque|delay|Float|Int16|print|abort|Value|UInt8|Int64|puts|Proc|File|Void|exit|fork|Bool|Char|gets|lazy|loop|main|rand|Enum|Int8|Time|Hash|Set|Box|Nil|Dir|Int|p)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(?<!\w)(<<-?)(["`\']?)([a-zA-Z_]\w*)(\2)(.*?\n)">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
</rule>
|
||||
<rule pattern="(<<-?)("|\')()(\2)(.*?\n)">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
</rule>
|
||||
<rule pattern="__END__">
|
||||
<token type="CommentPreproc"/>
|
||||
<push state="end-part"/>
|
||||
</rule>
|
||||
<rule pattern="(?:^|(?<=[=<>~!:])|(?<=(?:\s|;)when\s)|(?<=(?:\s|;)or\s)|(?<=(?:\s|;)and\s)|(?<=\.index\s)|(?<=\.scan\s)|(?<=\.sub\s)|(?<=\.sub!\s)|(?<=\.gsub\s)|(?<=\.gsub!\s)|(?<=\.match\s)|(?<=(?:\s|;)if\s)|(?<=(?:\s|;)elsif\s)|(?<=^when\s)|(?<=^index\s)|(?<=^scan\s)|(?<=^sub\s)|(?<=^gsub\s)|(?<=^sub!\s)|(?<=^gsub!\s)|(?<=^match\s)|(?<=^if\s)|(?<=^elsif\s))(\s*)(/)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralStringRegex"/>
|
||||
</bygroups>
|
||||
<push state="multiline-regex"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=\(|,|\[)/">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<push state="multiline-regex"/>
|
||||
</rule>
|
||||
<rule pattern="(\s+)(/)(?![\s=])">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralStringRegex"/>
|
||||
</bygroups>
|
||||
<push state="multiline-regex"/>
|
||||
</rule>
|
||||
<rule pattern="(0o[0-7]+(?:_[0-7]+)*(?:_?[iu][0-9]+)?)\b(\s*)([/?])?">
|
||||
<bygroups>
|
||||
<token type="LiteralNumberOct"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*(?:_?[iu][0-9]+)?)\b(\s*)([/?])?">
|
||||
<bygroups>
|
||||
<token type="LiteralNumberHex"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(0b[01]+(?:_[01]+)*(?:_?[iu][0-9]+)?)\b(\s*)([/?])?">
|
||||
<bygroups>
|
||||
<token type="LiteralNumberBin"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="((?:0(?![0-9])|[1-9][\d_]*)(?:\.\d[\d_]*)(?:e[+-]?[0-9]+)?(?:_?f[0-9]+)?)(\s*)([/?])?">
|
||||
<bygroups>
|
||||
<token type="LiteralNumberFloat"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="((?:0(?![0-9])|[1-9][\d_]*)(?:\.\d[\d_]*)?(?:e[+-]?[0-9]+)(?:_?f[0-9]+)?)(\s*)([/?])?">
|
||||
<bygroups>
|
||||
<token type="LiteralNumberFloat"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="((?:0(?![0-9])|[1-9][\d_]*)(?:\.\d[\d_]*)?(?:e[+-]?[0-9]+)?(?:_?f[0-9]+))(\s*)([/?])?">
|
||||
<bygroups>
|
||||
<token type="LiteralNumberFloat"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(0\b|[1-9][\d]*(?:_\d+)*(?:_?[iu][0-9]+)?)\b(\s*)([/?])?">
|
||||
<bygroups>
|
||||
<token type="LiteralNumberInteger"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="@@[a-zA-Z_]\w*">
|
||||
<token type="NameVariableClass"/>
|
||||
</rule>
|
||||
<rule pattern="@[a-zA-Z_]\w*">
|
||||
<token type="NameVariableInstance"/>
|
||||
</rule>
|
||||
<rule pattern="\$\w+">
|
||||
<token type="NameVariableGlobal"/>
|
||||
</rule>
|
||||
<rule pattern="\$[!@&`\'+~=/\\,;.<>_*$?:"^-]">
|
||||
<token type="NameVariableGlobal"/>
|
||||
</rule>
|
||||
<rule pattern="\$-[0adFiIlpvw]">
|
||||
<token type="NameVariableGlobal"/>
|
||||
</rule>
|
||||
<rule pattern="::">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="strings"/>
|
||||
</rule>
|
||||
<rule pattern="\?(\\[MC]-)*(\\([\\befnrtv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})|\S)(?!\w)">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="[A-Z][A-Z_]+\b">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="\{%">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push state="in-macro-control"/>
|
||||
</rule>
|
||||
<rule pattern="\{\{">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push state="in-macro-expr"/>
|
||||
</rule>
|
||||
<rule pattern="(@\[)(\s*)([A-Z]\w*)">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameDecorator"/>
|
||||
</bygroups>
|
||||
<push state="in-attr"/>
|
||||
</rule>
|
||||
<rule pattern="(\.|::)(\[\]\?|<=>|===|\[\]=|>>|&&|\*\*|\[\]|\|\||>=|=~|!~|<<|<=|!=|==|<|/|=|-|\+|>|\*|&|%|\^|!|\||~)">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="NameOperator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\.|::)([a-zA-Z_]\w*[!?]?|[*%&^`~+\-/\[<>=])">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="Name"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_]\w*(?:[!?](?!=))?">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="(\[|\]\??|\*\*|<=>?|>=|<<?|>>?|=~|===|!~|&&?|\|\||\.{1,3})">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[-+/*%=<>&!^|~]=?">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[(){};,/?:\\]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="multiline-regex">
|
||||
<rule>
|
||||
<include state="string-intp"/>
|
||||
</rule>
|
||||
<rule pattern="\\\\">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="\\/">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#]">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\/#]+">
|
||||
<token type="LiteralStringRegex"/>
|
||||
</rule>
|
||||
<rule pattern="/[imsx]*">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="ab-string">
|
||||
<rule pattern="\\[\\<>]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="<">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern=">">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#<>]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\#<>]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="pa-string">
|
||||
<rule pattern="\\[\\()]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\)">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#()]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\#()]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="strings">
|
||||
<rule pattern="\:@{0,2}[a-zA-Z_]\w*[!?]?">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="\:@{0,2}(\[\]\?|<=>|===|\[\]=|>>|&&|\*\*|\[\]|\|\||>=|=~|!~|<<|<=|!=|==|<|/|=|-|\+|>|\*|&|%|\^|!|\||~)">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern=":'(\\\\|\\'|[^'])*'">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="'(\\\\|\\'|[^']|\\[^'\\]+)'">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern=":"">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
<push state="simple-sym"/>
|
||||
</rule>
|
||||
<rule pattern="([a-zA-Z_]\w*)(:)(?!:)">
|
||||
<bygroups>
|
||||
<token type="LiteralStringSymbol"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<push state="simple-string"/>
|
||||
</rule>
|
||||
<rule pattern="(?<!\.)`">
|
||||
<token type="LiteralStringBacktick"/>
|
||||
<push state="simple-backtick"/>
|
||||
</rule>
|
||||
<rule pattern="%\{">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="cb-intp-string"/>
|
||||
</rule>
|
||||
<rule pattern="%[wi]\{">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="cb-string"/>
|
||||
</rule>
|
||||
<rule pattern="%r\{">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<push state="cb-regex"/>
|
||||
</rule>
|
||||
<rule pattern="%\[">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="sb-intp-string"/>
|
||||
</rule>
|
||||
<rule pattern="%[wi]\[">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="sb-string"/>
|
||||
</rule>
|
||||
<rule pattern="%r\[">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<push state="sb-regex"/>
|
||||
</rule>
|
||||
<rule pattern="%\(">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="pa-intp-string"/>
|
||||
</rule>
|
||||
<rule pattern="%[wi]\(">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="pa-string"/>
|
||||
</rule>
|
||||
<rule pattern="%r\(">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<push state="pa-regex"/>
|
||||
</rule>
|
||||
<rule pattern="%<">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="ab-intp-string"/>
|
||||
</rule>
|
||||
<rule pattern="%[wi]<">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="ab-string"/>
|
||||
</rule>
|
||||
<rule pattern="%r<">
|
||||
<token type="LiteralStringRegex"/>
|
||||
<push state="ab-regex"/>
|
||||
</rule>
|
||||
<rule pattern="(%r([\W_]))((?:\\\2|(?!\2).)*)(\2[imsx]*)">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="(%[wi]([\W_]))((?:\\\2|(?!\2).)*)(\2)">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=[-+/*%=<>&!^|~,(])(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralStringOther"/>
|
||||
<token type="None"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="^(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralStringOther"/>
|
||||
<token type="None"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(%([\[{(<]))((?:\\\2|(?!\2).)*)(\2)">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="sb-string">
|
||||
<rule pattern="\\[\\\[\]]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\[">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\]">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#\[\]]">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\#\[\]]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="funcname">
|
||||
<rule pattern="(?:([a-zA-Z_]\w*)(\.))?([a-zA-Z_]\w*[!?]?|\*\*?|[-+]@?|[/%&|^`~]|\[\]=?|<<|>>|<=?>|>=?|===?)">
|
||||
<bygroups>
|
||||
<token type="NameClass"/>
|
||||
<token type="Operator"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="simple-sym">
|
||||
<rule>
|
||||
<include state="string-escaped"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\"#]+">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="[\\#]">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
323
lexers/css.xml
Normal file
323
lexers/css.xml
Normal file
File diff suppressed because one or more lines are too long
85
lexers/cue.xml
Normal file
85
lexers/cue.xml
Normal file
@ -0,0 +1,85 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>CUE</name>
|
||||
<alias>cue</alias>
|
||||
<filename>*.cue</filename>
|
||||
<mime_type>text/x-cue</mime_type>
|
||||
<dot_all>true</dot_all>
|
||||
<ensure_nl>true</ensure_nl>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="[^\S\n]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="//[^\n\r]+">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="(\+|&&|==|<|=|-|\|\||!=|>|:|\*|&|=~|<=|\?|\[|\]|,|/|\||!~|>=|!|_\|_|\.\.\.)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="#*"+">
|
||||
<token type="LiteralString"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="'(\\\\|\\'|[^'\n])*['\n]">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="0[boxX][0-9a-fA-F][_0-9a-fA-F]*|(\.\d+|\d[_\d]*(\.\d*)?)([eE][+-]?\d+)?[KMGTP]?i?">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="[~!%^&*()+=|\[\]:;,.<>/?-]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[{}]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(import|for|if|in|let|package)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(bool|float|int|string|uint|ulong|ushort)\b\??">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(true|false|null|_)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="[@#]?[_a-zA-Z$]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern="\\#*\(">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push state="string-intp"/>
|
||||
</rule>
|
||||
<rule pattern=""+#*">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\['"\\nrt]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\"]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string-intp">
|
||||
<rule pattern="\)">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
372
lexers/cython.xml
Normal file
372
lexers/cython.xml
Normal file
@ -0,0 +1,372 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Cython</name>
|
||||
<alias>cython</alias>
|
||||
<alias>pyx</alias>
|
||||
<alias>pyrex</alias>
|
||||
<filename>*.pyx</filename>
|
||||
<filename>*.pxd</filename>
|
||||
<filename>*.pxi</filename>
|
||||
<mime_type>text/x-cython</mime_type>
|
||||
<mime_type>application/x-cython</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="funcname">
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="NameFunction"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="^(\s*)("""(?:.|\n)*?""")">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralStringDoc"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="^(\s*)('''(?:.|\n)*?''')">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralStringDoc"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[^\S\n]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="#.*$">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="[]{}:(),;[]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="(in|is|and|or|not)\b">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
<rule pattern="(<)([a-zA-Z0-9.?]+)(>)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="KeywordType"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="!=|==|<<|>>|[-~+/*%=<>&^|.?]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="(from)(\d+)(<=)(\s+)(<)(\d+)(:)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="LiteralNumberInteger"/>
|
||||
<token type="Operator"/>
|
||||
<token type="Name"/>
|
||||
<token type="Operator"/>
|
||||
<token type="Name"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="keywords"/>
|
||||
</rule>
|
||||
<rule pattern="(def|property)(\s+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="funcname"/>
|
||||
</rule>
|
||||
<rule pattern="(cp?def)(\s+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="cdef"/>
|
||||
</rule>
|
||||
<rule pattern="(cdef)(:)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(class|struct)(\s+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="classname"/>
|
||||
</rule>
|
||||
<rule pattern="(from)(\s+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="fromimport"/>
|
||||
</rule>
|
||||
<rule pattern="(c?import)(\s+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="import"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="builtins"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="backtick"/>
|
||||
</rule>
|
||||
<rule pattern="(?:[rR]|[uU][rR]|[rR][uU])"""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="tdqs"/>
|
||||
</rule>
|
||||
<rule pattern="(?:[rR]|[uU][rR]|[rR][uU])'''">
|
||||
<token type="LiteralString"/>
|
||||
<push state="tsqs"/>
|
||||
</rule>
|
||||
<rule pattern="(?:[rR]|[uU][rR]|[rR][uU])"">
|
||||
<token type="LiteralString"/>
|
||||
<push state="dqs"/>
|
||||
</rule>
|
||||
<rule pattern="(?:[rR]|[uU][rR]|[rR][uU])'">
|
||||
<token type="LiteralString"/>
|
||||
<push state="sqs"/>
|
||||
</rule>
|
||||
<rule pattern="[uU]?"""">
|
||||
<token type="LiteralString"/>
|
||||
<combined state="stringescape" state="tdqs"/>
|
||||
</rule>
|
||||
<rule pattern="[uU]?'''">
|
||||
<token type="LiteralString"/>
|
||||
<combined state="stringescape" state="tsqs"/>
|
||||
</rule>
|
||||
<rule pattern="[uU]?"">
|
||||
<token type="LiteralString"/>
|
||||
<combined state="stringescape" state="dqs"/>
|
||||
</rule>
|
||||
<rule pattern="[uU]?'">
|
||||
<token type="LiteralString"/>
|
||||
<combined state="stringescape" state="sqs"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="name"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="numbers"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="stringescape">
|
||||
<rule pattern="\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="strings">
|
||||
<rule pattern="%(\([a-zA-Z0-9]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[E-GXc-giorsux%]">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\\'"%\n]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="[\'"\\]">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="%">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="backtick">
|
||||
<rule pattern="`.*?`">
|
||||
<token type="LiteralStringBacktick"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="numbers">
|
||||
<rule pattern="(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0\d+">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="0[xX][a-fA-F0-9]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="\d+L">
|
||||
<token type="LiteralNumberIntegerLong"/>
|
||||
</rule>
|
||||
<rule pattern="\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="keywords">
|
||||
<rule pattern="(continue|ctypedef|except\?|include|finally|global|return|lambda|assert|except|print|nogil|while|fused|yield|break|raise|exec|else|elif|pass|with|gil|for|try|del|by|as|if)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(DEF|IF|ELIF|ELSE)\b">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="fromimport">
|
||||
<rule pattern="(\s+)(c?import)\b">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_.][\w.]*">
|
||||
<token type="NameNamespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="nl">
|
||||
<rule pattern="\n">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="dqs">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\\\|\\"|\\\n">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="strings"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="tsqs">
|
||||
<rule pattern="'''">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="strings"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="nl"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="import">
|
||||
<rule pattern="(\s+)(as)(\s+)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_][\w.]*">
|
||||
<token type="NameNamespace"/>
|
||||
</rule>
|
||||
<rule pattern="(\s*)(,)(\s*)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="name">
|
||||
<rule pattern="@\w+">
|
||||
<token type="NameDecorator"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="cdef">
|
||||
<rule pattern="(public|readonly|extern|api|inline)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="(struct|enum|union|class)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="([a-zA-Z_]\w*)(\s*)(?=[(:#=]|$)">
|
||||
<bygroups>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="([a-zA-Z_]\w*)(\s*)(,)">
|
||||
<bygroups>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="from\b">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="as\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern=":">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(?=["\'])">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern=".">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="classname">
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="NameClass"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="sqs">
|
||||
<rule pattern="'">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\\\|\\'|\\\n">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="strings"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="tdqs">
|
||||
<rule pattern=""""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="strings"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="nl"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="builtins">
|
||||
<rule pattern="(?<!\.)(staticmethod|classmethod|__import__|issubclass|isinstance|basestring|bytearray|raw_input|frozenset|enumerate|property|unsigned|reversed|callable|execfile|hasattr|compile|complex|delattr|setattr|unicode|globals|getattr|reload|divmod|xrange|unichr|filter|reduce|buffer|intern|coerce|sorted|locals|object|round|input|range|super|tuple|bytes|float|slice|apply|bool|long|exit|vars|file|next|type|iter|open|dict|repr|hash|list|eval|oct|map|zip|int|hex|set|sum|chr|cmp|any|str|pow|ord|dir|len|min|all|abs|max|bin|id)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(?<!\.)(self|None|Ellipsis|NotImplemented|False|True|NULL)\b">
|
||||
<token type="NameBuiltinPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="(?<!\.)(PendingDeprecationWarning|UnicodeTranslateError|NotImplementedError|FloatingPointError|DeprecationWarning|UnicodeDecodeError|UnicodeEncodeError|UnboundLocalError|KeyboardInterrupt|ZeroDivisionError|IndentationError|EnvironmentError|OverflowWarning|ArithmeticError|RuntimeWarning|UnicodeWarning|AttributeError|AssertionError|NotImplemented|ReferenceError|StopIteration|SyntaxWarning|OverflowError|GeneratorExit|FutureWarning|BaseException|ImportWarning|StandardError|RuntimeError|UnicodeError|LookupError|ImportError|SyntaxError|MemoryError|SystemError|UserWarning|SystemExit|ValueError|IndexError|NameError|TypeError|Exception|KeyError|EOFError|TabError|OSError|Warning|IOError)\b">
|
||||
<token type="NameException"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
133
lexers/d.xml
Normal file
133
lexers/d.xml
Normal file
@ -0,0 +1,133 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>D</name>
|
||||
<alias>d</alias>
|
||||
<filename>*.d</filename>
|
||||
<filename>*.di</filename>
|
||||
<mime_type>text/x-d</mime_type>
|
||||
<ensure_nl>true</ensure_nl>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="[^\S\n]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/\*.*?\*/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="/\+.*?\+/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="(asm|assert|body|break|case|cast|catch|continue|default|debug|delete|do|else|finally|for|foreach|foreach_reverse|goto|if|in|invariant|is|macro|mixin|new|out|pragma|return|super|switch|this|throw|try|typeid|typeof|version|while|with)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="__(FILE|FILE_FULL_PATH|MODULE|LINE|FUNCTION|PRETTY_FUNCTION|DATE|EOF|TIME|TIMESTAMP|VENDOR|VERSION)__\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="__(traits|vector|parameters)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)((?:[^\W\d]|\$)[\w$]*)(\s*)(\()">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="@[\w.]*">
|
||||
<token type="NameDecorator"/>
|
||||
</rule>
|
||||
<rule pattern="(abstract|auto|alias|align|const|delegate|deprecated|enum|export|extern|final|function|immutable|inout|lazy|nothrow|override|package|private|protected|public|pure|ref|scope|shared|static|synchronized|template|unittest|__gshared)\b">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="(void|bool|byte|ubyte|short|ushort|int|uint|long|ulong|cent|ucent|float|double|real|ifloat|idouble|ireal|cfloat|cdouble|creal|char|wchar|dchar)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(size_t|ptrdiff_t|noreturn|string|wstring|dstring|Object|Throwable|Exception|Error|imported)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(module)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="import"/>
|
||||
</rule>
|
||||
<rule pattern="(true|false|null)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(class|interface|struct|template|union)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordDeclaration"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="class"/>
|
||||
</rule>
|
||||
<rule pattern="(import)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="import"/>
|
||||
</rule>
|
||||
<rule pattern="[qr]?"(\\\\|\\"|[^"])*"[cwd]?">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="(`)([^`]*)(`)[cwd]?">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="(\.)((?:[^\W\d]|\$)[\w$]*)">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="NameAttribute"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="^\s*([^\W\d]|\$)[\w$]*:">
|
||||
<token type="NameLabel"/>
|
||||
</rule>
|
||||
<rule pattern="([0-9][0-9_]*\.([0-9][0-9_]*)?|\.[0-9][0-9_]*)([eE][+\-]?[0-9][0-9_]*)?[fFL]?i?|[0-9][eE][+\-]?[0-9][0-9_]*[fFL]?|[0-9]([eE][+\-]?[0-9][0-9_]*)?[fFL]|0[xX]([0-9a-fA-F][0-9a-fA-F_]*\.?|([0-9a-fA-F][0-9a-fA-F_]*)?\.[0-9a-fA-F][0-9a-fA-F_]*)[pP][+\-]?[0-9][0-9_]*[fFL]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="0[bB][01][01_]*[lL]?">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="0[0-7_]+[lL]?">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="0|[1-9][0-9_]*[lL]?">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="([~^*!%&\[\](){}<>|+=:;,./?-]|q{)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="([^\W\d]|\$)[\w$]*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="class">
|
||||
<rule pattern="([^\W\d]|\$)[\w$]*">
|
||||
<token type="NameClass"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="import">
|
||||
<rule pattern="[\w.]+\*?">
|
||||
<token type="NameNamespace"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
213
lexers/dart.xml
Normal file
213
lexers/dart.xml
Normal file
@ -0,0 +1,213 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Dart</name>
|
||||
<alias>dart</alias>
|
||||
<filename>*.dart</filename>
|
||||
<mime_type>text/x-dart</mime_type>
|
||||
<dot_all>true</dot_all>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="string_double_multiline">
|
||||
<rule pattern=""""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[^"$\\]+">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string_common"/>
|
||||
</rule>
|
||||
<rule pattern="(\$|\")+">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="class">
|
||||
<rule pattern="[a-zA-Z_$]\w*">
|
||||
<token type="NameClass"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="import_decl">
|
||||
<rule>
|
||||
<include state="string_literal"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\b(as|show|hide)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_$]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="\,">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\;">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string_single_multiline">
|
||||
<rule pattern="'''">
|
||||
<token type="LiteralStringSingle"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[^\'$\\]+">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string_common"/>
|
||||
</rule>
|
||||
<rule pattern="(\$|\')+">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="string_literal"/>
|
||||
</rule>
|
||||
<rule pattern="#!(.*?)$">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="\b(import|export)\b">
|
||||
<token type="Keyword"/>
|
||||
<push state="import_decl"/>
|
||||
</rule>
|
||||
<rule pattern="\b(library|source|part of|part)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="[^\S\n]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/\*.*?\*/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="\b(class)\b(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordDeclaration"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="class"/>
|
||||
</rule>
|
||||
<rule pattern="\b(assert|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|this|throw|try|while)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\b(abstract|async|await|const|extends|factory|final|get|implements|native|operator|required|set|static|sync|typedef|var|with|yield)\b">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="\b(bool|double|dynamic|int|num|Object|String|void)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="\b(false|null|true)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="[~!%^&*+=|?:<>/-]|as\b">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_$]\w*:">
|
||||
<token type="NameLabel"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_$]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="[(){}\[\],.;]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="0[xX][0-9a-fA-F]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="\d+(\.\d*)?([eE][+-]?\d+)?">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\.\d+([eE][+-]?\d+)?">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string_literal">
|
||||
<rule pattern="r"""([\w\W]*?)"""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="r'''([\w\W]*?)'''">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="r"(.*?)"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="r'(.*?)'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern=""""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<push state="string_double_multiline"/>
|
||||
</rule>
|
||||
<rule pattern="'''">
|
||||
<token type="LiteralStringSingle"/>
|
||||
<push state="string_single_multiline"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<push state="string_double"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
<push state="string_single"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string_common">
|
||||
<rule pattern="\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\{[0-9A-Fa-f]*\}|[a-z'\"$\\])">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="(\$)([a-zA-Z_]\w*)">
|
||||
<bygroups>
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<token type="Name"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\$\{)(.*?)(\})">
|
||||
<bygroups>
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<usingself state="root"/>
|
||||
<token type="LiteralStringInterpol"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string_double">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[^"$\\\n]+">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string_common"/>
|
||||
</rule>
|
||||
<rule pattern="\$+">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string_single">
|
||||
<rule pattern="'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[^'$\\\n]+">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string_common"/>
|
||||
</rule>
|
||||
<rule pattern="\$+">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
39
lexers/dax.xml
Normal file
39
lexers/dax.xml
Normal file
@ -0,0 +1,39 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Dax</name>
|
||||
<alias>dax</alias>
|
||||
<filename>*.dax</filename>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="\s+"><token type="TextWhitespace"/></rule>
|
||||
<rule pattern="--.*\n?"><token type="CommentSingle"/></rule>
|
||||
<rule pattern="//.*\n?"><token type="CommentSingle"/></rule>
|
||||
<rule pattern="/\*"><token type="CommentMultiline"/><push state="multiline-comments"/></rule>
|
||||
<rule pattern="(CONTAINS|CONTAINSROW|CUSTOMDATA|ISAFTER|ISBLANK|ISERROR|ISEVEN|ISINSCOPE|ISLOGICAL|ISNONTEXT|ISNUMBER|ISODD|ISONORAFTER|ISSELECTEDMEASURE|ISSUBTOTAL|ISTEXT|LOOKUPVALUE|NONVISUAL|SELECTEDMEASURE|SELECTEDMEASURENAME|USERNAME|USEROBJECTID|USERPRINCIPALNAME|TOJSON|TOCSV|EVALUATEANDLOG|USERCULTURE|WINDOW|PARTITIONBY|ORDERBY|OFFSET|INDEX|ROWNUMBER|MATCHBY|ACCRINT|ACCRINTM|AMORDEGRC|AMORLINC|COUPDAYBS|COUPDAYS|COUPDAYSNC|COUPNCD|COUPNUM|COUPPCD|CUMIPMT|CUMPRINC|DB|DDB|DISC|DOLLARDE|DOLLARFR|DURATION|EFFECT|FV|INTRATE|IPMT|ISPMT|MDURATION|NOMINAL|NPER|ODDFPRICE|ODDFYIELD|ODDLPRICE|ODDLYIELD|PDURATION|PMT|PPMT|PRICE|PRICEDISC|PRICEMAT|PV|RATE|RECEIVED|RRI|SLN|SYD|TBILLEQ|TBILLPRICE|TBILLYIELD|VDB|YIELD|YIELDDISC|YIELDMAT|ALL|ALLCROSSFILTERED|ALLEXCEPT|ALLNOBLANKROW|ALLSELECTED|CALCULATE|CALCULATETABLE|CROSSFILTER|EARLIER|EARLIEST|FILTER|FILTERS|HASONEFILTER|HASONEVALUE|ISCROSSFILTERED|ISFILTERED|KEEPFILTERS|RELATED|RELATEDTABLE|REMOVEFILTERS|SELECTEDVALUE|SUBSTITUTEWITHINDEX|USERELATIONSHIP|VALUES|CLOSINGBALANCEMONTH|CLOSINGBALANCEQUARTER|CLOSINGBALANCEYEAR|DATEADD|DATESBETWEEN|DATESINPERIOD|DATESMTD|DATESQTD|DATESYTD|ENDOFMONTH|ENDOFQUARTER|ENDOFYEAR|FIRSTDATE|FIRSTNONBLANK|FIRSTNONBLANKVALUE|LASTDATE|LASTNONBLANK|LASTNONBLANKVALUE|NEXTDAY|NEXTMONTH|NEXTQUARTER|NEXTYEAR|OPENINGBALANCEMONTH|OPENINGBALANCEQUARTER|OPENINGBALANCEYEAR|PARALLELPERIOD|PREVIOUSDAY|PREVIOUSMONTH|PREVIOUSQUARTER|PREVIOUSYEAR|SAMEPERIODLASTYEAR|STARTOFMONTH|STARTOFQUARTER|STARTOFYEAR|TOTALMTD|TOTALQTD|TOTALYTD|RETURN|ABS|ACOS|ACOSH|ACOT|ACOTH|ASIN|ASINH|ATAN|ATANH|CEILING|COMBIN|COMBINA|COS|COSH|COT|COTH|CURRENCY|DEGREES|DIVIDE|EVEN|EXP|FACT|FLOOR|GCD|INT|ISO.CEILING|LCM|LN|LOG|LOG10|MOD|MROUND|ODD|PI|POWER|PRODUCT|PRODUCTX|QUOTIENT|RADIANS|RAND|RANDBETWEEN|ROUND|ROUNDDOWN|ROUNDUP|SIGN|SQRT|SUM|SUMX|TRUNC|BLANK|COMBINEVALUES|CONCATENATE|CONCATENATEX|CONTAINSSTRING|CONTAINSSTRINGEXACT|EXACT|FIND|FIXED|FORMAT|LEFT|LEN|LOWER|MID|REPLACE|REPT|RIGHT|SEARCH|SUBSTITUTE|TRIM|UNICHAR|UNICODE|UPPER|VALUE|LINEST|LINESTX|CONVERT|DATATABLE|ERROR|EXCEPT|GENERATESERIES|GROUPBY|INTERSECT|ISEMPTY|NATURALINNERJOIN|NATURALLEFTOUTERJOIN|SELECTEDMEASUREFORMATSTRING|SUMMARIZECOLUMNS|Table Constructor|TREATAS|UNION|VAR|PATH|PATHCONTAINS|PATHITEM|PATHITEMREVERSE|PATHLENGTH|ADDCOLUMNS|ADDMISSINGITEMS|CURRENTGROUP|DETAILROWS|DISTINCT|ROLLUP|ROLLUPADDISSUBTOTAL|ROLLUPGROUP|ROLLUPISSUBTOTAL|EXTERNALMEASURE|PMT|PPMT|PRICE|PRICEDISC|PRICEMAT|PV|RATE|RECEIVED|RRI|SLN|SYD|TBILLEQ|TBILLPRICE|TBILLYIELD|VDB|YIELD|YIELDDISC|YIELDMAT|CALENDAR|CALENDARAUTO|DATE|DATEDIFF|DATEVALUE|DAY|EDATE|EOMONTH|HOUR|MINUTE|MONTH|NETWORKDAYS|NOW|QUARTER|SECOND|TIME|TIMEVALUE|TODAY|UTCNOW|UTCTODAY|WEEKDAY|WEEKNUM|YEAR|YEARFRAC|APPROXIMATEDISTINCTCOUNT|AVERAGE|AVERAGEA|AVERAGEX|BETA.DIST|BETA.INV|CHISQ.DIST|CHISQ.DIST.RT|CHISQ.INV|CHISQ.INV.RT|CONFIDENCE.NORM|CONFIDENCE.T|COUNT|COUNTA|COUNTAX|COUNTBLANK|COUNTROWS|COUNTX|CROSSJOIN|DISTINCTCOUNT|DISTINCTCOUNTNOBLANK|EXPON.DIST|GENERATE|GENERATEALL|GEOMEAN|GEOMEANX|MAX|MAXA|MAXX|MEDIAN|MEDIANX|MIN|MINA|MINX|NORM.DIST|NORM.INV|NORM.S.DIST|NORM.S.INV|PERCENTILE.EXC|PERCENTILE.INC|PERCENTILEX.EXC|PERCENTILEX.INC|PERMUT|POISSON.DIST|RANK.EQ|RANKX|ROW|SAMPLE|SELECTCOLUMNS|SIN|SINH|SQRTPI|STDEV.P|STDEV.S|STDEVX.P|STDEVX.S|SUMMARIZE|T.DIST|T.DIST.2T|T.DIST.RT|T.INV|T.INV.2T|TAN|TANH|TOPN|VAR|VAR.P|VAR.S|VARX.P|VARX.S|XIRR|XNPV|RANK)\b">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="(AND|BITAND|BITLSHIFT|BITOR|BITRSHIFT|BITXOR|COALESCE|FALSE|IF|IF.EAGER|IFERROR|IN|NOT|OR|SWITCH|TRUE)\b">
|
||||
<token type="NameOperator"/>
|
||||
</rule>
|
||||
<rule pattern="[+*/<>=!^&|,-]"><token type="Operator"/></rule>
|
||||
<rule pattern="""><token type="LiteralString"/><push state="string"/></rule>
|
||||
<rule pattern="'(?:[^']|'')*'(?!')(?:\[[ \w]+\])?|\w+\[[ \w]+\]"><token type="NameAttribute"/></rule>
|
||||
<rule pattern="\[[ \w]+\]"><token type="NameAttribute"/></rule>
|
||||
<rule pattern="(?<!\w)(\d+\.?\d*|\.\d+\b)"><token type="LiteralNumber"/></rule>
|
||||
<rule pattern="[\[\](){}`,.]"><token type="Punctuation"/></rule>
|
||||
<rule pattern=".*\n"><token type="Text"/></rule>
|
||||
</state>
|
||||
<state name="multiline-comments">
|
||||
<rule pattern="/\*"><token type="CommentMultiline"/><push state="multiline-comments"/></rule>
|
||||
<rule pattern="\*/"><token type="CommentMultiline"/><pop depth="1"/></rule>
|
||||
<rule pattern="[^/*]+"><token type="CommentMultiline"/></rule>
|
||||
<rule pattern="[/*]"><token type="CommentMultiline"/></rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern=""""><token type="LiteralStringEscape"/></rule>
|
||||
<rule pattern="""><token type="LiteralString"/><pop depth="1"/></rule>
|
||||
<rule pattern="[^"]+"><token type="LiteralString"/></rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
17
lexers/desktop_entry.xml
Normal file
17
lexers/desktop_entry.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Desktop file</name>
|
||||
<alias>desktop</alias>
|
||||
<alias>desktop_entry</alias>
|
||||
<filename>*.desktop</filename>
|
||||
<mime_type>application/x-desktop</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="^[ \t]*\n"><token type="TextWhitespace"/></rule>
|
||||
<rule pattern="^(#.*)(\n)"><bygroups><token type="CommentSingle"/><token type="TextWhitespace"/></bygroups></rule>
|
||||
<rule pattern="(\[[^\]\n]+\])(\n)"><bygroups><token type="Keyword"/><token type="TextWhitespace"/></bygroups></rule>
|
||||
<rule pattern="([-A-Za-z0-9]+)(\[[^\] \t=]+\])?([ \t]*)(=)([ \t]*)([^\n]*)([ \t\n]*\n)"><bygroups><token type="NameAttribute"/><token type="NameNamespace"/><token type="TextWhitespace"/><token type="Operator"/><token type="TextWhitespace"/><token type="LiteralString"/><token type="TextWhitespace"/></bygroups></rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
52
lexers/diff.xml
Normal file
52
lexers/diff.xml
Normal file
@ -0,0 +1,52 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Diff</name>
|
||||
<alias>diff</alias>
|
||||
<alias>udiff</alias>
|
||||
<filename>*.diff</filename>
|
||||
<filename>*.patch</filename>
|
||||
<mime_type>text/x-diff</mime_type>
|
||||
<mime_type>text/x-patch</mime_type>
|
||||
<ensure_nl>true</ensure_nl>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern=" .*\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\d+(,\d+)?(a|c|d)\d+(,\d+)?\n">
|
||||
<token type="GenericSubheading"/>
|
||||
</rule>
|
||||
<rule pattern="---\n">
|
||||
<token type="GenericStrong"/>
|
||||
</rule>
|
||||
<rule pattern="< .*\n">
|
||||
<token type="GenericDeleted"/>
|
||||
</rule>
|
||||
<rule pattern="> .*\n">
|
||||
<token type="GenericInserted"/>
|
||||
</rule>
|
||||
<rule pattern="\+.*\n">
|
||||
<token type="GenericInserted"/>
|
||||
</rule>
|
||||
<rule pattern="-.*\n">
|
||||
<token type="GenericDeleted"/>
|
||||
</rule>
|
||||
<rule pattern="!.*\n">
|
||||
<token type="GenericStrong"/>
|
||||
</rule>
|
||||
<rule pattern="@.*\n">
|
||||
<token type="GenericSubheading"/>
|
||||
</rule>
|
||||
<rule pattern="([Ii]ndex|diff).*\n">
|
||||
<token type="GenericHeading"/>
|
||||
</rule>
|
||||
<rule pattern="=.*\n">
|
||||
<token type="GenericHeading"/>
|
||||
</rule>
|
||||
<rule pattern=".*\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
153
lexers/django_jinja.xml
Normal file
153
lexers/django_jinja.xml
Normal file
@ -0,0 +1,153 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Django/Jinja</name>
|
||||
<alias>django</alias>
|
||||
<alias>jinja</alias>
|
||||
<mime_type>application/x-django-templating</mime_type>
|
||||
<mime_type>application/x-jinja</mime_type>
|
||||
<dot_all>true</dot_all>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="var">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="(-?)(\}\})">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="CommentPreproc"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="varnames"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="block">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="(-?)(%\})">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="CommentPreproc"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="varnames"/>
|
||||
</rule>
|
||||
<rule pattern=".">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="[^{]+">
|
||||
<token type="Other"/>
|
||||
</rule>
|
||||
<rule pattern="\{\{">
|
||||
<token type="CommentPreproc"/>
|
||||
<push state="var"/>
|
||||
</rule>
|
||||
<rule pattern="\{[*#].*?[*#]\}">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="(\{%)(-?\s*)(comment)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endcomment)(\s*-?)(%\})">
|
||||
<bygroups>
|
||||
<token type="CommentPreproc"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="CommentPreproc"/>
|
||||
<token type="Comment"/>
|
||||
<token type="CommentPreproc"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="CommentPreproc"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\{%)(-?\s*)(raw)(\s*-?)(%\})(.*?)(\{%)(-?\s*)(endraw)(\s*-?)(%\})">
|
||||
<bygroups>
|
||||
<token type="CommentPreproc"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="CommentPreproc"/>
|
||||
<token type="Text"/>
|
||||
<token type="CommentPreproc"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="CommentPreproc"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\{%)(-?\s*)(filter)(\s+)([a-zA-Z_]\w*)">
|
||||
<bygroups>
|
||||
<token type="CommentPreproc"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
<push state="block"/>
|
||||
</rule>
|
||||
<rule pattern="(\{%)(-?\s*)([a-zA-Z_]\w*)">
|
||||
<bygroups>
|
||||
<token type="CommentPreproc"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
<push state="block"/>
|
||||
</rule>
|
||||
<rule pattern="\{">
|
||||
<token type="Other"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="varnames">
|
||||
<rule pattern="(\|)(\s*)([a-zA-Z_]\w*)">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(is)(\s+)(not)?(\s+)?([a-zA-Z_]\w*)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(_|true|false|none|True|False|None)\b">
|
||||
<token type="KeywordPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="(in|as|reversed|recursive|not|and|or|is|if|else|import|with(?:(?:out)?\s*context)?|scoped|ignore\s+missing)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(loop|block|super|forloop)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_][\w-]*">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="\.\w+">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern=":?"(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern=":?'(\\\\|\\'|[^'])*'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="([{}()\[\]+\-*/,:~]|[><=]=?)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
44
lexers/dns.xml
Normal file
44
lexers/dns.xml
Normal file
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0"?>
|
||||
<lexer>
|
||||
<config>
|
||||
<name>dns</name>
|
||||
<alias>zone</alias>
|
||||
<alias>bind</alias>
|
||||
<filename>*.zone</filename>
|
||||
<mime_type>text/dns</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="\b(IN|A|AAAA|AFSDB|APL|CAA|CDNSKEY|CDS|CERT|CNAME|DHCID|DLV|DNAME|DNSKEY|DS|HIP|IPSECKEY|KEY|KX|LOC|MX|NAPTR|NS|NSEC|NSEC3|NSEC3PARAM|PTR|RRSIG|RP|SIG|SOA|SRV|SSHFP|TA|TKEY|TLSA|TSIG|TXT)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern=";.*(\S|$)">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="\b((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3}))|:)))\b">
|
||||
<token type="LiteralNumberIntegerLong"/>
|
||||
</rule>
|
||||
<rule pattern="\b((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\b">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="\b\d+[dhwm]?">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="\b([\w\d.-])+\.($|\s)">
|
||||
<token type="NameProperty"/>
|
||||
</rule>
|
||||
<rule pattern="([\w\d\.-]+\.[a-z-]{2,24}\.?|^(@|[\w\d-]+))">
|
||||
<token type="NameClass"/>
|
||||
</rule>
|
||||
<rule pattern="^\$(TTL|GENERATE|INCLUDE|ORIGIN)">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
<rule pattern="\(|\)">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[\r\n\s\t]+">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
57
lexers/docker.xml
Normal file
57
lexers/docker.xml
Normal file
@ -0,0 +1,57 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Docker</name>
|
||||
<alias>docker</alias>
|
||||
<alias>dockerfile</alias>
|
||||
<filename>Dockerfile</filename>
|
||||
<filename>Dockerfile.*</filename>
|
||||
<filename>*.Dockerfile</filename>
|
||||
<filename>*.docker</filename>
|
||||
<mime_type>text/x-dockerfile-config</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="#.*">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="(ONBUILD)((?:\s*\\?\s*))">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<using lexer="Bash"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(HEALTHCHECK)(((?:\s*\\?\s*)--\w+=\w+(?:\s*\\?\s*))*)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<using lexer="Bash"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(VOLUME|ENTRYPOINT|CMD|SHELL)((?:\s*\\?\s*))(\[.*?\])">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<using lexer="Bash"/>
|
||||
<using lexer="JSON"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(LABEL|ENV|ARG)((?:(?:\s*\\?\s*)\w+=\w+(?:\s*\\?\s*))*)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<using lexer="Bash"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="((?:FROM|MAINTAINER|EXPOSE|WORKDIR|USER|STOPSIGNAL)|VOLUME)\b(.*)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="LiteralString"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="((?:RUN|CMD|ENTRYPOINT|ENV|ARG|LABEL|ADD|COPY))">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(.*\\\n)*.+">
|
||||
<using lexer="Bash"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
168
lexers/dtd.xml
Normal file
168
lexers/dtd.xml
Normal file
@ -0,0 +1,168 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>DTD</name>
|
||||
<alias>dtd</alias>
|
||||
<filename>*.dtd</filename>
|
||||
<mime_type>application/xml-dtd</mime_type>
|
||||
<dot_all>true</dot_all>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="common">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="(%|&)[^;]*;">
|
||||
<token type="NameEntity"/>
|
||||
</rule>
|
||||
<rule pattern="<!--">
|
||||
<token type="Comment"/>
|
||||
<push state="comment"/>
|
||||
</rule>
|
||||
<rule pattern="[(|)*,?+]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern=""[^"]*"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="\'[^\']*\'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="comment">
|
||||
<rule pattern="[^-]+">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="-->">
|
||||
<token type="Comment"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="-">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="element">
|
||||
<rule>
|
||||
<include state="common"/>
|
||||
</rule>
|
||||
<rule pattern="EMPTY|ANY|#PCDATA">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="[^>\s|()?+*,]+">
|
||||
<token type="NameTag"/>
|
||||
</rule>
|
||||
<rule pattern=">">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="attlist">
|
||||
<rule>
|
||||
<include state="common"/>
|
||||
</rule>
|
||||
<rule pattern="CDATA|IDREFS|IDREF|ID|NMTOKENS|NMTOKEN|ENTITIES|ENTITY|NOTATION">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="#REQUIRED|#IMPLIED|#FIXED">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="xml:space|xml:lang">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="[^>\s|()?+*,]+">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
<rule pattern=">">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="entity">
|
||||
<rule>
|
||||
<include state="common"/>
|
||||
</rule>
|
||||
<rule pattern="SYSTEM|PUBLIC|NDATA">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="[^>\s|()?+*,]+">
|
||||
<token type="NameEntity"/>
|
||||
</rule>
|
||||
<rule pattern=">">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="notation">
|
||||
<rule>
|
||||
<include state="common"/>
|
||||
</rule>
|
||||
<rule pattern="SYSTEM|PUBLIC">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="[^>\s|()?+*,]+">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
<rule pattern=">">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="common"/>
|
||||
</rule>
|
||||
<rule pattern="(<!ELEMENT)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameTag"/>
|
||||
</bygroups>
|
||||
<push state="element"/>
|
||||
</rule>
|
||||
<rule pattern="(<!ATTLIST)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameTag"/>
|
||||
</bygroups>
|
||||
<push state="attlist"/>
|
||||
</rule>
|
||||
<rule pattern="(<!ENTITY)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameEntity"/>
|
||||
</bygroups>
|
||||
<push state="entity"/>
|
||||
</rule>
|
||||
<rule pattern="(<!NOTATION)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameTag"/>
|
||||
</bygroups>
|
||||
<push state="notation"/>
|
||||
</rule>
|
||||
<rule pattern="(<!\[)([^\[\s]+)(\s*)(\[)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="NameEntity"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(<!DOCTYPE)(\s+)([^>\s]+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameTag"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="PUBLIC|SYSTEM">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="[\[\]>]">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
176
lexers/dylan.xml
Normal file
176
lexers/dylan.xml
Normal file
@ -0,0 +1,176 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Dylan</name>
|
||||
<alias>dylan</alias>
|
||||
<filename>*.dylan</filename>
|
||||
<filename>*.dyl</filename>
|
||||
<filename>*.intr</filename>
|
||||
<mime_type>text/x-dylan</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="string">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\([\\abfnrtv"\']|x[a-f0-9]{2,4}|[0-7]{1,3})">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\"\n]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="([a-z0-9-]+:)([ \t]*)(.*(?:\n[ \t].+)*)">
|
||||
<bygroups>
|
||||
<token type="NameAttribute"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="LiteralString"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule>
|
||||
<push state="code"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="code">
|
||||
<rule pattern="\s+">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/\*">
|
||||
<token type="CommentMultiline"/>
|
||||
<push state="comment"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="'(\\.|\\[0-7]{1,3}|\\x[a-f0-9]{1,2}|[^\\\'\n])'">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="#b[01]+">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="#o[0-7]+">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="[-+]?(\d*\.\d+([ed][-+]?\d+)?|\d+(\.\d*)?e[-+]?\d+)">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="[-+]?\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="#x[0-9a-f]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="(\?\\?)([\w!&*<>|^$%@+~?/=-]+)(:)(token|name|variable|expression|body|case-body|\*)">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="NameVariable"/>
|
||||
<token type="Operator"/>
|
||||
<token type="NameBuiltin"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\?)(:)(token|name|variable|expression|body|case-body|\*)">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="Operator"/>
|
||||
<token type="NameVariable"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\?\\?)([\w!&*<>|^$%@+~?/=-]+)">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="NameVariable"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(=>|::|#\(|#\[|##|\?\?|\?=|\?|[(){}\[\],.;])">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern=":=">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="#[tf]">
|
||||
<token type="Literal"/>
|
||||
</rule>
|
||||
<rule pattern="#"">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
<push state="symbol"/>
|
||||
</rule>
|
||||
<rule pattern="#[a-z0-9-]+">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="#(all-keys|include|key|next|rest)">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="[\w!&*<>|^$%@+~?/=-]+:">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="<[\w!&*<>|^$%@+~?/=-]+>">
|
||||
<token type="NameClass"/>
|
||||
</rule>
|
||||
<rule pattern="\*[\w!&*<>|^$%@+~?/=-]+\*">
|
||||
<token type="NameVariableGlobal"/>
|
||||
</rule>
|
||||
<rule pattern="\$[\w!&*<>|^$%@+~?/=-]+">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(let|method|function)([ \t]+)([\w!&*<>|^$%@+~?/=-]+)">
|
||||
<bygroups>
|
||||
<token type="NameBuiltin"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="NameVariable"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(error|signal|return|break)">
|
||||
<token type="NameException"/>
|
||||
</rule>
|
||||
<rule pattern="(\\?)([\w!&*<>|^$%@+~?/=-]+)">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="Name"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="comment">
|
||||
<rule pattern="[^*/]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="/\*">
|
||||
<token type="CommentMultiline"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\*/">
|
||||
<token type="CommentMultiline"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[*/]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="symbol">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\"]+">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
90
lexers/ebnf.xml
Normal file
90
lexers/ebnf.xml
Normal file
@ -0,0 +1,90 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>EBNF</name>
|
||||
<alias>ebnf</alias>
|
||||
<filename>*.ebnf</filename>
|
||||
<mime_type>text/x-ebnf</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="comment">
|
||||
<rule pattern="[^*)]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="comment_start"/>
|
||||
</rule>
|
||||
<rule pattern="\*\)">
|
||||
<token type="CommentMultiline"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[*)]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="identifier">
|
||||
<rule pattern="([a-zA-Z][\w \-]*)">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="comment_start"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="identifier"/>
|
||||
</rule>
|
||||
<rule pattern="=">
|
||||
<token type="Operator"/>
|
||||
<push state="production"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="production">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="comment_start"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="identifier"/>
|
||||
</rule>
|
||||
<rule pattern=""[^"]*"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="'[^']*'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="(\?[^?]*\?)">
|
||||
<token type="NameEntity"/>
|
||||
</rule>
|
||||
<rule pattern="[\[\]{}(),|]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="-">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern=";">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\.">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="whitespace">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="comment_start">
|
||||
<rule pattern="\(\*">
|
||||
<token type="CommentMultiline"/>
|
||||
<push state="comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
744
lexers/elixir.xml
Normal file
744
lexers/elixir.xml
Normal file
@ -0,0 +1,744 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Elixir</name>
|
||||
<alias>elixir</alias>
|
||||
<alias>ex</alias>
|
||||
<alias>exs</alias>
|
||||
<filename>*.ex</filename>
|
||||
<filename>*.eex</filename>
|
||||
<filename>*.exs</filename>
|
||||
<mime_type>text/x-elixir</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="cb-intp">
|
||||
<rule pattern="[^#\}\\]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="escapes"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\}[a-zA-Z]*">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="triquot-end">
|
||||
<rule pattern="[a-zA-Z]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="apos-no-intp">
|
||||
<rule pattern="[^'\\]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="'[a-zA-Z]*">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="slas-no-intp">
|
||||
<rule pattern="[^/\\]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="/[a-zA-Z]*">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="pipe-no-intp">
|
||||
<rule pattern="[^\|\\]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\|[a-zA-Z]*">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="apos-intp">
|
||||
<rule pattern="[^#'\\]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="escapes"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="'[a-zA-Z]*">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="cb-no-intp">
|
||||
<rule pattern="[^\}\\]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\}[a-zA-Z]*">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="heredoc_double">
|
||||
<rule pattern="^\s*"""">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="heredoc_interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="triapos-end">
|
||||
<rule pattern="[a-zA-Z]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="interpol_string">
|
||||
<rule pattern="\}">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="triquot-intp">
|
||||
<rule pattern="^\s*"""">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="heredoc_interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="interpol">
|
||||
<rule pattern="#\{">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push state="interpol_string"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="pa-no-intp">
|
||||
<rule pattern="[^\)\\]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\)[a-zA-Z]*">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="map_key">
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
<rule pattern=":">
|
||||
<token type="Punctuation"/>
|
||||
<push state="map_val"/>
|
||||
</rule>
|
||||
<rule pattern="=>">
|
||||
<token type="Punctuation"/>
|
||||
<push state="map_val"/>
|
||||
</rule>
|
||||
<rule pattern="\}">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="pa-intp">
|
||||
<rule pattern="[^#\)\\]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="escapes"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\)[a-zA-Z]*">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="tuple">
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
<rule pattern="\}">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="#.*$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="(\?)(\\x\{)([\da-fA-F]+)(\})">
|
||||
<bygroups>
|
||||
<token type="LiteralStringChar"/>
|
||||
<token type="LiteralStringEscape"/>
|
||||
<token type="LiteralNumberHex"/>
|
||||
<token type="LiteralStringEscape"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\?)(\\x[\da-fA-F]{1,2})">
|
||||
<bygroups>
|
||||
<token type="LiteralStringChar"/>
|
||||
<token type="LiteralStringEscape"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\?)(\\[abdefnrstv])">
|
||||
<bygroups>
|
||||
<token type="LiteralStringChar"/>
|
||||
<token type="LiteralStringEscape"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\?\\?.">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern=":::">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="::">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern=":(?:\.\.\.|<<>>|%\{\}|%|\{\})">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern=":(?:(?:\.\.\.|[a-z_]\w*[!?]?)|[A-Z]\w*(?:\.[A-Z]\w*)*|(?:\<\<\<|\>\>\>|\|\|\||\&\&\&|\^\^\^|\~\~\~|\=\=\=|\!\=\=|\~\>\>|\<\~\>|\|\~\>|\<\|\>|\=\=|\!\=|\<\=|\>\=|\&\&|\|\||\<\>|\+\+|\-\-|\|\>|\=\~|\-\>|\<\-|\||\.|\=|\~\>|\<\~|\<|\>|\+|\-|\*|\/|\!|\^|\&))">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern=":"">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
<push state="string_double_atom"/>
|
||||
</rule>
|
||||
<rule pattern=":'">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
<push state="string_single_atom"/>
|
||||
</rule>
|
||||
<rule pattern="((?:\.\.\.|<<>>|%\{\}|%|\{\})|(?:(?:\.\.\.|[a-z_]\w*[!?]?)|[A-Z]\w*(?:\.[A-Z]\w*)*|(?:\<\<\<|\>\>\>|\|\|\||\&\&\&|\^\^\^|\~\~\~|\=\=\=|\!\=\=|\~\>\>|\<\~\>|\|\~\>|\<\|\>|\=\=|\!\=|\<\=|\>\=|\&\&|\|\||\<\>|\+\+|\-\-|\|\>|\=\~|\-\>|\<\-|\||\.|\=|\~\>|\<\~|\<|\>|\+|\-|\*|\/|\!|\^|\&)))(:)(?=\s|\n)">
|
||||
<bygroups>
|
||||
<token type="LiteralStringSymbol"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(fn|do|end|after|else|rescue|catch)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(not|and|or|when|in)\b">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
<rule pattern="(case|cond|for|if|unless|try|receive|raise|quote|unquote|unquote_splicing|throw|super|while)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(def|defp|defmodule|defprotocol|defmacro|defmacrop|defdelegate|defexception|defstruct|defimpl|defcallback)\b">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="(import|require|use|alias)\b">
|
||||
<token type="KeywordNamespace"/>
|
||||
</rule>
|
||||
<rule pattern="(nil|true|false)\b">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(_|__MODULE__|__DIR__|__ENV__|__CALLER__)\b">
|
||||
<token type="NamePseudo"/>
|
||||
</rule>
|
||||
<rule pattern="@(?:\.\.\.|[a-z_]\w*[!?]?)">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
<rule pattern="(?:\.\.\.|[a-z_]\w*[!?]?)">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="(%?)([A-Z]\w*(?:\.[A-Z]\w*)*)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\<\<\<|\>\>\>|\|\|\||\&\&\&|\^\^\^|\~\~\~|\=\=\=|\!\=\=|\~\>\>|\<\~\>|\|\~\>|\<\|\>">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\=\=|\!\=|\<\=|\>\=|\&\&|\|\||\<\>|\+\+|\-\-|\|\>|\=\~|\-\>|\<\-|\||\.|\=|\~\>|\<\~">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\\\\|\<\<|\>\>|\=\>|\(|\)|\:|\;|\,|\[|\]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="&\d">
|
||||
<token type="NameEntity"/>
|
||||
</rule>
|
||||
<rule pattern="\<|\>|\+|\-|\*|\/|\!|\^|\&">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="0b[01](_?[01])*">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="0o[0-7](_?[0-7])*">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="0x[\da-fA-F](_?[\dA-Fa-f])*">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="\d(_?\d)*\.\d(_?\d)*([eE][-+]?\d(_?\d)*)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="\d(_?\d)*">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern=""""\s*">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
<push state="heredoc_double"/>
|
||||
</rule>
|
||||
<rule pattern="'''\s*$">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
<push state="heredoc_single"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<push state="string_double"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
<push state="string_single"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="sigils"/>
|
||||
</rule>
|
||||
<rule pattern="%\{">
|
||||
<token type="Punctuation"/>
|
||||
<push state="map_key"/>
|
||||
</rule>
|
||||
<rule pattern="\{">
|
||||
<token type="Punctuation"/>
|
||||
<push state="tuple"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="sigils">
|
||||
<rule pattern="(~[a-z])(""")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringOther"/>
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
</bygroups>
|
||||
<push state="triquot-end" state="triquot-intp"/>
|
||||
</rule>
|
||||
<rule pattern="(~[A-Z])(""")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringOther"/>
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
</bygroups>
|
||||
<push state="triquot-end" state="triquot-no-intp"/>
|
||||
</rule>
|
||||
<rule pattern="(~[a-z])(''')">
|
||||
<bygroups>
|
||||
<token type="LiteralStringOther"/>
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
</bygroups>
|
||||
<push state="triapos-end" state="triapos-intp"/>
|
||||
</rule>
|
||||
<rule pattern="(~[A-Z])(''')">
|
||||
<bygroups>
|
||||
<token type="LiteralStringOther"/>
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
</bygroups>
|
||||
<push state="triapos-end" state="triapos-no-intp"/>
|
||||
</rule>
|
||||
<rule pattern="~[a-z]\{">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="cb-intp"/>
|
||||
</rule>
|
||||
<rule pattern="~[A-Z]\{">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="cb-no-intp"/>
|
||||
</rule>
|
||||
<rule pattern="~[a-z]\[">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="sb-intp"/>
|
||||
</rule>
|
||||
<rule pattern="~[A-Z]\[">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="sb-no-intp"/>
|
||||
</rule>
|
||||
<rule pattern="~[a-z]\(">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="pa-intp"/>
|
||||
</rule>
|
||||
<rule pattern="~[A-Z]\(">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="pa-no-intp"/>
|
||||
</rule>
|
||||
<rule pattern="~[a-z]<">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="ab-intp"/>
|
||||
</rule>
|
||||
<rule pattern="~[A-Z]<">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="ab-no-intp"/>
|
||||
</rule>
|
||||
<rule pattern="~[a-z]/">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="slas-intp"/>
|
||||
</rule>
|
||||
<rule pattern="~[A-Z]/">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="slas-no-intp"/>
|
||||
</rule>
|
||||
<rule pattern="~[a-z]\|">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="pipe-intp"/>
|
||||
</rule>
|
||||
<rule pattern="~[A-Z]\|">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="pipe-no-intp"/>
|
||||
</rule>
|
||||
<rule pattern="~[a-z]"">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="quot-intp"/>
|
||||
</rule>
|
||||
<rule pattern="~[A-Z]"">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="quot-no-intp"/>
|
||||
</rule>
|
||||
<rule pattern="~[a-z]'">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="apos-intp"/>
|
||||
</rule>
|
||||
<rule pattern="~[A-Z]'">
|
||||
<token type="LiteralStringOther"/>
|
||||
<push state="apos-no-intp"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="triapos-intp">
|
||||
<rule pattern="^\s*'''">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="heredoc_interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string_single_atom">
|
||||
<rule pattern="[^#'\\]+">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="escapes"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="(')">
|
||||
<bygroups>
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="quot-intp">
|
||||
<rule pattern="[^#"\\]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="escapes"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern=""[a-zA-Z]*">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="sb-no-intp">
|
||||
<rule pattern="[^\]\\]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\][a-zA-Z]*">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="slas-intp">
|
||||
<rule pattern="[^#/\\]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="escapes"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="/[a-zA-Z]*">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="sb-intp">
|
||||
<rule pattern="[^#\]\\]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="escapes"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\][a-zA-Z]*">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="heredoc_no_interpol">
|
||||
<rule pattern="[^\\\n]+">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
</rule>
|
||||
<rule pattern="\n+">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="pipe-intp">
|
||||
<rule pattern="[^#\|\\]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="escapes"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\|[a-zA-Z]*">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="map_val">
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
<rule pattern=",">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(?=\})">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="heredoc_single">
|
||||
<rule pattern="^\s*'''">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="heredoc_interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="heredoc_interpol">
|
||||
<rule pattern="[^#\\\n]+">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="escapes"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
</rule>
|
||||
<rule pattern="\n+">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string_single">
|
||||
<rule pattern="[^#'\\]+">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="escapes"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="(')">
|
||||
<bygroups>
|
||||
<token type="LiteralStringSingle"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string_double_atom">
|
||||
<rule pattern="[^#"\\]+">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="escapes"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="(")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="ab-no-intp">
|
||||
<rule pattern="[^>\\]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern=">[a-zA-Z]*">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="ab-intp">
|
||||
<rule pattern="[^#>\\]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="escapes"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern=">[a-zA-Z]*">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="quot-no-intp">
|
||||
<rule pattern="[^"\\]+">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringOther"/>
|
||||
</rule>
|
||||
<rule pattern=""[a-zA-Z]*">
|
||||
<token type="LiteralStringOther"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="triapos-no-intp">
|
||||
<rule pattern="^\s*'''">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="heredoc_no_interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string_double">
|
||||
<rule pattern="[^#"\\]+">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="escapes"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="(")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringDouble"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="escapes">
|
||||
<rule pattern="(\\x\{)([\da-fA-F]+)(\})">
|
||||
<bygroups>
|
||||
<token type="LiteralStringEscape"/>
|
||||
<token type="LiteralNumberHex"/>
|
||||
<token type="LiteralStringEscape"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\\x[\da-fA-F]{1,2})">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="(\\[abdefnrstv])">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="triquot-no-intp">
|
||||
<rule pattern="^\s*"""">
|
||||
<token type="LiteralStringHeredoc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="heredoc_no_interpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
119
lexers/elm.xml
Normal file
119
lexers/elm.xml
Normal file
@ -0,0 +1,119 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Elm</name>
|
||||
<alias>elm</alias>
|
||||
<filename>*.elm</filename>
|
||||
<mime_type>text/x-elm</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="shader">
|
||||
<rule pattern="\|(?!\])">
|
||||
<token type="NameEntity"/>
|
||||
</rule>
|
||||
<rule pattern="\|\]">
|
||||
<token type="NameEntity"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern=".*\n">
|
||||
<token type="NameEntity"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="\{-">
|
||||
<token type="CommentMultiline"/>
|
||||
<push state="comment"/>
|
||||
</rule>
|
||||
<rule pattern="--.*">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="doublequote"/>
|
||||
</rule>
|
||||
<rule pattern="^\s*module\s*">
|
||||
<token type="KeywordNamespace"/>
|
||||
<push state="imports"/>
|
||||
</rule>
|
||||
<rule pattern="^\s*import\s*">
|
||||
<token type="KeywordNamespace"/>
|
||||
<push state="imports"/>
|
||||
</rule>
|
||||
<rule pattern="\[glsl\|.*">
|
||||
<token type="NameEntity"/>
|
||||
<push state="shader"/>
|
||||
</rule>
|
||||
<rule pattern="(import|module|alias|where|port|else|type|case|then|let|as|of|if|in)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="[A-Z]\w*">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="^main ">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="\((<-|\|\||\|>|&&|\+\+|->|\.\.|//|>>|>=|/=|==|::|<~|<\||<=|<<|~|<|=|:|>|'|/|\\|\.|\^|-|`|\+|\*|\||%)\)">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="(<-|\|\||\|>|&&|\+\+|->|\.\.|//|>>|>=|/=|==|::|<~|<\||<=|<<|~|<|=|:|>|'|/|\\|\.|\^|-|`|\+|\*|\||%)">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="numbers"/>
|
||||
</rule>
|
||||
<rule pattern="[a-z_][a-zA-Z_\']*">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="[,()\[\]{}]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="comment">
|
||||
<rule pattern="-(?!\})">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="\{-">
|
||||
<token type="CommentMultiline"/>
|
||||
<push state="comment"/>
|
||||
</rule>
|
||||
<rule pattern="[^-}]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="-\}">
|
||||
<token type="CommentMultiline"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="doublequote">
|
||||
<rule pattern="\\u[0-9a-fA-F]{4}">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="\\[nrfvb\\"]">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="[^"]">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="imports">
|
||||
<rule pattern="\w+(\.\w+)*">
|
||||
<token type="NameClass"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="numbers">
|
||||
<rule pattern="_?\d+\.(?=\d+)">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="_?\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
132
lexers/emacslisp.xml
Normal file
132
lexers/emacslisp.xml
Normal file
@ -0,0 +1,132 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>EmacsLisp</name>
|
||||
<alias>emacs</alias>
|
||||
<alias>elisp</alias>
|
||||
<alias>emacs-lisp</alias>
|
||||
<filename>*.el</filename>
|
||||
<mime_type>text/x-elisp</mime_type>
|
||||
<mime_type>application/x-elisp</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="string">
|
||||
<rule pattern="[^"\\`]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="`((?:\\.|[\w!$%&*+-/<=>?@^{}~|])(?:\\.|[\w!$%&*+-/<=>?@^{}~|]|[#.:])*)\'">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="`">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<push state="body"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="body">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern=";.*$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="\?([^\\]|\\.)">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern=":((?:\\.|[\w!$%&*+-/<=>?@^{}~|])(?:\\.|[\w!$%&*+-/<=>?@^{}~|]|[#.:])*)">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="::((?:\\.|[\w!$%&*+-/<=>?@^{}~|])(?:\\.|[\w!$%&*+-/<=>?@^{}~|]|[#.:])*)">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="'((?:\\.|[\w!$%&*+-/<=>?@^{}~|])(?:\\.|[\w!$%&*+-/<=>?@^{}~|]|[#.:])*)">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="`">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[-+]?\d+\.?(?=[ "()\]\'\n,;`])">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="[-+]?\d+/\d+(?=[ "()\]\'\n,;`])">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="[-+]?(\d*\.\d+([defls][-+]?\d+)?|\d+(\.\d*)?[defls][-+]?\d+)(?=[ "()\]\'\n,;`])">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="\[|\]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="#:((?:\\.|[\w!$%&*+-/<=>?@^{}~|])(?:\\.|[\w!$%&*+-/<=>?@^{}~|]|[#.:])*)">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="#\^\^?">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="#\'">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="#[bB][+-]?[01]+(/[01]+)?">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="#[oO][+-]?[0-7]+(/[0-7]+)?">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="#[xX][+-]?[0-9a-fA-F]+(/[0-9a-fA-F]+)?">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="#\d+r[+-]?[0-9a-zA-Z]+(/[0-9a-zA-Z]+)?">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="#\d+=">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="#\d+#">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="(,@|,|\.|:)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="(t|nil)(?=[ "()\]\'\n,;`])">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="\*((?:\\.|[\w!$%&*+-/<=>?@^{}~|])(?:\\.|[\w!$%&*+-/<=>?@^{}~|]|[#.:])*)\*">
|
||||
<token type="NameVariableGlobal"/>
|
||||
</rule>
|
||||
<rule pattern="((?:\\.|[\w!$%&*+-/<=>?@^{}~|])(?:\\.|[\w!$%&*+-/<=>?@^{}~|]|[#.:])*)">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="#\(">
|
||||
<token type="Operator"/>
|
||||
<push state="body"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="Punctuation"/>
|
||||
<push state="body"/>
|
||||
</rule>
|
||||
<rule pattern="\)">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
166
lexers/erlang.xml
Normal file
166
lexers/erlang.xml
Normal file
@ -0,0 +1,166 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Erlang</name>
|
||||
<alias>erlang</alias>
|
||||
<filename>*.erl</filename>
|
||||
<filename>*.hrl</filename>
|
||||
<filename>*.es</filename>
|
||||
<filename>*.escript</filename>
|
||||
<mime_type>text/x-erlang</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="%.*\n">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="(receive|after|begin|catch|query|case|cond|when|let|fun|end|try|of|if)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(localtime_to_universaltime|universaltime_to_localtime|list_to_existing_atom|check_process_code|bitstring_to_list|list_to_bitstring|function_exported|is_process_alive|iolist_to_binary|bump_reductions|garbage_collect|process_display|suspend_process|list_to_integer|disconnect_node|integer_to_list|trace_delivered|send_nosuspend|list_to_binary|system_profile|binary_to_term|binary_to_list|resume_process|append_element|term_to_binary|system_monitor|list_to_tuple|spawn_monitor|delete_module|trace_pattern|tuple_to_list|list_to_float|float_to_list|module_loaded|port_connect|is_bitstring|port_to_list|monitor_node|process_info|port_control|split_binary|cancel_timer|purge_module|group_leader|list_to_atom|atom_to_list|port_command|is_reference|process_flag|pid_to_list|system_info|start_timer|iolist_size|fun_to_list|load_module|is_function|ref_to_list|list_to_pid|system_flag|make_tuple|is_builtin|unregister|is_boolean|set_cookie|md5_update|spawn_link|setelement|trace_info|read_timer|statistics|send_after|port_close|is_integer|tuple_size|spawn_opt|open_port|is_record|is_binary|md5_final|port_call|port_info|is_number|byte_size|demonitor|register|is_float|bit_size|fun_info|get_keys|is_tuple|is_atom|element|is_list|is_port|monitor|display|whereis|is_pid|memory|unlink|phash2|length|spawn|nodes|trace|round|apply|erase|phash|trunc|float|size|link|node|exit|hash|send|get|md5|put|abs|hd|tl)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(andalso|orelse|bxor|band|bnot|and|bsr|bsl|div|not|rem|bor|xor|or)\b">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
<rule pattern="^-">
|
||||
<token type="Punctuation"/>
|
||||
<push state="directive"/>
|
||||
</rule>
|
||||
<rule pattern="(\+\+?|--?|\*|/|<|>|/=|=:=|=/=|=<|>=|==?|<-|!|\?)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="<<">
|
||||
<token type="NameLabel"/>
|
||||
</rule>
|
||||
<rule pattern=">>">
|
||||
<token type="NameLabel"/>
|
||||
</rule>
|
||||
<rule pattern="((?:[a-z]\w*|'[^\n']*[^\\]'))(:)">
|
||||
<bygroups>
|
||||
<token type="NameNamespace"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(?:^|(?<=:))((?:[a-z]\w*|'[^\n']*[^\\]'))(\s*)(\()">
|
||||
<bygroups>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[+-]?(?:[2-9]|[12][0-9]|3[0-6])#[0-9a-zA-Z]+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="[+-]?\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="[+-]?\d+.\d+">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="[]\[:_@\".{}()|;,]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(?:[A-Z_]\w*)">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="(?:[a-z]\w*|'[^\n']*[^\\]')">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="\?(?:(?:[A-Z_]\w*)|(?:[a-z]\w*|'[^\n']*[^\\]'))">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="\$(?:(?:\\(?:[bdefnrstv\'"\\]|[0-7][0-7]?[0-7]?|(?:x[0-9a-fA-F]{2}|x\{[0-9a-fA-F]+\})|\^[a-zA-Z]))|\\[ %]|[^\\])">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="#(?:[a-z]\w*|'[^\n']*[^\\]')(:?\.(?:[a-z]\w*|'[^\n']*[^\\]'))?">
|
||||
<token type="NameLabel"/>
|
||||
</rule>
|
||||
<rule pattern="\A#!.+\n">
|
||||
<token type="CommentHashbang"/>
|
||||
</rule>
|
||||
<rule pattern="#\{">
|
||||
<token type="Punctuation"/>
|
||||
<push state="map_key"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern="(?:\\(?:[bdefnrstv\'"\\]|[0-7][0-7]?[0-7]?|(?:x[0-9a-fA-F]{2}|x\{[0-9a-fA-F]+\})|\^[a-zA-Z]))">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="~[0-9.*]*[~#+BPWXb-ginpswx]">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
</rule>
|
||||
<rule pattern="[^"\\~]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="~">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="directive">
|
||||
<rule pattern="(define)(\s*)(\()((?:(?:[A-Z_]\w*)|(?:[a-z]\w*|'[^\n']*[^\\]')))">
|
||||
<bygroups>
|
||||
<token type="NameEntity"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameConstant"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(record)(\s*)(\()((?:(?:[A-Z_]\w*)|(?:[a-z]\w*|'[^\n']*[^\\]')))">
|
||||
<bygroups>
|
||||
<token type="NameEntity"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameLabel"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(?:[a-z]\w*|'[^\n']*[^\\]')">
|
||||
<token type="NameEntity"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="map_key">
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
<rule pattern="=>">
|
||||
<token type="Punctuation"/>
|
||||
<push state="map_val"/>
|
||||
</rule>
|
||||
<rule pattern=":=">
|
||||
<token type="Punctuation"/>
|
||||
<push state="map_val"/>
|
||||
</rule>
|
||||
<rule pattern="\}">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="map_val">
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
<rule pattern=",">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(?=\})">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
412
lexers/factor.xml
Normal file
412
lexers/factor.xml
Normal file
@ -0,0 +1,412 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Factor</name>
|
||||
<alias>factor</alias>
|
||||
<filename>*.factor</filename>
|
||||
<mime_type>text/x-factor</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="base">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="((?:MACRO|MEMO|TYPED)?:[:]?)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(M:[:]?)(\s+)(\S+)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(C:)(\s+)(\S+)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(GENERIC:)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(HOOK:|GENERIC#)(\s+)(\S+)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\(\s">
|
||||
<token type="NameFunction"/>
|
||||
<push state="stackeffect"/>
|
||||
</rule>
|
||||
<rule pattern=";\s">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(USING:)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="vocabs"/>
|
||||
</rule>
|
||||
<rule pattern="(USE:|UNUSE:|IN:|QUALIFIED:)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameNamespace"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(QUALIFIED-WITH:)(\s+)(\S+)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameNamespace"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameNamespace"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(FROM:|EXCLUDE:)(\s+)(\S+)(\s+=>\s)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameNamespace"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="words"/>
|
||||
</rule>
|
||||
<rule pattern="(RENAME:)(\s+)(\S+)(\s+)(\S+)(\s+=>\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameNamespace"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(ALIAS:|TYPEDEF:)(\s+)(\S+)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(DEFER:|FORGET:|POSTPONE:)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(TUPLE:|ERROR:)(\s+)(\S+)(\s+<\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
<push state="slots"/>
|
||||
</rule>
|
||||
<rule pattern="(TUPLE:|ERROR:|BUILTIN:)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
<push state="slots"/>
|
||||
</rule>
|
||||
<rule pattern="(MIXIN:|UNION:|INTERSECTION:)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(PREDICATE:)(\s+)(\S+)(\s+<\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(C:)(\s+)(\S+)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(INSTANCE:)(\s+)(\S+)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(SLOT:)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(SINGLETON:)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="SINGLETONS:">
|
||||
<token type="Keyword"/>
|
||||
<push state="classes"/>
|
||||
</rule>
|
||||
<rule pattern="(CONSTANT:|SYMBOL:|MAIN:|HELP:)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="SYMBOLS:\s">
|
||||
<token type="Keyword"/>
|
||||
<push state="words"/>
|
||||
</rule>
|
||||
<rule pattern="SYNTAX:\s">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="ALIEN:\s">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(STRUCT:)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(FUNCTION:)(\s+\S+\s+)(\S+)(\s+\(\s+[^)]+\)\s)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(FUNCTION-ALIAS:)(\s+)(\S+)(\s+\S+\s+)(\S+)(\s+\(\s+[^)]+\)\s)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(?:<PRIVATE|PRIVATE>)\s">
|
||||
<token type="KeywordNamespace"/>
|
||||
</rule>
|
||||
<rule pattern=""""\s+(?:.|\n)*?\s+"""">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern=""(?:\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\S+"\s+(?:\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="CHAR:\s+(?:\\[\\abfnrstv]|[^\\]\S*)\s">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="!\s+.*$">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="#!\s+.*$">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="/\*\s+(?:.|\n)*?\s\*/\s">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="[tf]\s">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="[\\$]\s+\S+">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="M\\\s+\S+\s+\S+">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="[+-]?(?:[\d,]*\d)?\.(?:\d([\d,]*\d)?)?(?:[eE][+-]?\d+)?\s">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="[+-]?\d(?:[\d,]*\d)?(?:[eE][+-]?\d+)?\s">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="0x[a-fA-F\d](?:[a-fA-F\d,]*[a-fA-F\d])?(?:p\d([\d,]*\d)?)?\s">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="NAN:\s+[a-fA-F\d](?:[a-fA-F\d,]*[a-fA-F\d])?(?:p\d([\d,]*\d)?)?\s">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="0b[01]+\s">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="0o[0-7]+\s">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="(?:\d([\d,]*\d)?)?\+\d(?:[\d,]*\d)?/\d(?:[\d,]*\d)?\s">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="(?:\-\d([\d,]*\d)?)?\-\d(?:[\d,]*\d)?/\d(?:[\d,]*\d)?\s">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="(?:deprecated|final|foldable|flushable|inline|recursive)\s">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(identity-hashcode|callstack>array|identity-tuple\?|identity-tuple|retainstack|callstack\?|tri-curry\*|tri-curry@|tri-curry|<wrapper>|datastack|bi-curry@|bi-curry\*|hashcode\*|callstack|\?execute|hashcode|boolean\?|compose\?|>boolean|wrapper\?|bi-curry|unless\*|boolean|assert\?|\(clone\)|either\?|prepose|assert=|execute|wrapper|compose|3curry|assert|2curry|curry\?|object|equal\?|tuple\?|unless|build|3drop|same\?|2tri\*|2tri@|both\?|3keep|4drop|throw|2over|swapd|clear|2keep|2drop|until|curry|4keep|clone|while|tuple|when\*|-rot|tri@|dupd|drop|tri\*|call|when|with|4dup|4dip|3tri|3dup|3dip|2tri|keep|loop|most|2nip|swap|2dup|null|2dip|2bi\*|2bi@|pick|over|and|rot|not|nip|new|if\*|tri|2bi|boa|eq\?|dup|3bi|dip|die|bi\*|bi@|\?if|xor|bi|do|if|or|\?|=)\s">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(assoc-clone-like|assoc-filter-as|assoc-partition|assoc-intersect|assoc-hashcode|assoc-combine|assoc-filter!|assoc-subset\?|assoc-union!|maybe-set-at|extract-keys|assoc-map-as|assoc-differ|assoc-refine|assoc-empty\?|assoc-filter|assoc-diff!|sift-values|assoc-union|assoc-stack|clear-assoc|assoc-all\?|delete-at\*|assoc-find|substitute|assoc-each|assoc-size|assoc-diff|assoc-any\?|assoc-like|rename-at|sift-keys|new-assoc|map>assoc|value-at\*|assoc-map|delete-at|change-at|assoc>map|value-at|push-at|assoc=|values|set-at|<enum>|inc-at|2cache|value\?|assoc\?|>alist|cache|enum\?|assoc|unzip|key\?|enum|keys|\?at|\?of|zip|at\+|at\*|at|of)\s">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(shallow-spread>quot|recursive-hashcode|linear-case-quot|deep-spread>quot|to-fixed-point|execute-effect|wrong-values\?|4cleave>quot|2cleave>quot|wrong-values|3cleave>quot|cleave>quot|call-effect|alist>quot|case>quot|case-find|cond>quot|no-case\?|no-cond\?|no-case|no-cond|4cleave|3cleave|2cleave|cleave|spread|cond|case)\s">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(log2-expects-positive\?|integer>fixnum-strict|log2-expects-positive|out-of-fixnum-range\?|out-of-fixnum-range|find-last-integer|next-power-of-2|\(all-integers\?\)|integer>fixnum|\(find-integer\)|\(each-integer\)|imaginary-part|fp-nan-payload|all-integers\?|find-integer|each-integer|fp-infinity\?|fp-special\?|fp-bitwise=|bits>double|double>bits|power-of-2\?|unless-zero|denominator|next-float|bits>float|float>bits|prev-float|unordered\?|real-part|when-zero|numerator|rational\?|>integer|rational|complex\?|<fp-nan>|fp-qnan\?|fp-snan\?|integer\?|number=|bignum\?|integer|>fixnum|fp-sign|fp-nan\?|fixnum\?|number\?|complex|if-zero|>bignum|bignum|number|fixnum|float\?|bitxor|ratio\?|bitnot|bitand|>float|real\?|bitor|zero\?|even\?|times|shift|float|recip|align|ratio|neg\?|real|log2|bit\?|odd\?|/mod|\?1\+|mod|rem|neg|sgn|u<=|u>=|abs|u>|2/|2\^|/i|/f|sq|<=|u<|>=|-|\+|<|\*|/|>)\s">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(non-negative-integer-expected\?|non-negative-integer-expected|immutable-sequence\?|immutable-sequence|virtual-sequence\?|sequence-hashcode|cartesian-product|check-slice-error|unclip-last-slice|assert-sequence=|assert-sequence\?|virtual-exemplar|virtual-sequence|assert-sequence|trim-head-slice|last-index-from|find-index-from|trim-tail-slice|find-last-from|cartesian-each|collapse-slice|but-last-slice|map-find-last|cartesian-map|collector-for|bounds-error\?|accumulate-as|replace-slice|bounds-check\?|binary-reduce|new-resizable|unless-empty|delete-slice|replicate-as|map-integers|selector-for|bounds-check|reduce-index|bounds-error|unclip-slice|new-sequence|<repetition>|slice-error\?|slice-error|unclip-last|drop-prefix|supremum-by|push-either|2map-reduce|accumulate!|tail-slice\*|repetition\?|check-slice|iota-tuple\?|remove-nth!|sum-lengths|head-slice\*|find-index|clone-like|delete-all|change-nth|prepend-as|member-eq\?|max-length|each-index|map-reduce|iota-tuple|produce-as|snip-slice|accumulate|remove-eq!|last-index|min-length|remove-nth|<reversed>|repetition|tail-slice|3append-as|when-empty|interleave|insert-nth|infimum-by|index-from|set-second|immutable\?|rest-slice|set-fourth|head-slice|trim-slice|set-length|set-third|concat-as|immutable|trim-tail|cut-slice|collector|set-first|sequence\?|sequence=|midpoint@|trim-head|each-from|reversed\?|map-index|partition|find-last|2selector|2sequence|replicate|find-from|filter-as|3sequence|append-as|4sequence|remove-eq|1sequence|virtual@|push-all|lengthen|shorter\?|map-find|reverse!|reversed|exchange|pad-tail|pad-head|surround|selector|shortest|sequence|set-last|mismatch|supremum|new-like|if-empty|but-last|\?set-nth|filter!|harvest|member\?|map-sum|indices|padding|set-nth|2map-as|shorter|shorten|prepend|infimum|2reduce|append!|product|subseq\?|longest|longer\?|push-if|suffix!|reverse|join-as|remove!|3append|\?second|3map-as|<slice>|produce|length|\?first|start\*|longer|remove|subseq|unclip|first2|first3|reduce|second|follow|filter|slice\?|map-as|empty\?|fourth|suffix|halves|concat|first4|prefix|append|index|short|2all\?|count|2each|third|tail\*|slice|first|tail\?|head\*|3each|head\?|start|\?last|join|iota|last|like|snip|map!|head|glue|move|tail|2map|find|sift|flip|nths|trim|each|cut\*|3map|pop\*|copy|any\?|all\?|\?nth|push|rest|sum|nth|pop|map|cut)\s">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(init-namespaces|with-variables|with-variable|set-namestack|change-global|with-global|initialize|get-global|set-global|with-scope|make-assoc|is-global|namespace|namestack|counter|change|toggle|global|set|get|dec|off|inc|on|\+@)\s">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(resize-array|<array>|1array|2array|3array|4array|>array|array\?|array|pair\?|pair)\s">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(\(stream-contents-by-length-or-block\)|with-input-output\+error-streams\*|with-input-output\+error-streams|\(stream-contents-by-element\)|\(stream-contents-by-length\)|stream-read-partial-unsafe|\(stream-contents-by-block\)|with-output\+error-stream\*|\(each-stream-block-slice\)|stream-read-partial-into|with-output\+error-stream|each-stream-block-slice|invalid-read-buffer\?|stream-read-partial|stream-element-type|\(each-stream-block\)|with-output-stream\*|invalid-read-buffer|with-output-stream|with-input-stream\*|stream-read-unsafe|with-error-stream\*|with-error-stream|stream-read-until|each-stream-block|with-output>error|with-input-stream|with-error>output|read-partial-into|stream-contents\*|each-stream-line|stream-seekable\?|stream-read-into|each-block-slice|each-block-size|stream-contents|bad-seek-type\?|seek-absolute\?|output-stream\?|seek-relative\?|stream-write1|with-streams\*|output-stream|stream-length|bad-seek-type|seek-absolute|input-stream\?|stream-readln|seek-relative|with-streams|read-partial|stream-copy\*|stream-flush|stream-read1|stream-lines|stream-write|stream-print|error-stream|input-stream|stream-tell|\+character\+|stream-copy|each-morsel|seek-output|stream-read|tell-output|stream-seek|read-until|seek-input|each-block|tell-input|each-line|seek-end\?|read-into|stream-nl|stream-bl|contents|seek-end|write1|\+byte\+|readln|write|read1|print|flush|lines|read|nl|bl)\s">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(resize-string|<string>|1string|>string|string\?|string)\s">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(<vector>|1vector|>vector|vector\?|vector|\?push)\s">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(current-continuation|return-continuation|callback-error-hook|error-continuation|attempt-all-error\?|thread-error-hook|attempt-all-error|rethrow-restarts|continue-restart|compute-restarts|error-in-thread|throw-continue|throw-restarts|with-datastack|<continuation>|original-error|ignore-errors|continue-with|continuation\?|in-callback\?|continuation|error-thread|attempt-all|<condition>|with-return|condition\?|<restart>|condition|continue|restart\?|restarts|rethrow|callcc0|recover|restart|cleanup|callcc1|return|error|ifcc)\s">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="\S+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="stackeffect">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\(\s+">
|
||||
<token type="NameFunction"/>
|
||||
<push state="stackeffect"/>
|
||||
</rule>
|
||||
<rule pattern="\)\s">
|
||||
<token type="NameFunction"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="--\s">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="\S+">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="slots">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern=";\s">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(\{\s+)(\S+)(\s+[^}]+\s+\}\s)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="NameVariable"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\S+">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="vocabs">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern=";\s">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\S+">
|
||||
<token type="NameNamespace"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="classes">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern=";\s">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\S+">
|
||||
<token type="NameClass"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="words">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern=";\s">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\S+">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="#!.*$">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<push state="base"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
68
lexers/fennel.xml
Normal file
68
lexers/fennel.xml
Normal file
@ -0,0 +1,68 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Fennel</name>
|
||||
<alias>fennel</alias>
|
||||
<alias>fnl</alias>
|
||||
<filename>*.fennel</filename>
|
||||
<mime_type>text/x-fennel</mime_type>
|
||||
<mime_type>application/x-fennel</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern=";.*$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="-?\d+\.\d+">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="-?\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="0x-?[abcdef\d]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="'(?!#)[\w!$%*+<=>?/.#-]+">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="\\(.|[a-z]+)">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="::?#?(?!#)[\w!$%*+<=>?/.#-]+">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="~@|[`\'#^~&@]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="(require-macros|set-forcibly!|import-macros|eval-compiler|pick-values|accumulate|macrodebug|pick-args|with-open|icollect|partial|comment|include|collect|hashfn|rshift|values|length|lshift|quote|match|while|doto|band|when|bnot|bxor|not=|tset|-\?>>|each|->>|let|doc|for|and|set|not|-\?>|bor|lua|\?\.|do|>=|<=|//|\.\.|->|or|if|~=|\^|>|=|<|:|/|\.|-|\+|\*|%|#) ">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(global|lambda|macros|local|macro|var|fn|λ) ">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="(debug\.setuservalue|debug\.getmetatable|debug\.getuservalue|package\.searchpath|debug\.setmetatable|debug\.upvaluejoin|debug\.getregistry|coroutine\.running|coroutine\.create|debug\.setupvalue|debug\.getupvalue|coroutine\.status|coroutine\.resume|debug\.upvalueid|package\.loadlib|debug\.traceback|math\.randomseed|coroutine\.yield|collectgarbage|debug\.getlocal|package\.seeall|string\.reverse|coroutine\.wrap|debug\.setlocal|bit32\.replace|bit32\.lrotate|debug\.gethook|debug\.getinfo|bit32\.extract|string\.gmatch|string\.format|bit32\.arshift|bit32\.rrotate|debug\.sethook|table\.concat|os\.setlocale|table\.remove|string\.lower|bit32\.rshift|bit32\.lshift|string\.match|table\.unpack|setmetatable|getmetatable|table\.insert|string\.upper|string\.byte|debug\.debug|string\.gsub|bit32\.btest|math\.random|string\.find|string\.dump|os\.difftime|string\.char|table\.sort|loadstring|io\.tmpfile|bit32\.band|bit32\.bnot|string\.sub|os\.execute|os\.tmpname|table\.maxn|math\.log10|math\.atan2|table\.pack|math\.frexp|math\.ldexp|bit32\.bxor|string\.len|math\.floor|string\.rep|coroutine|math\.cosh|math\.ceil|math\.atan|math\.asin|math\.acos|math\.modf|os\.rename|os\.remove|io\.output|os\.getenv|bit32\.bor|math\.sinh|math\.fmod|math\.tanh|math\.sqrt|math\.cos|math\.tan|io\.lines|os\.clock|tostring|io\.input|math\.sin|tonumber|loadfile|math\.rad|math\.pow|io\.flush|math\.abs|math\.min|rawequal|math\.max|math\.log|io\.close|io\.popen|math\.exp|math\.deg|io\.write|os\.time|io\.read|io\.open|require|os\.exit|os\.date|package|io\.type|module|select|rawset|rawlen|rawget|unpack|assert|dofile|ipairs|string|xpcall|table|pcall|bit32|print|debug|error|pairs|math|type|next|load|arg|io|os|_G) ">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=\()(?!#)[\w!$%*+<=>?/.#-]+">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="(?!#)[\w!$%*+<=>?/.#-]+">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="(\[|\])">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(\{|\})">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(\(|\))">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
159
lexers/fish.xml
Normal file
159
lexers/fish.xml
Normal file
@ -0,0 +1,159 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Fish</name>
|
||||
<alias>fish</alias>
|
||||
<alias>fishshell</alias>
|
||||
<filename>*.fish</filename>
|
||||
<filename>*.load</filename>
|
||||
<mime_type>application/x-fish</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="paren">
|
||||
<rule pattern="\)">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="math">
|
||||
<rule pattern="\)\)">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[-+*/%^|&]|\*\*|\|\|">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\d+#\d+">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\d+#(?! )">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\d+">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="basic"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interp"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="data"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="interp">
|
||||
<rule pattern="\$\(\(">
|
||||
<token type="Keyword"/>
|
||||
<push state="math"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="Keyword"/>
|
||||
<push state="paren"/>
|
||||
</rule>
|
||||
<rule pattern="\$#?(\w+|.)">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="basic">
|
||||
<rule pattern="(?<=(?:^|\A|;|&&|\|\||\||\b(continue|function|return|switch|begin|while|break|count|false|block|echo|case|true|else|exit|test|set|cdh|and|pwd|for|end|not|if|cd|or)\b)\s*)(continue|function|return|switch|begin|while|break|count|false|block|test|case|true|echo|exit|else|set|cdh|and|pwd|for|end|not|if|cd|or)(?=;?\b)">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=for\s+\S+\s+)in\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\b(fish_update_completions|fish_command_not_found|fish_breakpoint_prompt|fish_status_to_signal|fish_right_prompt|fish_is_root_user|fish_mode_prompt|fish_vcs_prompt|fish_key_reader|fish_svn_prompt|fish_git_prompt|fish_hg_prompt|fish_greeting|fish_add_path|commandline|fish_prompt|fish_indent|fish_config|fish_pager|breakpoint|fish_title|prompt_pwd|functions|set_color|realpath|funcsave|contains|complete|argparse|fish_opt|history|builtin|getopts|suspend|command|mimedb|printf|ulimit|disown|string|source|funced|status|random|isatty|fishd|prevd|vared|umask|nextd|alias|pushd|emit|jobs|popd|help|psub|wait|fish|read|time|exec|eval|math|trap|type|dirs|dirh|abbr|kill|bind|hash|open|fc|bg|fg)\s*\b(?!\.)">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="#!.*\n">
|
||||
<token type="CommentHashbang"/>
|
||||
</rule>
|
||||
<rule pattern="#.*\n">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="\\[\w\W]">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="(\b\w+)(\s*)(=)">
|
||||
<bygroups>
|
||||
<token type="NameVariable"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[\[\]()={}]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=\[[^\]]+)\.\.|-(?=[^\[]+\])">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="<<-?\s*(\'?)\\?(\w+)[\w\W]+?\2">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=set\s+(?:--?[^\d\W][\w-]*\s+)?)\w+">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=for\s+)\w[\w-]*(?=\s+in)">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=function\s+)\w(?:[^\n])*?(?= *[-\n])">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=(?:^|\b(?:and|or|sudo)\b|;|\|\||&&|\||\(|(?:\b\w+\s*=\S+\s)) *)\w[\w-]*">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="data">
|
||||
<rule pattern="(?s)\$?"(\\\\|\\[0-7]+|\\.|[^"\\$])*"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="(?s)\$'(\\\\|\\[0-7]+|\\.|[^'\\])*'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="(?s)'.*?'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern=";">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="&&|\|\||&|\||\^|<|>">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\b\d+\b">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=\s+)--?[^\d][\w-]*">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
<rule pattern=".+?">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(?s)(\\\\|\\[0-7]+|\\.|[^"\\$])+">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="interp"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
78
lexers/forth.xml
Normal file
78
lexers/forth.xml
Normal file
@ -0,0 +1,78 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Forth</name>
|
||||
<alias>forth</alias>
|
||||
<filename>*.frt</filename>
|
||||
<filename>*.fth</filename>
|
||||
<filename>*.fs</filename>
|
||||
<mime_type>application/x-forth</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\\.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\([\s].*?\)">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="(:|variable|constant|value|buffer:)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="worddef"/>
|
||||
</rule>
|
||||
<rule pattern="([.sc]")(\s+?)">
|
||||
<bygroups>
|
||||
<token type="LiteralString"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="stringdef"/>
|
||||
</rule>
|
||||
<rule pattern="(blk|block|buffer|evaluate|flush|load|save-buffers|update|empty-buffers|list|refill|scr|thru|\#s|\*\/mod|\+loop|\/mod|0<|0=|1\+|1-|2!|2\*|2\/|2@|2drop|2dup|2over|2swap|>body|>in|>number|>r|\?dup|abort|abort\"|abs|accept|align|aligned|allot|and|base|begin|bl|c!|c,|c@|cell\+|cells|char|char\+|chars|constant|count|cr|create|decimal|depth|do|does>|drop|dup|else|emit|environment\?|evaluate|execute|exit|fill|find|fm\/mod|here|hold|i|if|immediate|invert|j|key|leave|literal|loop|lshift|m\*|max|min|mod|move|negate|or|over|postpone|quit|r>|r@|recurse|repeat|rot|rshift|s\"|s>d|sign|sm\/rem|source|space|spaces|state|swap|then|type|u\.|u\<|um\*|um\/mod|unloop|until|variable|while|word|xor|\[char\]|\[\'\]|@|!|\#|<\#|\#>|:|;|\+|-|\*|\/|,|<|>|\|1\+|1-|\.|\.r|0<>|0>|2>r|2r>|2r@|:noname|\?do|again|c\"|case|compile,|endcase|endof|erase|false|hex|marker|nip|of|pad|parse|pick|refill|restore-input|roll|save-input|source-id|to|true|tuck|u\.r|u>|unused|value|within|\[compile\]|\#tib|convert|expect|query|span|tib|2constant|2literal|2variable|d\+|d-|d\.|d\.r|d0<|d0=|d2\*|d2\/|d<|d=|d>s|dabs|dmax|dmin|dnegate|m\*\/|m\+|2rot|du<|catch|throw|abort|abort\"|at-xy|key\?|page|ekey|ekey>char|ekey\?|emit\?|ms|time&date|BIN|CLOSE-FILE|CREATE-FILE|DELETE-FILE|FILE-POSITION|FILE-SIZE|INCLUDE-FILE|INCLUDED|OPEN-FILE|R\/O|R\/W|READ-FILE|READ-LINE|REPOSITION-FILE|RESIZE-FILE|S\"|SOURCE-ID|W/O|WRITE-FILE|WRITE-LINE|FILE-STATUS|FLUSH-FILE|REFILL|RENAME-FILE|>float|d>f|f!|f\*|f\+|f-|f\/|f0<|f0=|f<|f>d|f@|falign|faligned|fconstant|fdepth|fdrop|fdup|fliteral|float\+|floats|floor|fmax|fmin|fnegate|fover|frot|fround|fswap|fvariable|represent|df!|df@|dfalign|dfaligned|dfloat\+|dfloats|f\*\*|f\.|fabs|facos|facosh|falog|fasin|fasinh|fatan|fatan2|fatanh|fcos|fcosh|fe\.|fexp|fexpm1|fln|flnp1|flog|fs\.|fsin|fsincos|fsinh|fsqrt|ftan|ftanh|f~|precision|set-precision|sf!|sf@|sfalign|sfaligned|sfloat\+|sfloats|\(local\)|to|locals\||allocate|free|resize|definitions|find|forth-wordlist|get-current|get-order|search-wordlist|set-current|set-order|wordlist|also|forth|only|order|previous|-trailing|\/string|blank|cmove|cmove>|compare|search|sliteral|.s|dump|see|words|;code|ahead|assembler|bye|code|cs-pick|cs-roll|editor|state|\[else\]|\[if\]|\[then\]|forget|defer|defer@|defer!|action-of|begin-structure|field:|buffer:|parse-name|buffer:|traverse-wordlist|n>r|nr>|2value|fvalue|name>interpret|name>compile|name>string|cfield:|end-structure)\s">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(\$[0-9A-F]+)">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="(\#|%|&|\-|\+)?[0-9]+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="(\#|%|&|\-|\+)?[0-9.]+">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(@i|!i|@e|!e|pause|noop|turnkey|sleep|itype|icompare|sp@|sp!|rp@|rp!|up@|up!|>a|a>|a@|a!|a@+|a@-|>b|b>|b@|b!|b@+|b@-|find-name|1ms|sp0|rp0|\(evaluate\)|int-trap|int!)\s">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(do-recognizer|r:fail|recognizer:|get-recognizers|set-recognizers|r:float|r>comp|r>int|r>post|r:name|r:word|r:dnum|r:num|recognizer|forth-recognizer|rec:num|rec:float|rec:word)\s">
|
||||
<token type="NameDecorator"/>
|
||||
</rule>
|
||||
<rule pattern="(Evalue|Rvalue|Uvalue|Edefer|Rdefer|Udefer)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="worddef"/>
|
||||
</rule>
|
||||
<rule pattern="[^\s]+(?=[\s])">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="worddef">
|
||||
<rule pattern="\S+">
|
||||
<token type="NameClass"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="stringdef">
|
||||
<rule pattern="[^"]+">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
102
lexers/fortran.xml
Normal file
102
lexers/fortran.xml
Normal file
@ -0,0 +1,102 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Fortran</name>
|
||||
<alias>fortran</alias>
|
||||
<alias>f90</alias>
|
||||
<filename>*.f03</filename>
|
||||
<filename>*.f90</filename>
|
||||
<filename>*.f95</filename>
|
||||
<filename>*.F03</filename>
|
||||
<filename>*.F90</filename>
|
||||
<filename>*.F95</filename>
|
||||
<mime_type>text/x-fortran</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="core">
|
||||
<rule pattern="\b(DO)(\s+)(CONCURRENT)\b">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b(GO)(\s*)(TO)\b">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="TextWhitespace"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b(ABSTRACT|ACCEPT|ALL|ALLSTOP|ALLOCATABLE|ALLOCATE|ARRAY|ASSIGN|ASSOCIATE|ASYNCHRONOUS|BACKSPACE|BIND|BLOCK|BLOCKDATA|BYTE|CALL|CASE|CLASS|CLOSE|CODIMENSION|COMMON|CONTIGUOUS|CONTAINS|CONTINUE|CRITICAL|CYCLE|DATA|DEALLOCATE|DECODE|DEFERRED|DIMENSION|DO|ELEMENTAL|ELSE|ENCODE|END|ENDASSOCIATE|ENDBLOCK|ENDDO|ENDENUM|ENDFORALL|ENDFUNCTION|ENDIF|ENDINTERFACE|ENDMODULE|ENDPROGRAM|ENDSELECT|ENDSUBMODULE|ENDSUBROUTINE|ENDTYPE|ENDWHERE|ENTRY|ENUM|ENUMERATOR|EQUIVALENCE|ERROR STOP|EXIT|EXTENDS|EXTERNAL|EXTRINSIC|FILE|FINAL|FORALL|FORMAT|FUNCTION|GENERIC|IF|IMAGES|IMPLICIT|IMPORT|IMPURE|INCLUDE|INQUIRE|INTENT|INTERFACE|INTRINSIC|IS|LOCK|MEMORY|MODULE|NAMELIST|NULLIFY|NONE|NON_INTRINSIC|NON_OVERRIDABLE|NOPASS|ONLY|OPEN|OPTIONAL|OPTIONS|PARAMETER|PASS|PAUSE|POINTER|PRINT|PRIVATE|PROGRAM|PROCEDURE|PROTECTED|PUBLIC|PURE|READ|RECURSIVE|RESULT|RETURN|REWIND|SAVE|SELECT|SEQUENCE|STOP|SUBMODULE|SUBROUTINE|SYNC|SYNCALL|SYNCIMAGES|SYNCMEMORY|TARGET|THEN|TYPE|UNLOCK|USE|VALUE|VOLATILE|WHERE|WRITE|WHILE)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\b(CHARACTER|COMPLEX|DOUBLE PRECISION|DOUBLE COMPLEX|INTEGER|LOGICAL|REAL|C_INT|C_SHORT|C_LONG|C_LONG_LONG|C_SIGNED_CHAR|C_SIZE_T|C_INT8_T|C_INT16_T|C_INT32_T|C_INT64_T|C_INT_LEAST8_T|C_INT_LEAST16_T|C_INT_LEAST32_T|C_INT_LEAST64_T|C_INT_FAST8_T|C_INT_FAST16_T|C_INT_FAST32_T|C_INT_FAST64_T|C_INTMAX_T|C_INTPTR_T|C_FLOAT|C_DOUBLE|C_LONG_DOUBLE|C_FLOAT_COMPLEX|C_DOUBLE_COMPLEX|C_LONG_DOUBLE_COMPLEX|C_BOOL|C_CHAR|C_PTR|C_FUNPTR)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(\*\*|\*|\+|-|\/|<|>|<=|>=|==|\/=|=)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="(::)">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="[()\[\],:&%;.]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\b(Abort|Abs|Access|AChar|ACos|ACosH|AdjustL|AdjustR|AImag|AInt|Alarm|All|Allocated|ALog|AMax|AMin|AMod|And|ANInt|Any|ASin|ASinH|Associated|ATan|ATanH|Atomic_Define|Atomic_Ref|BesJ|BesJN|Bessel_J0|Bessel_J1|Bessel_JN|Bessel_Y0|Bessel_Y1|Bessel_YN|BesY|BesYN|BGE|BGT|BLE|BLT|Bit_Size|BTest|CAbs|CCos|Ceiling|CExp|Char|ChDir|ChMod|CLog|Cmplx|Command_Argument_Count|Complex|Conjg|Cos|CosH|Count|CPU_Time|CShift|CSin|CSqRt|CTime|C_Loc|C_Associated|C_Null_Ptr|C_Null_Funptr|C_F_Pointer|C_F_ProcPointer|C_Null_Char|C_Alert|C_Backspace|C_Form_Feed|C_FunLoc|C_Sizeof|C_New_Line|C_Carriage_Return|C_Horizontal_Tab|C_Vertical_Tab|DAbs|DACos|DASin|DATan|Date_and_Time|DbesJ|DbesJN|DbesY|DbesYN|Dble|DCos|DCosH|DDiM|DErF|DErFC|DExp|Digits|DiM|DInt|DLog|DMax|DMin|DMod|DNInt|Dot_Product|DProd|DSign|DSinH|DShiftL|DShiftR|DSin|DSqRt|DTanH|DTan|DTime|EOShift|Epsilon|ErF|ErFC|ErFC_Scaled|ETime|Execute_Command_Line|Exit|Exp|Exponent|Extends_Type_Of|FDate|FGet|FGetC|FindLoc|Float|Floor|Flush|FNum|FPutC|FPut|Fraction|FSeek|FStat|FTell|Gamma|GError|GetArg|Get_Command|Get_Command_Argument|Get_Environment_Variable|GetCWD|GetEnv|GetGId|GetLog|GetPId|GetUId|GMTime|HostNm|Huge|Hypot|IAbs|IAChar|IAll|IAnd|IAny|IArgC|IBClr|IBits|IBSet|IChar|IDate|IDiM|IDInt|IDNInt|IEOr|IErrNo|IFix|Imag|ImagPart|Image_Index|Index|Int|IOr|IParity|IRand|IsaTty|IShft|IShftC|ISign|Iso_C_Binding|Is_Contiguous|Is_Iostat_End|Is_Iostat_Eor|ITime|Kill|Kind|LBound|LCoBound|Len|Len_Trim|LGe|LGt|Link|LLe|LLt|LnBlnk|Loc|Log|Log_Gamma|Logical|Long|LShift|LStat|LTime|MaskL|MaskR|MatMul|Max|MaxExponent|MaxLoc|MaxVal|MClock|Merge|Merge_Bits|Move_Alloc|Min|MinExponent|MinLoc|MinVal|Mod|Modulo|MvBits|Nearest|New_Line|NInt|Norm2|Not|Null|Num_Images|Or|Pack|Parity|PError|Precision|Present|Product|Radix|Rand|Random_Number|Random_Seed|Range|Real|RealPart|Rename|Repeat|Reshape|RRSpacing|RShift|Same_Type_As|Scale|Scan|Second|Selected_Char_Kind|Selected_Int_Kind|Selected_Real_Kind|Set_Exponent|Shape|ShiftA|ShiftL|ShiftR|Short|Sign|Signal|SinH|Sin|Sleep|Sngl|Spacing|Spread|SqRt|SRand|Stat|Storage_Size|Sum|SymLnk|System|System_Clock|Tan|TanH|Time|This_Image|Tiny|TrailZ|Transfer|Transpose|Trim|TtyNam|UBound|UCoBound|UMask|Unlink|Unpack|Verify|XOr|ZAbs|ZCos|ZExp|ZLog|ZSin|ZSqRt)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="\.(true|false)\.">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="\.(eq|ne|lt|le|gt|ge|not|and|or|eqv|neqv)\.">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="strings">
|
||||
<rule pattern="(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="nums">
|
||||
<rule pattern="\d+(?![.e])(_([1-9]|[a-z]\w*))?">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="[+-]?\d*\.\d+([ed][-+]?\d+)?(_([1-9]|[a-z]\w+))?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="[+-]?\d+\.\d*([ed][-+]?\d+)?(_([1-9]|[a-z]\w*))?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="[+-]?\d+(\.\d*)?[ed][-+]?\d+(_([1-9]|[a-z]\w*))?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="^#.*\n">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="!.*\n">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="strings"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="core"/>
|
||||
</rule>
|
||||
<rule pattern="[a-z][\w$]*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="nums"/>
|
||||
</rule>
|
||||
<rule pattern="[\s]+">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
71
lexers/fortranfixed.xml
Normal file
71
lexers/fortranfixed.xml
Normal file
@ -0,0 +1,71 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>FortranFixed</name>
|
||||
<alias>fortranfixed</alias>
|
||||
<filename>*.f</filename>
|
||||
<filename>*.F</filename>
|
||||
<mime_type>text/x-fortran</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
<not_multiline>true</not_multiline>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="cont-char">
|
||||
<rule pattern=" ">
|
||||
<token type="TextWhitespace"/>
|
||||
<push state="code"/>
|
||||
</rule>
|
||||
<rule pattern=".">
|
||||
<token type="GenericStrong"/>
|
||||
<push state="code"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="code">
|
||||
<rule pattern="(.{66})(.*)(\n)">
|
||||
<bygroups>
|
||||
<using lexer="Fortran"/>
|
||||
<token type="Comment"/>
|
||||
<token type="TextWhitespace"/>
|
||||
</bygroups>
|
||||
<push state="root"/>
|
||||
</rule>
|
||||
<rule pattern="(.*)(!.*)(\n)">
|
||||
<bygroups>
|
||||
<using lexer="Fortran"/>
|
||||
<token type="Comment"/>
|
||||
<token type="TextWhitespace"/>
|
||||
</bygroups>
|
||||
<push state="root"/>
|
||||
</rule>
|
||||
<rule pattern="(.*)(\n)">
|
||||
<bygroups>
|
||||
<using lexer="Fortran"/>
|
||||
<token type="TextWhitespace"/>
|
||||
</bygroups>
|
||||
<push state="root"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<mutators>
|
||||
<push state="root"/>
|
||||
</mutators>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="[C*].*\n">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="#.*\n">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern=" {0,4}!.*\n">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="(.{5})">
|
||||
<token type="NameLabel"/>
|
||||
<push state="cont-char"/>
|
||||
</rule>
|
||||
<rule pattern=".*\n">
|
||||
<using lexer="Fortran"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
245
lexers/fsharp.xml
Normal file
245
lexers/fsharp.xml
Normal file
@ -0,0 +1,245 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>FSharp</name>
|
||||
<alias>fsharp</alias>
|
||||
<filename>*.fs</filename>
|
||||
<filename>*.fsi</filename>
|
||||
<mime_type>text/x-fsharp</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="comment">
|
||||
<rule pattern="[^(*)@"]+">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="\(\*">
|
||||
<token type="Comment"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\*\)">
|
||||
<token type="Comment"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="@"">
|
||||
<token type="LiteralString"/>
|
||||
<push state="lstring"/>
|
||||
</rule>
|
||||
<rule pattern=""""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="tqs"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="[(*)@]">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern="[^\\"]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="escape-sequence"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern=""B?">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="lstring">
|
||||
<rule pattern="[^"]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="""">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern=""B?">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="tqs">
|
||||
<rule pattern="[^"]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern=""""B?">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="escape-sequence">
|
||||
<rule pattern="\\[\\"\'ntbrafv]">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="\\[0-9]{3}">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="\\u[0-9a-fA-F]{4}">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="\\U[0-9a-fA-F]{8}">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\(\)|\[\]">
|
||||
<token type="NameBuiltinPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="\b(?<!\.)([A-Z][\w\']*)(?=\s*\.)">
|
||||
<token type="NameNamespace"/>
|
||||
<push state="dotted"/>
|
||||
</rule>
|
||||
<rule pattern="\b([A-Z][\w\']*)">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="///.*?\n">
|
||||
<token type="LiteralStringDoc"/>
|
||||
</rule>
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\(\*(?!\))">
|
||||
<token type="Comment"/>
|
||||
<push state="comment"/>
|
||||
</rule>
|
||||
<rule pattern="@"">
|
||||
<token type="LiteralString"/>
|
||||
<push state="lstring"/>
|
||||
</rule>
|
||||
<rule pattern=""""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="tqs"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="\b(open type|open|module)(\s+)([\w.]+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameNamespace"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b(let!?)(\s+)(\w+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameVariable"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b(type)(\s+)(\w+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameClass"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b(member|override)(\s+)(\w+)(\.)(\w+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="Name"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b(abstract|as|assert|base|begin|class|default|delegate|do!|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|function|fun|global|if|inherit|inline|interface|internal|in|lazy|let!|let|match|member|module|mutable|namespace|new|null|of|open|override|private|public|rec|return!|return|select|static|struct|then|to|true|try|type|upcast|use!|use|val|void|when|while|with|yield!|yield|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="``([^`\n\r\t]|`[^`\n\r\t])+``">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="#[ \t]*(if|endif|else|line|nowarn|light|r|\d+)\b">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="(!=|#|&&|&|\(|\)|\*|\+|,|-\.|->|-|\.\.|\.|::|:=|:>|:|;;|;|<-|<\]|<|>\]|>|\?\?|\?|\[<|\[\||\[|\]|_|`|\{|\|\]|\||\}|~|<@@|<@|=|@>|@@>)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="([=<>@^|&+\*/$%-]|[!?~])?[!$%&*+\./:<=>?@^|~-]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\b(and|or|not)\b">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
<rule pattern="\b(sbyte|byte|char|nativeint|unativeint|float32|single|float|double|int8|uint8|int16|uint16|int32|uint32|int64|uint64|decimal|unit|bool|string|list|exn|obj|enum)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="[^\W\d][\w']*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="\d[\d_]*[uU]?[yslLnQRZINGmM]?">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="0[xX][\da-fA-F][\da-fA-F_]*[uU]?[yslLn]?[fF]?">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="0[oO][0-7][0-7_]*[uU]?[yslLn]?">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="0[bB][01][01_]*[uU]?[yslLn]?">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)[fFmM]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'B?">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="'.'">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="@?"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="[~?][a-z][\w\']*:">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="dotted">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\.">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[A-Z][\w\']*(?=\s*\.)">
|
||||
<token type="NameNamespace"/>
|
||||
</rule>
|
||||
<rule pattern="[A-Z][\w\']*">
|
||||
<token type="Name"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[a-z_][\w\']*">
|
||||
<token type="Name"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
150
lexers/gas.xml
Normal file
150
lexers/gas.xml
Normal file
@ -0,0 +1,150 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>GAS</name>
|
||||
<alias>gas</alias>
|
||||
<alias>asm</alias>
|
||||
<filename>*.s</filename>
|
||||
<filename>*.S</filename>
|
||||
<mime_type>text/x-gas</mime_type>
|
||||
<priority>0.1</priority>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="punctuation">
|
||||
<rule pattern="[-*,.()\[\]!:]+">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule pattern="(?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+):">
|
||||
<token type="NameLabel"/>
|
||||
</rule>
|
||||
<rule pattern="\.(?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+)">
|
||||
<token type="NameAttribute"/>
|
||||
<push state="directive-args"/>
|
||||
</rule>
|
||||
<rule pattern="lock|rep(n?z)?|data\d+">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
<rule pattern="(?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+)">
|
||||
<token type="NameFunction"/>
|
||||
<push state="instruction-args"/>
|
||||
</rule>
|
||||
<rule pattern="[\r\n]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="directive-args">
|
||||
<rule pattern="(?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+)">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\"|[^"])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="@(?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+)">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
<rule pattern="(?:0[xX][a-zA-Z0-9]+|\d+)">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="%(?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+)">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="[\r\n]+">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="([;#]|//).*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="/[*].*?[*]/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="/[*].*?\n[\w\W]*?[*]/">
|
||||
<token type="CommentMultiline"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="punctuation"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="instruction-args">
|
||||
<rule pattern="([a-z0-9]+)( )(<)((?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+))(>)">
|
||||
<bygroups>
|
||||
<token type="LiteralNumberHex"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameConstant"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="([a-z0-9]+)( )(<)((?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+))([-+])((?:0[xX][a-zA-Z0-9]+|\d+))(>)">
|
||||
<bygroups>
|
||||
<token type="LiteralNumberHex"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="NameConstant"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="LiteralNumberInteger"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+)">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(?:0[xX][a-zA-Z0-9]+|\d+)">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="%(?:[a-zA-Z$_][\w$.@-]*|\.[\w$.@-]+)">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="$(?:0[xX][a-zA-Z0-9]+|\d+)">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="$'(.|\\')'">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="[\r\n]+">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="([;#]|//).*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="/[*].*?[*]/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="/[*].*?\n[\w\W]*?[*]/">
|
||||
<token type="CommentMultiline"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="punctuation"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="whitespace">
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="([;#]|//).*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/[*][\w\W]*?[*]/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
259
lexers/gdscript.xml
Normal file
259
lexers/gdscript.xml
Normal file
File diff suppressed because one or more lines are too long
270
lexers/gdscript3.xml
Normal file
270
lexers/gdscript3.xml
Normal file
@ -0,0 +1,270 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>GDScript3</name>
|
||||
<alias>gdscript3</alias>
|
||||
<alias>gd3</alias>
|
||||
<filename>*.gd</filename>
|
||||
<mime_type>text/x-gdscript</mime_type>
|
||||
<mime_type>application/x-gdscript</mime_type>
|
||||
<analyse>
|
||||
<regex pattern="func (_ready|_init|_input|_process|_unhandled_input)" score="0.8"/>
|
||||
<regex pattern="(extends |class_name |onready |preload|load|setget|func [^_])" score="0.4"/>
|
||||
<regex pattern="(var|const|enum|export|signal|tool)" score="0.2"/>
|
||||
</analyse>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="builtins">
|
||||
<rule pattern="(?<!\.)(instance_from_id|nearest_po2|print_stack|type_exist|rand_range|linear2db|var2bytes|dict2inst|randomize|bytes2var|rand_seed|db2linear|inst2dict|printerr|printraw|decimals|preload|deg2rad|str2var|stepify|var2str|convert|weakref|fposmod|funcref|rad2deg|dectime|printt|is_inf|is_nan|assert|Color8|typeof|ColorN|prints|floor|atan2|yield|randf|print|range|clamp|round|randi|sqrt|tanh|cosh|ceil|ease|acos|load|fmod|lerp|seed|sign|atan|sinh|hash|asin|sin|str|cos|tan|pow|exp|min|abs|log|max)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(?<!\.)(self|false|true|PI|NAN|INF)\b">
|
||||
<token type="NameBuiltinPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="(?<!\.)(Physics2DShapeQueryParameters|PhysicsShapeQueryParameters|Physics2DDirectBodyStateSW|NavigationPolygonInstance|ResourceInteractiveLoader|Physics2DDirectSpaceState|Physics2DShapeQueryResult|Physics2DTestMotionResult|InputEventJoystickButton|InputEventJoystickMotion|Physics2DDirectBodyState|PhysicsDirectBodyStateSW|PhysicsShapeQueryResult|PhysicsDirectSpaceState|SpatialSound2DServerSW|PackedDataContainerRef|NavigationMeshInstance|ResourceImportMetadata|PhysicsDirectBodyState|ConcavePolygonShape2D|CanvasItemShaderGraph|EditorScenePostImport|InputEventScreenTouch|InputEventMouseButton|InputEventMouseMotion|SpatialSound2DServer|AudioStreamOGGVorbis|VisibilityNotifier2D|InputEventScreenDrag|ConvexPolygonShape2D|SpatialSoundServerSW|ParticleAttractor2D|PackedDataContainer|SpatialStreamPlayer|RenderTargetTexture|AnimationTreePlayer|ConcavePolygonShape|InstancePlaceholder|MaterialShaderGraph|AudioStreamPlayback|VisibilityEnabler2D|SpatialSamplePlayer|DampedSpringJoint2D|InterpolatedCamera|ConvexPolygonShape|ConfirmationDialog|SpatialSoundServer|BakedLightInstance|ParallaxBackground|CollisionPolygon2D|CanvasItemMaterial|VisibilityNotifier|EditorImportPlugin|VideoStreamTheora|TouchScreenButton|ResourcePreloader|OccluderPolygon2D|BakedLightSampler|CollisionObject2D|RemoteTransform2D|PolygonPathFinder|StyleBoxImageMask|NavigationPolygon|TranslationServer|MultiMeshInstance|ImmediateGeometry|Physics2DServerSW|ColorPickerButton|VisibilityEnabler|PHashTranslation|RectangleShape2D|DirectionalLight|AnimatedSprite3D|WorldEnvironment|CollisionShape2D|EventStreamChibi|InputEventAction|CollisionPolygon|AudioStreamSpeex|EditorFileDialog|GeometryInstance|Generic6DOFJoint|PacketPeerStream|CanvasItemShader|KinematicBody2D|StyleBoxTexture|PhysicsServerSW|VSplitContainer|CenterContainer|GDFunctionState|AudioStreamOpus|TextureProgress|MarginContainer|CollisionObject|LightOccluder2D|AnimationPlayer|HSplitContainer|ScrollContainer|SoundRoomParams|Physics2DServer|MaterialShader|ShaderMaterial|ViewportSprite|SplitContainer|AudioStreamMPC|VisualInstance|PanelContainer|BackBufferCopy|SamplePlayer2D|CanvasModulate|ResourceLoader|CapsuleShape2D|ReferenceFrame|NavigationMesh|CollisionShape|ConeTwistJoint|ProximityGroup|AnimatedSprite|SegmentShape2D|BoneAttachment|RichTextLabel|CircleShape2D|VBoxContainer|PacketPeerUDP|SpatialPlayer|TextureButton|KinematicBody|SoundPlayer2D|PhysicsServer|ParallaxLayer|InputEventKey|GrooveJoint2D|PhysicsBody2D|FixedMaterial|GridContainer|HBoxContainer|StreamPeerSSL|StyleBoxEmpty|StreamPeerTCP|SampleLibrary|GDNativeClass|AudioServerSW|ResourceSaver|SpriteBase3D|StreamPlayer|AtlasTexture|VisualServer|SamplePlayer|StyleBoxFlat|StaticBody2D|SpriteFrames|MeshDataTool|MeshInstance|Vector3Array|BoxContainer|TabContainer|HButtonArray|LargeTexture|Navigation2D|WindowDialog|EditorScript|EditorPlugin|TextureFrame|AcceptDialog|ImageTexture|CapsuleShape|VehicleWheel|VButtonArray|Vector2Array|InputDefault|OptionButton|PathFollow2D|VehicleBody|ColorPicker|PopupDialog|ProgressBar|CanvasLayer|Translation|Environment|EventPlayer|VideoPlayer|EventStream|VideoStream|ButtonGroup|Particles2D|Patch9Frame|ButtonArray|SurfaceTool|MeshLibrary|PackedScene|PhysicsBody|AudioStream|Performance|StringArray|AudioServer|RigidBody2D|LineShape2D|SliderJoint|SphereShape|ShaderGraph|CheckButton|StreamPeer|FileDialog|PathFollow|SceneState|RoomBounds|Dictionary|VSeparator|PacketPeer|VScrollBar|MenuButton|HTTPClient|PinJoint2D|BakedLight|PlaneShape|InputEvent|BaseButton|HSeparator|HScrollBar|Navigation|PopupPanel|StaticBody|Position2D|Position3D|ToolButton|HingeJoint|CanvasItem|RayShape2D|ColorArray|ConfigFile|TCP_Server|RayCast2D|ColorRamp|SpotLight|RealArray|GraphNode|Container|Reference|PopupMenu|Separator|Polygon2D|MultiMesh|Semaphore|Transform|OmniLight|GraphEdit|Particles|Animation|Marshalls|SceneTree|RigidBody|XMLParser|PathRemap|ScrollBar|Directory|PCKPacker|RawArray|TextEdit|MainLoop|TreeItem|StyleBox|Material|Geometry|Matrix32|Resource|UndoRedo|RayShape|TestCube|ItemList|CheckBox|Camera2D|Skeleton|Sprite3D|Viewport|NodePath|IntArray|BoxShape|PinJoint|InputMap|LineEdit|GDScript|Vector3|TileMap|HSlider|Spatial|SpinBox|World2D|IP_Unix|Curve2D|Curve3D|WeakRef|GridMap|Matrix3|VSlider|CubeMap|Joint2D|Globals|Shape2D|Texture|Control|TileSet|Light2D|FuncRef|Vector2|RayCast|Script|Node2D|Button|BitMap|Sample|Object|String|Shader|Area2D|Slider|Sprite|Thread|Path2D|Camera|Portal|float|Theme|World|YSort|Shape|Joint|Mutex|Tween|RegEx|Label|Rect2|Array|Plane|Light|Range|Color|Input|Popup|Panel|Timer|Image|Area|Quad|bool|AABB|Quat|File|Tabs|Path|Font|Tree|Room|Mesh|Node|RID|int|Nil|IP|OS)\b">
|
||||
<token type="NameException"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="sqs">
|
||||
<rule pattern="'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\\\|\\'|\\\n">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="strings-single"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="stringescape">
|
||||
<rule pattern="\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="classname">
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="NameClass"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="strings-single">
|
||||
<rule pattern="%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[E-GXc-giorsux%]">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\\'"%\n]+">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="[\'"\\]">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="%">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="funcname">
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="NameFunction"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="numbers">
|
||||
<rule pattern="(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="\d+[eE][+-]?[0-9]+j?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0[xX][a-fA-F0-9]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="\d+j?">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="tdqs">
|
||||
<rule pattern=""""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="strings-double"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="name">
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="^(\s*)([rRuUbB]{,2})("""(?:.|\n)*?""")">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralStringDoc"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="^(\s*)([rRuUbB]{,2})('''(?:.|\n)*?''')">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralStringDoc"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[^\S\n]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="#.*$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="[]{}:(),;[]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="(in|and|or|not)\b">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
<rule pattern="!=|==|<<|>>|&&|\+=|-=|\*=|/=|%=|&=|\|=|\|\||[-~+/*%=<>&^.!|$]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="keywords"/>
|
||||
</rule>
|
||||
<rule pattern="(def)((?:\s|\\\s)+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="funcname"/>
|
||||
</rule>
|
||||
<rule pattern="(class)((?:\s|\\\s)+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="classname"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="builtins"/>
|
||||
</rule>
|
||||
<rule pattern="([rR]|[uUbB][rR]|[rR][uUbB])(""")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralStringDouble"/>
|
||||
</bygroups>
|
||||
<push state="tdqs"/>
|
||||
</rule>
|
||||
<rule pattern="([rR]|[uUbB][rR]|[rR][uUbB])(''')">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralStringSingle"/>
|
||||
</bygroups>
|
||||
<push state="tsqs"/>
|
||||
</rule>
|
||||
<rule pattern="([rR]|[uUbB][rR]|[rR][uUbB])(")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralStringDouble"/>
|
||||
</bygroups>
|
||||
<push state="dqs"/>
|
||||
</rule>
|
||||
<rule pattern="([rR]|[uUbB][rR]|[rR][uUbB])(')">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralStringSingle"/>
|
||||
</bygroups>
|
||||
<push state="sqs"/>
|
||||
</rule>
|
||||
<rule pattern="([uUbB]?)(""")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralStringDouble"/>
|
||||
</bygroups>
|
||||
<combined state="stringescape" state="tdqs"/>
|
||||
</rule>
|
||||
<rule pattern="([uUbB]?)(''')">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralStringSingle"/>
|
||||
</bygroups>
|
||||
<combined state="stringescape" state="tsqs"/>
|
||||
</rule>
|
||||
<rule pattern="([uUbB]?)(")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralStringDouble"/>
|
||||
</bygroups>
|
||||
<combined state="stringescape" state="dqs"/>
|
||||
</rule>
|
||||
<rule pattern="([uUbB]?)(')">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralStringSingle"/>
|
||||
</bygroups>
|
||||
<combined state="stringescape" state="sqs"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="name"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="numbers"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="keywords">
|
||||
<rule pattern="(breakpoint|continue|onready|extends|signal|return|export|static|setget|switch|break|const|while|class|tool|pass|func|case|enum|else|elif|var|for|do|if)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="dqs">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\\\|\\"|\\\n">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="strings-double"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="tsqs">
|
||||
<rule pattern="'''">
|
||||
<token type="LiteralStringSingle"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="strings-single"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="strings-double">
|
||||
<rule pattern="%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[E-GXc-giorsux%]">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\\'"%\n]+">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="[\'"\\]">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="%">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
263
lexers/gherkin.xml
Normal file
263
lexers/gherkin.xml
Normal file
@ -0,0 +1,263 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Gherkin</name>
|
||||
<alias>cucumber</alias>
|
||||
<alias>Cucumber</alias>
|
||||
<alias>gherkin</alias>
|
||||
<alias>Gherkin</alias>
|
||||
<filename>*.feature</filename>
|
||||
<filename>*.FEATURE</filename>
|
||||
<mime_type>text/x-gherkin</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="comments">
|
||||
<rule pattern="\s*#.*$">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="featureElementsOnStack">
|
||||
<rule pattern="^(\s*)(하지만|조건|먼저|만일|만약|단|그리고|그러면|那麼|那么|而且|當|当|前提|假設|假设|假如|假定|但是|但し|並且|并且|同時|同时|もし|ならば|ただし|しかし|かつ|و |متى |لكن |عندما |ثم |بفرض |اذاً |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Унда |То |Припустимо, що |Припустимо |Онда |Но |Нехай |Лекин |Когато |Када |Кад |К тому же |И |Задато |Задати |Задате |Если |Допустим |Дадено |Ва |Бирок |Аммо |Али |Але |Агар |А |І |Și |És |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Youse know when youse got |Youse know like when |Yna |Ya know how |Ya gotta |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |Và |Ve |Und |Un |Thì |Then y'all |Then |Tapi |Tak |Tada |Tad |Så |Stel |Soit |Siis |Si |Sed |Se |Quando |Quand |Quan |Pryd |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Når |När |Niin |Nhưng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu'|Kun |Kuid |Kui |Khi |Keď |Ketika |Když |Kaj |Kai |Kada |Kad |Jeżeli |Ja |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |Eğer ki |Etant donné |Et |Então |Entonces |Entao |En |Eeldades |E |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Dengan |Den youse gotta |De |Dato |Dar |Dann |Dan |Dado |Dacă |Daca |DEN |Când |Cuando |Cho |Cept |Cand |Cal |But y'all |But |Buh |Biết |Bet |BUT |Atès |Atunci |Atesa |Anrhegedig a |Angenommen |And y'all |And |An |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A také |A |\* )">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="2"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="comments"/>
|
||||
</rule>
|
||||
<rule pattern="(\s|.)">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="tableContent">
|
||||
<rule pattern="\s+\|\s*$">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="comments"/>
|
||||
</rule>
|
||||
<rule pattern="\\\|">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\s*\|">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="doubleStringTable"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="numbers">
|
||||
<rule pattern="(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="tableVars">
|
||||
<rule pattern="(<[^>]+>)">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="doubleString">
|
||||
<rule pattern=""">
|
||||
<token type="NameFunction"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="featureElements">
|
||||
<rule pattern="^(\s*)(하지만|조건|먼저|만일|만약|단|그리고|그러면|那麼|那么|而且|當|当|前提|假設|假设|假如|假定|但是|但し|並且|并且|同時|同时|もし|ならば|ただし|しかし|かつ|و |متى |لكن |عندما |ثم |بفرض |اذاً |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Унда |То |Припустимо, що |Припустимо |Онда |Но |Нехай |Лекин |Когато |Када |Кад |К тому же |И |Задато |Задати |Задате |Если |Допустим |Дадено |Ва |Бирок |Аммо |Али |Але |Агар |А |І |Și |És |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Youse know when youse got |Youse know like when |Yna |Ya know how |Ya gotta |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |Và |Ve |Und |Un |Thì |Then y'all |Then |Tapi |Tak |Tada |Tad |Så |Stel |Soit |Siis |Si |Sed |Se |Quando |Quand |Quan |Pryd |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Når |När |Niin |Nhưng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu'|Kun |Kuid |Kui |Khi |Keď |Ketika |Když |Kaj |Kai |Kada |Kad |Jeżeli |Ja |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |Eğer ki |Etant donné |Et |Então |Entonces |Entao |En |Eeldades |E |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Dengan |Den youse gotta |De |Dato |Dar |Dann |Dan |Dado |Dacă |Daca |DEN |Când |Cuando |Cho |Cept |Cand |Cal |But y'all |But |Buh |Biết |Bet |BUT |Atès |Atunci |Atesa |Anrhegedig a |Angenommen |And y'all |And |An |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A také |A |\* )">
|
||||
<token type="Keyword"/>
|
||||
<push state="stepContentStack"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="comments"/>
|
||||
</rule>
|
||||
<rule pattern="(\s|.)">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="examplesTableHeader">
|
||||
<rule pattern="\s+\|\s*$">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="2"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="comments"/>
|
||||
</rule>
|
||||
<rule pattern="\\\|">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="\s*\|">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="[^|]">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="stepContentStack">
|
||||
<rule pattern="$">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="2"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="stepContent"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="pyString">
|
||||
<rule pattern=""""">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="examplesTable">
|
||||
<rule pattern="\s+\|">
|
||||
<token type="Keyword"/>
|
||||
<push state="examplesTableHeader"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="comments"/>
|
||||
</rule>
|
||||
<rule pattern="(\s|.)">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="stepContentRoot">
|
||||
<rule pattern="$">
|
||||
<token type="Keyword"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="stepContent"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="doubleStringTable">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule>
|
||||
<include state="tableVars"/>
|
||||
</rule>
|
||||
<rule pattern="(\s|.)">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="stepContent">
|
||||
<rule pattern=""">
|
||||
<token type="NameFunction"/>
|
||||
<push state="doubleString"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="tableVars"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="numbers"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="comments"/>
|
||||
</rule>
|
||||
<rule pattern="(\s|.)">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="scenarioSectionsOnStack">
|
||||
<rule pattern="^(\s*)(시나리오 개요|시나리오|배경|背景|場景大綱|場景|场景大纲|场景|劇本大綱|劇本|剧本大纲|剧本|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|シナリオ|سيناريو مخطط|سيناريو|الخلفية|תרחיש|תבנית תרחיש|רקע|Тарих|Сценарій|Сценарио|Сценарий структураси|Сценарий|Структура сценарію|Структура сценарија|Структура сценария|Скица|Рамка на сценарий|Пример|Предыстория|Предистория|Позадина|Передумова|Основа|Концепт|Контекст|Założenia|Wharrimean is|Tình huống|The thing of it is|Tausta|Taust|Tapausaihio|Tapaus|Szenariogrundriss|Szenario|Szablon scenariusza|Stsenaarium|Struktura scenarija|Skica|Skenario konsep|Skenario|Situācija|Senaryo taslağı|Senaryo|Scénář|Scénario|Schema dello scenario|Scenārijs pēc parauga|Scenārijs|Scenár|Scenaro|Scenariusz|Scenariul de şablon|Scenariul de sablon|Scenariu|Scenario Outline|Scenario Amlinellol|Scenario|Scenarijus|Scenarijaus šablonas|Scenarij|Scenarie|Rerefons|Raamstsenaarium|Primer|Pozadí|Pozadina|Pozadie|Plan du scénario|Plan du Scénario|Osnova scénáře|Osnova|Náčrt Scénáře|Náčrt Scenáru|Mate|MISHUN SRSLY|MISHUN|Kịch bản|Konturo de la scenaro|Kontext|Konteksts|Kontekstas|Kontekst|Koncept|Khung tình huống|Khung kịch bản|Háttér|Grundlage|Geçmiş|Forgatókönyv vázlat|Forgatókönyv|Fono|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Escenario|Escenari|Dis is what went down|Dasar|Contexto|Contexte|Contesto|Condiţii|Conditii|Cenário|Cenario|Cefndir|Bối cảnh|Blokes|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|All y'all|Achtergrond|Abstrakt Scenario|Abstract Scenario)(:)(.*)$">
|
||||
<bygroups>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
<push state="featureElementsOnStack"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="narrative">
|
||||
<rule>
|
||||
<include state="scenarioSectionsOnStack"/>
|
||||
</rule>
|
||||
<rule pattern="(\s|.)">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="\n">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="comments"/>
|
||||
</rule>
|
||||
<rule pattern=""""">
|
||||
<token type="Keyword"/>
|
||||
<push state="pyString"/>
|
||||
</rule>
|
||||
<rule pattern="\s+\|">
|
||||
<token type="Keyword"/>
|
||||
<push state="tableContent"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="NameFunction"/>
|
||||
<push state="doubleString"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="tableVars"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="numbers"/>
|
||||
</rule>
|
||||
<rule pattern="(\s*)(@[^@\r\n\t ]+)">
|
||||
<bygroups>
|
||||
<token type="NameFunction"/>
|
||||
<token type="NameTag"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="^(\s*)(하지만|조건|먼저|만일|만약|단|그리고|그러면|那麼|那么|而且|當|当|前提|假設|假设|假如|假定|但是|但し|並且|并且|同時|同时|もし|ならば|ただし|しかし|かつ|و |متى |لكن |عندما |ثم |بفرض |اذاً |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Унда |То |Припустимо, що |Припустимо |Онда |Но |Нехай |Лекин |Когато |Када |Кад |К тому же |И |Задато |Задати |Задате |Если |Допустим |Дадено |Ва |Бирок |Аммо |Али |Але |Агар |А |І |Și |És |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Youse know when youse got |Youse know like when |Yna |Ya know how |Ya gotta |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |Và |Ve |Und |Un |Thì |Then y'all |Then |Tapi |Tak |Tada |Tad |Så |Stel |Soit |Siis |Si |Sed |Se |Quando |Quand |Quan |Pryd |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Når |När |Niin |Nhưng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu'|Kun |Kuid |Kui |Khi |Keď |Ketika |Když |Kaj |Kai |Kada |Kad |Jeżeli |Ja |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |Eğer ki |Etant donné |Et |Então |Entonces |Entao |En |Eeldades |E |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Dengan |Den youse gotta |De |Dato |Dar |Dann |Dan |Dado |Dacă |Daca |DEN |Când |Cuando |Cho |Cept |Cand |Cal |But y'all |But |Buh |Biết |Bet |BUT |Atès |Atunci |Atesa |Anrhegedig a |Angenommen |And y'all |And |An |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A také |A |\* )">
|
||||
<bygroups>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
<push state="stepContentRoot"/>
|
||||
</rule>
|
||||
<rule pattern="^(기능|機能|功能|フィーチャ|خاصية|תכונה|Функціонал|Функционалност|Функционал|Фича|Особина|Могућност|Özellik|Właściwość|Tính năng|Trajto|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd)(:)(.*)$">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
<push state="narrative"/>
|
||||
</rule>
|
||||
<rule pattern="^(\s*)(시나리오 개요|시나리오|배경|背景|場景大綱|場景|场景大纲|场景|劇本大綱|劇本|剧本大纲|剧本|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|シナリオ|سيناريو مخطط|سيناريو|الخلفية|תרחיש|תבנית תרחיש|רקע|Тарих|Сценарій|Сценарио|Сценарий структураси|Сценарий|Структура сценарію|Структура сценарија|Структура сценария|Скица|Рамка на сценарий|Пример|Предыстория|Предистория|Позадина|Передумова|Основа|Концепт|Контекст|Założenia|Wharrimean is|Tình huống|The thing of it is|Tausta|Taust|Tapausaihio|Tapaus|Szenariogrundriss|Szenario|Szablon scenariusza|Stsenaarium|Struktura scenarija|Skica|Skenario konsep|Skenario|Situācija|Senaryo taslağı|Senaryo|Scénář|Scénario|Schema dello scenario|Scenārijs pēc parauga|Scenārijs|Scenár|Scenaro|Scenariusz|Scenariul de şablon|Scenariul de sablon|Scenariu|Scenario Outline|Scenario Amlinellol|Scenario|Scenarijus|Scenarijaus šablonas|Scenarij|Scenarie|Rerefons|Raamstsenaarium|Primer|Pozadí|Pozadina|Pozadie|Plan du scénario|Plan du Scénario|Osnova scénáře|Osnova|Náčrt Scénáře|Náčrt Scenáru|Mate|MISHUN SRSLY|MISHUN|Kịch bản|Konturo de la scenaro|Kontext|Konteksts|Kontekstas|Kontekst|Koncept|Khung tình huống|Khung kịch bản|Háttér|Grundlage|Geçmiş|Forgatókönyv vázlat|Forgatókönyv|Fono|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Escenario|Escenari|Dis is what went down|Dasar|Contexto|Contexte|Contesto|Condiţii|Conditii|Cenário|Cenario|Cefndir|Bối cảnh|Blokes|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|All y'all|Achtergrond|Abstrakt Scenario|Abstract Scenario)(:)(.*)$">
|
||||
<bygroups>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
<push state="featureElements"/>
|
||||
</rule>
|
||||
<rule pattern="^(\s*)(예|例子|例|サンプル|امثلة|דוגמאות|Сценарији|Примери|Приклади|Мисоллар|Значения|Örnekler|Voorbeelden|Variantai|Tapaukset|Scenarios|Scenariji|Scenarijai|Příklady|Példák|Príklady|Przykłady|Primjeri|Primeri|Piemēri|Pavyzdžiai|Paraugs|Juhtumid|Exemplos|Exemples|Exemplele|Exempel|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|EXAMPLZ|Dữ liệu|Contoh|Cobber|Beispiele)(:)(.*)$">
|
||||
<bygroups>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
<push state="examplesTable"/>
|
||||
</rule>
|
||||
<rule pattern="(\s|.)">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
117
lexers/gleam.xml
Normal file
117
lexers/gleam.xml
Normal file
@ -0,0 +1,117 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Gleam</name>
|
||||
<alias>gleam</alias>
|
||||
<filename>*.gleam</filename>
|
||||
<mime_type>text/x-gleam</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="///(.*?)\n">
|
||||
<token type="LiteralStringDoc"/>
|
||||
</rule>
|
||||
<rule pattern="//(.*?)\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="(as|assert|case|opaque|panic|pub|todo)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(import|use)\b">
|
||||
<token type="KeywordNamespace"/>
|
||||
</rule>
|
||||
<rule pattern="(auto|const|delegate|derive|echo|else|if|implement|macro|test)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="(let)\b">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="(fn)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(type)\b">
|
||||
<token type="Keyword"/>
|
||||
<push state="typename"/>
|
||||
</rule>
|
||||
<rule pattern="(True|False)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="0[bB][01](_?[01])*">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="0[oO][0-7](_?[0-7])*">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="0[xX][\da-fA-F](_?[\dA-Fa-f])*">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="\d(_?\d)*\.\d(_?\d)*([eE][-+]?\d(_?\d)*)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="\d(_?\d)*">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="@([a-z_]\w*[!?]?)">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
<rule pattern="[{}()\[\],]|[#(]|\.\.|<>|<<|>>">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[+\-*/%!=<>&|.]|<-">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern=":|->">
|
||||
<token type="Operator"/>
|
||||
<push state="typename"/>
|
||||
</rule>
|
||||
<rule pattern="([a-z_][A-Za-z0-9_]*)(\()">
|
||||
<bygroups>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="([A-Z][A-Za-z0-9_]*)(\()">
|
||||
<bygroups>
|
||||
<token type="NameClass"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="([a-z_]\w*[!?]?)">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="typename">
|
||||
<rule pattern="\s+">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="[A-Z][A-Za-z0-9_]*">
|
||||
<token type="NameClass"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\["\\fnrt]|\\u\{[\da-fA-F]{1,6}\}">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\"]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
65
lexers/glsl.xml
Normal file
65
lexers/glsl.xml
Normal file
@ -0,0 +1,65 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>GLSL</name>
|
||||
<alias>glsl</alias>
|
||||
<filename>*.vert</filename>
|
||||
<filename>*.frag</filename>
|
||||
<filename>*.geo</filename>
|
||||
<mime_type>text/x-glslsrc</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="^#.*">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="//.*">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\\n)?[*](.|\n)*?[*](\\\n)?/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="\+|-|~|!=?|\*|/|%|<<|>>|<=?|>=?|==?|&&?|\^|\|\|?">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[?:]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\bdefined\b">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[;{}(),\[\]]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[+-]?\d*\.\d+([eE][-+]?\d+)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="[+-]?\d+\.\d*([eE][-+]?\d+)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0[xX][0-9a-fA-F]*">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="0[0-7]*">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="[1-9][0-9]*">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="\b(sampler3DsamplerCube|sampler2DShadow|sampler1DShadow|invariant|sampler1D|sampler2D|attribute|mat3mat4|centroid|continue|varying|uniform|discard|mat4x4|mat3x3|mat2x3|mat4x2|mat3x2|mat2x2|mat2x4|mat3x4|struct|return|mat4x3|bvec4|false|ivec4|ivec3|const|float|inout|ivec2|break|while|bvec3|bvec2|vec3|else|true|void|bool|vec2|vec4|mat2|for|out|int|in|do|if)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\b(sampler2DRectShadow|sampler2DRect|sampler3DRect|namespace|precision|interface|volatile|template|unsigned|external|noinline|mediump|typedef|default|switch|static|extern|inline|sizeof|output|packed|double|public|fvec3|class|union|short|highp|fixed|input|fvec4|hvec2|hvec3|hvec4|dvec2|dvec3|dvec4|fvec2|using|long|this|enum|lowp|cast|goto|half|asm)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="\.">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
289
lexers/gnuplot.xml
Normal file
289
lexers/gnuplot.xml
Normal file
File diff suppressed because one or more lines are too long
114
lexers/go_template.xml
Normal file
114
lexers/go_template.xml
Normal file
@ -0,0 +1,114 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Go Template</name>
|
||||
<alias>go-template</alias>
|
||||
<filename>*.gotmpl</filename>
|
||||
<filename>*.go.tmpl</filename>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="template">
|
||||
<rule pattern="[-]?}}">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(?=}})">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="Operator"/>
|
||||
<push state="subexpression"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="expression"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="subexpression">
|
||||
<rule pattern="\)">
|
||||
<token type="Operator"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="expression"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="expression">
|
||||
<rule pattern="\s+">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="Operator"/>
|
||||
<push state="subexpression"/>
|
||||
</rule>
|
||||
<rule pattern="(range|if|else|while|with|template|end|true|false|nil|and|call|html|index|js|len|not|or|print|printf|println|urlquery|eq|ne|lt|le|gt|ge|block|break|continue|define|slice)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\||:?=|,">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[$]?[^\W\d]\w*">
|
||||
<token type="NameOther"/>
|
||||
</rule>
|
||||
<rule pattern="\$|[$]?\.(?:[^\W\d]\w*)?">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="-?\d+i">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="-?\d+\.\d*([Ee][-+]\d+)?i">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\.\d+([Ee][-+]\d+)?i">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="-?\d+[Ee][-+]\d+i">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="-?\d+(\.\d+[eE][+\-]?\d+|\.\d*|[eE][+\-]?\d+)">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="-?\.\d+([eE][+\-]?\d+)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="-?0[0-7]+">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="-?0[xX][0-9a-fA-F]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="-?0b[01_]+">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="-?(0|[1-9][0-9]*)">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="'(\\['"\\abfnrtv]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|[^\\])'">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="`[^`]*`">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="{{(- )?/\*(.|\n)*?\*/( -)?}}">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="{{[-]?">
|
||||
<token type="CommentPreproc"/>
|
||||
<push state="template"/>
|
||||
</rule>
|
||||
<rule pattern="[^{]+">
|
||||
<token type="Other"/>
|
||||
</rule>
|
||||
<rule pattern="{">
|
||||
<token type="Other"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
88
lexers/graphql.xml
Normal file
88
lexers/graphql.xml
Normal file
@ -0,0 +1,88 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>GraphQL</name>
|
||||
<alias>graphql</alias>
|
||||
<alias>graphqls</alias>
|
||||
<alias>gql</alias>
|
||||
<filename>*.graphql</filename>
|
||||
<filename>*.graphqls</filename>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="(query|mutation|subscription|fragment|scalar|implements|interface|union|enum|input|type)">
|
||||
<token type="KeywordDeclaration"/>
|
||||
<push state="type"/>
|
||||
</rule>
|
||||
<rule pattern="(on|extend|schema|directive|\.\.\.)">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="(QUERY|MUTATION|SUBSCRIPTION|FIELD|FRAGMENT_DEFINITION|FRAGMENT_SPREAD|INLINE_FRAGMENT|SCHEMA|SCALAR|OBJECT|FIELD_DEFINITION|ARGUMENT_DEFINITION|INTERFACE|UNION|ENUM|ENUM_VALUE|INPUT_OBJECT|INPUT_FIELD_DEFINITION)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="[^\W\d]\w*">
|
||||
<token type="NameProperty"/>
|
||||
</rule>
|
||||
<rule pattern="\@\w+">
|
||||
<token type="NameDecorator"/>
|
||||
</rule>
|
||||
<rule pattern=":">
|
||||
<token type="Punctuation"/>
|
||||
<push state="type"/>
|
||||
</rule>
|
||||
<rule pattern="[\(\)\{\}\[\],!\|=]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\$\w+">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="\d+i">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\d+\.\d*([Ee][-+]\d+)?i">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\.\d+([Ee][-+]\d+)?i">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\d+[Ee][-+]\d+i">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\d+(\.\d+[eE][+\-]?\d+|\.\d*|[eE][+\-]?\d+)">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="\.\d+([eE][+\-]?\d+)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="(0|[1-9][0-9]*)">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern=""""[\x00-\x7F]*?"""">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\["\\abfnrtv]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|[^\\])"">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern=""(true|false|null)*"">
|
||||
<token type="Literal"/>
|
||||
</rule>
|
||||
<rule pattern="[\r\n\s]+">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="#[^\r\n]*">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="type">
|
||||
<rule pattern="[^\W\d]\w*">
|
||||
<token type="NameClass"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
90
lexers/groff.xml
Normal file
90
lexers/groff.xml
Normal file
@ -0,0 +1,90 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Groff</name>
|
||||
<alias>groff</alias>
|
||||
<alias>nroff</alias>
|
||||
<alias>man</alias>
|
||||
<filename>*.[1-9]</filename>
|
||||
<filename>*.1p</filename>
|
||||
<filename>*.3pm</filename>
|
||||
<filename>*.man</filename>
|
||||
<mime_type>application/x-troff</mime_type>
|
||||
<mime_type>text/troff</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="request">
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="escapes"/>
|
||||
</rule>
|
||||
<rule pattern=""[^\n"]+"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="\d+">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\S+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="(\.)(\w+)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
<push state="request"/>
|
||||
</rule>
|
||||
<rule pattern="\.">
|
||||
<token type="Punctuation"/>
|
||||
<push state="request"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\\n]+">
|
||||
<token type="Text"/>
|
||||
<push state="textline"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<push state="textline"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="textline">
|
||||
<rule>
|
||||
<include state="escapes"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\\n]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="escapes">
|
||||
<rule pattern="\\"[^\n]*">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="\\[fn]\w">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="\\\(.{2}">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="\\.\[.*\]">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="Text"/>
|
||||
<push state="request"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
135
lexers/groovy.xml
Normal file
135
lexers/groovy.xml
Normal file
@ -0,0 +1,135 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Groovy</name>
|
||||
<alias>groovy</alias>
|
||||
<filename>*.groovy</filename>
|
||||
<filename>*.gradle</filename>
|
||||
<mime_type>text/x-groovy</mime_type>
|
||||
<dot_all>true</dot_all>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="#!(.*?)$">
|
||||
<token type="CommentPreproc"/>
|
||||
<push state="base"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<push state="base"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="base">
|
||||
<rule pattern="^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)([a-zA-Z_]\w*)(\s*)(\()">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[^\S\n]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/\*.*?\*/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="@[a-zA-Z_][\w.]*">
|
||||
<token type="NameDecorator"/>
|
||||
</rule>
|
||||
<rule pattern="(as|assert|break|case|catch|continue|default|do|else|finally|for|if|in|goto|instanceof|new|return|switch|this|throw|try|while|in|as)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(abstract|const|extends|final|implements|native|private|protected|public|static|strictfp|super|synchronized|throws|transient|volatile)\b">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="(def|var|boolean|byte|char|double|float|int|long|short|void)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(package)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(true|false|null)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(class|interface|enum|trait|record)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordDeclaration"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="class"/>
|
||||
</rule>
|
||||
<rule pattern="(import)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="import"/>
|
||||
</rule>
|
||||
<rule pattern="""".*?"""">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="'''.*?'''">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern="'(\\\\|\\'|[^'])*'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\$/((?!/\$).)*/\$">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\\\|\\"|[^/])*/">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="(\.)([a-zA-Z_]\w*)">
|
||||
<bygroups>
|
||||
<token type="Operator"/>
|
||||
<token type="NameAttribute"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_]\w*:">
|
||||
<token type="NameLabel"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_$]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="[~^*!%&\[\](){}<>|+=:;,./?-]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0x[0-9a-fA-F]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9]+L?">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="class">
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="NameClass"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="import">
|
||||
<rule pattern="[\w.]+\*?">
|
||||
<token type="NameNamespace"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
147
lexers/handlebars.xml
Normal file
147
lexers/handlebars.xml
Normal file
@ -0,0 +1,147 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Handlebars</name>
|
||||
<alias>handlebars</alias>
|
||||
<alias>hbs</alias>
|
||||
<filename>*.handlebars</filename>
|
||||
<filename>*.hbs</filename>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="[^{]+">
|
||||
<token type="Other"/>
|
||||
</rule>
|
||||
<rule pattern="\{\{!.*\}\}">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="(\{\{\{)(\s*)">
|
||||
<bygroups>
|
||||
<token type="CommentSpecial"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="tag"/>
|
||||
</rule>
|
||||
<rule pattern="(\{\{)(\s*)">
|
||||
<bygroups>
|
||||
<token type="CommentPreproc"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="tag"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="tag">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\}\}\}">
|
||||
<token type="CommentSpecial"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\}\}">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="([#/]*)(each|if|unless|else|with|log|in(?:line)?)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="#\*inline">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="([#/])([\w-]+)">
|
||||
<bygroups>
|
||||
<token type="NameFunction"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="([\w-]+)(=)">
|
||||
<bygroups>
|
||||
<token type="NameAttribute"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(>)(\s*)(@partial-block)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(#?>)(\s*)([\w-]+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameVariable"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(>)(\s*)(\()">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="dynamic-partial"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="generic"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="dynamic-partial">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\)">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(lookup)(\s+)(\.|this)(\s+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameVariable"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(lookup)(\s+)(\S+)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<usingself state="variable"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[\w-]+">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="generic"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="variable">
|
||||
<rule pattern="[a-zA-Z][\w-]*">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="\.[\w-]+">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="(this\/|\.\/|(\.\.\/)+)[\w-]+">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="generic">
|
||||
<rule>
|
||||
<include state="variable"/>
|
||||
</rule>
|
||||
<rule pattern=":?"(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralStringDouble"/>
|
||||
</rule>
|
||||
<rule pattern=":?'(\\\\|\\'|[^'])*'">
|
||||
<token type="LiteralStringSingle"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
98
lexers/hare.xml
Normal file
98
lexers/hare.xml
Normal file
@ -0,0 +1,98 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Hare</name>
|
||||
<alias>hare</alias>
|
||||
<filename>*.ha</filename>
|
||||
<mime_type>text/x-hare</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="string">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\([\\0abfnrtv"']|x[a-fA-F0-9]{2}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8})">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\"\n]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="[\s\n]+">
|
||||
<token type="TextWhitespace"/>
|
||||
</rule>
|
||||
<rule pattern="@[a-z]+">
|
||||
<token type="NameDecorator"/>
|
||||
</rule>
|
||||
<rule pattern="//.*\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="`[^`]*`">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="'(\\[\\0abfnrtv"']||\\(x[a-fA-F0-9]{2}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8})|[^\\'])'">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="(0|[1-9]\d*)\.\d+([eE][+-]?\d+)?(f32|f64)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="(0|[1-9]\d*)([eE][+-]?\d+)?(f32|f64)">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0x[0-9a-fA-F]+\.[0-9a-fA-F]+([pP][+-]?\d+(f32|f64)?)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0x[0-9a-fA-F]+[pP][+-]?\d+(f32|f64)">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0x[0-9a-fA-F]+(z|[iu](8|16|32|64)?)?">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="0o[0-7]+(z|[iu](8|16|32|64)?)?">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="0b[01]+(z|[iu](8|16|32|64)?)?">
|
||||
<token type="LiteralNumberBin"/>
|
||||
</rule>
|
||||
<rule pattern="(0|[1-9]\d*)([eE][+-]?\d+)?(z|[iu](8|16|32|64)?)?">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="[~!%^&*+=|?:<>/-]|[ai]s\b|\.\.\.">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[()\[\],.{};]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="use\b">
|
||||
<token type="KeywordNamespace"/>
|
||||
</rule>
|
||||
<rule pattern="(_|align|break|const|continue|else|enum|export|for|if|return|static|struct|offset|union|fn|free|assert|abort|alloc|let|len|def|type|match|switch|case|append|delete|insert|defer|yield|vastart|vaarg|vaend)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(size)([\s\n]*)(\()">
|
||||
<bygroups>
|
||||
<token type="Keyword" />
|
||||
<token type="TextWhitespace" />
|
||||
<token type="Punctuation" />
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(str|size|rune|bool|int|uint|uintptr|u8|u16|u32|u64|i8|i16|i32|i64|f32|f64|null|void|done|nullable|valist|opaque|never)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(true|false)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
272
lexers/haskell.xml
Normal file
272
lexers/haskell.xml
Normal file
@ -0,0 +1,272 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Haskell</name>
|
||||
<alias>haskell</alias>
|
||||
<alias>hs</alias>
|
||||
<filename>*.hs</filename>
|
||||
<mime_type>text/x-haskell</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="escape">
|
||||
<rule pattern="[abfnrtv"\'&\\]">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\^[][\p{Lu}@^_]">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="NUL|SOH|[SE]TX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|S[OI]|DLE|DC[1-4]|NAK|SYN|ETB|CAN|EM|SUB|ESC|[FGRU]S|SP|DEL">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="o[0-7]+">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="x[\da-fA-F]+">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\d+">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\s+\\">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="--(?![!#$%&*+./<=>?@^|_~:\\]).*?$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\{-">
|
||||
<token type="CommentMultiline"/>
|
||||
<push state="comment"/>
|
||||
</rule>
|
||||
<rule pattern="\bimport\b">
|
||||
<token type="KeywordReserved"/>
|
||||
<push state="import"/>
|
||||
</rule>
|
||||
<rule pattern="\bmodule\b">
|
||||
<token type="KeywordReserved"/>
|
||||
<push state="module"/>
|
||||
</rule>
|
||||
<rule pattern="\berror\b">
|
||||
<token type="NameException"/>
|
||||
</rule>
|
||||
<rule pattern="\b(case|class|data|default|deriving|do|else|family|if|in|infix[lr]?|instance|let|newtype|of|then|type|where|_)(?!\')\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="'[^\\]'">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="^[_\p{Ll}][\w\']*">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="'?[_\p{Ll}][\w']*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="('')?[\p{Lu}][\w\']*">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(')[\p{Lu}][\w\']*">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(')\[[^\]]*\]">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(')\([^)]*\)">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="\\(?![:!#$%&*+.\\/<=>?@^|~-]+)">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="(<-|::|->|=>|=|'([:!#$%&*+.\\/<=>?@^|~-]+))(?![:!#$%&*+.\\/<=>?@^|~-]+)">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
<rule pattern=":[:!#$%&*+.\\/<=>?@^|~-]*">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="[:!#$%&*+.\\/<=>?@^|~-]+">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\d+[eE][+-]?\d+">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="\d+\.\d+([eE][+-]?\d+)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0[oO][0-7]+">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="0[xX][\da-fA-F]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="LiteralStringChar"/>
|
||||
<push state="character"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="\[\]">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="\(\)">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="[][(),;`{}]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="import">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="\)">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="qualified\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="([\p{Lu}][\w.]*)(\s+)(as)(\s+)([\p{Lu}][\w.]*)">
|
||||
<bygroups>
|
||||
<token type="NameNamespace"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="Name"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="([\p{Lu}][\w.]*)(\s+)(hiding)(\s+)(\()">
|
||||
<bygroups>
|
||||
<token type="NameNamespace"/>
|
||||
<token type="Text"/>
|
||||
<token type="Keyword"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="funclist"/>
|
||||
</rule>
|
||||
<rule pattern="([\p{Lu}][\w.]*)(\s+)(\()">
|
||||
<bygroups>
|
||||
<token type="NameNamespace"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="funclist"/>
|
||||
</rule>
|
||||
<rule pattern="[\w.]+">
|
||||
<token type="NameNamespace"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="module">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="([\p{Lu}][\w.]*)(\s+)(\()">
|
||||
<bygroups>
|
||||
<token type="NameNamespace"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="funclist"/>
|
||||
</rule>
|
||||
<rule pattern="[\p{Lu}][\w.]*">
|
||||
<token type="NameNamespace"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="funclist">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="[\p{Lu}]\w*">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(_[\w\']+|[\p{Ll}][\w\']*)">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="--(?![!#$%&*+./<=>?@^|_~:\\]).*?$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\{-">
|
||||
<token type="CommentMultiline"/>
|
||||
<push state="comment"/>
|
||||
</rule>
|
||||
<rule pattern=",">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[:!#$%&*+.\\/<=>?@^|~-]+">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="Punctuation"/>
|
||||
<push state="funclist" state="funclist"/>
|
||||
</rule>
|
||||
<rule pattern="\)">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="2"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="comment">
|
||||
<rule pattern="[^-{}]+">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="\{-">
|
||||
<token type="CommentMultiline"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="-\}">
|
||||
<token type="CommentMultiline"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[-{}]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="character">
|
||||
<rule pattern="[^\\']'">
|
||||
<token type="LiteralStringChar"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<push state="escape"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="LiteralStringChar"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern="[^\\"]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<push state="escape"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
143
lexers/hcl.xml
Normal file
143
lexers/hcl.xml
Normal file
@ -0,0 +1,143 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>HCL</name>
|
||||
<alias>hcl</alias>
|
||||
<filename>*.hcl</filename>
|
||||
<mime_type>application/x-hcl</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="punctuation">
|
||||
<rule pattern="[\[\](),.]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern="(".*")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringDouble"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="whitespace">
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="string"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="punctuation"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="curly"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="basic"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9]+">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="basic">
|
||||
<rule pattern="\b(false|true)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="\s*/\*">
|
||||
<token type="CommentMultiline"/>
|
||||
<push state="comment"/>
|
||||
</rule>
|
||||
<rule pattern="\s*#.*\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="(.*?)(\s*)(=)">
|
||||
<bygroups>
|
||||
<token type="Name"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\d+">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="\b\w+\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\$\{">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push state="var_builtin"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="curly">
|
||||
<rule pattern="\{">
|
||||
<token type="TextPunctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\}">
|
||||
<token type="TextPunctuation"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="function">
|
||||
<rule pattern="(\s+)(".*")(\s+)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralString"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="punctuation"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="curly"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="var_builtin">
|
||||
<rule pattern="\$\{">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\b(element|concat|lookup|file|join)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\}">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="comment">
|
||||
<rule pattern="[^*/]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="/\*">
|
||||
<token type="CommentMultiline"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\*/">
|
||||
<token type="CommentMultiline"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[*/]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
189
lexers/hexdump.xml
Normal file
189
lexers/hexdump.xml
Normal file
@ -0,0 +1,189 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Hexdump</name>
|
||||
<alias>hexdump</alias>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="offset">
|
||||
<rule pattern="^([0-9A-Ha-h]+)(:)">
|
||||
<bygroups>
|
||||
<token type="NameLabel"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="offset-mode"/>
|
||||
</rule>
|
||||
<rule pattern="^[0-9A-Ha-h]+">
|
||||
<token type="NameLabel"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="offset-mode">
|
||||
<rule pattern="\s">
|
||||
<token type="Text"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9A-Ha-h]+">
|
||||
<token type="NameLabel"/>
|
||||
</rule>
|
||||
<rule pattern=":">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="piped-strings">
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="offset"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9A-Ha-h]{2}">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="(\s{2,3})(\|)(.{1,16})(\|)$">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="LiteralString"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\s">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="^\*">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="bracket-strings">
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="offset"/>
|
||||
</rule>
|
||||
<rule pattern="[0-9A-Ha-h]{2}">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="(\s{2,3})(\>)(.{1,16})(\<)$">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="LiteralString"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\s">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="^\*">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="nonpiped-strings">
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="offset"/>
|
||||
</rule>
|
||||
<rule pattern="([0-9A-Ha-h]{2})(\-)([0-9A-Ha-h]{2})">
|
||||
<bygroups>
|
||||
<token type="LiteralNumberHex"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="LiteralNumberHex"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[0-9A-Ha-h]{2}">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="(\s{19,})(.{1,20}?)$">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralString"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\s{2,3})(.{1,20})$">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralString"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\s">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="^\*">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="offset"/>
|
||||
</rule>
|
||||
<rule pattern="([0-9A-Ha-h]{2})(\-)([0-9A-Ha-h]{2})">
|
||||
<bygroups>
|
||||
<token type="LiteralNumberHex"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="LiteralNumberHex"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[0-9A-Ha-h]{2}">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="(\s{2,3})(\>)(.{16})(\<)$">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="LiteralString"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="bracket-strings"/>
|
||||
</rule>
|
||||
<rule pattern="(\s{2,3})(\|)(.{16})(\|)$">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="LiteralString"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="piped-strings"/>
|
||||
</rule>
|
||||
<rule pattern="(\s{2,3})(\>)(.{1,15})(\<)$">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="LiteralString"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\s{2,3})(\|)(.{1,15})(\|)$">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="LiteralString"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\s{2,3})(.{1,15})$">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralString"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\s{2,3})(.{16}|.{20})$">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralString"/>
|
||||
</bygroups>
|
||||
<push state="nonpiped-strings"/>
|
||||
</rule>
|
||||
<rule pattern="\s">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="^\*">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
149
lexers/hlb.xml
Normal file
149
lexers/hlb.xml
Normal file
@ -0,0 +1,149 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>HLB</name>
|
||||
<alias>hlb</alias>
|
||||
<filename>*.hlb</filename>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="(#.*)">
|
||||
<bygroups>
|
||||
<token type="CommentSingle"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="((\b(0(b|B|o|O|x|X)[a-fA-F0-9]+)\b)|(\b(0|[1-9][0-9]*)\b))">
|
||||
<bygroups>
|
||||
<token type="LiteralNumber"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="((\b(true|false)\b))">
|
||||
<bygroups>
|
||||
<token type="NameBuiltin"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\bstring\b|\bint\b|\bbool\b|\bfs\b|\boption\b)">
|
||||
<bygroups>
|
||||
<token type="KeywordType"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\b[a-zA-Z_][a-zA-Z0-9]*\b)(\()">
|
||||
<bygroups>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="params"/>
|
||||
</rule>
|
||||
<rule pattern="(\{)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="block"/>
|
||||
</rule>
|
||||
<rule pattern="(\n|\r|\r\n)">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern=".">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\"]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="block">
|
||||
<rule pattern="(\})">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(#.*)">
|
||||
<bygroups>
|
||||
<token type="CommentSingle"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="((\b(0(b|B|o|O|x|X)[a-fA-F0-9]+)\b)|(\b(0|[1-9][0-9]*)\b))">
|
||||
<bygroups>
|
||||
<token type="LiteralNumber"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="((\b(true|false)\b))">
|
||||
<bygroups>
|
||||
<token type="KeywordConstant"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="(with)">
|
||||
<bygroups>
|
||||
<token type="KeywordReserved"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(as)([\t ]+)(\b[a-zA-Z_][a-zA-Z0-9]*\b)">
|
||||
<bygroups>
|
||||
<token type="KeywordReserved"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\bstring\b|\bint\b|\bbool\b|\bfs\b|\boption\b)([\t ]+)(\{)">
|
||||
<bygroups>
|
||||
<token type="KeywordType"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="block"/>
|
||||
</rule>
|
||||
<rule pattern="(?!\b(?:scratch|image|resolve|http|checksum|chmod|filename|git|keepGitDir|local|includePatterns|excludePatterns|followPaths|generate|frontendInput|shell|run|readonlyRootfs|env|dir|user|network|security|host|ssh|secret|mount|target|localPath|uid|gid|mode|readonly|tmpfs|sourcePath|cache|mkdir|createParents|chown|createdTime|mkfile|rm|allowNotFound|allowWildcards|copy|followSymlinks|contentsOnly|unpack|createDestPath)\b)(\b[a-zA-Z_][a-zA-Z0-9]*\b)">
|
||||
<bygroups>
|
||||
<token type="NameOther"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\n|\r|\r\n)">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern=".">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="params">
|
||||
<rule pattern="(\))">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="(variadic)">
|
||||
<bygroups>
|
||||
<token type="Keyword"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\bstring\b|\bint\b|\bbool\b|\bfs\b|\boption\b)">
|
||||
<bygroups>
|
||||
<token type="KeywordType"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\b[a-zA-Z_][a-zA-Z0-9]*\b)">
|
||||
<bygroups>
|
||||
<token type="NameOther"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\n|\r|\r\n)">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern=".">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
110
lexers/hlsl.xml
Normal file
110
lexers/hlsl.xml
Normal file
@ -0,0 +1,110 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>HLSL</name>
|
||||
<alias>hlsl</alias>
|
||||
<filename>*.hlsl</filename>
|
||||
<filename>*.hlsli</filename>
|
||||
<filename>*.cginc</filename>
|
||||
<filename>*.fx</filename>
|
||||
<filename>*.fxh</filename>
|
||||
<mime_type>text/x-hlsl</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="^#.*$">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="//.*$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\\n)?[*](.|\n)*?[*](\\\n)?/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="\+|-|~|!=?|\*|/|%|<<|>>|<=?|>=?|==?|&&?|\^|\|\|?">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[?:]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\bdefined\b">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[;{}(),.\[\]]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[+-]?\d*\.\d+([eE][-+]?\d+)?f?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="[+-]?\d+\.\d*([eE][-+]?\d+)?f?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0[xX][0-9a-fA-F]*">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="0[0-7]*">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="[1-9][0-9]*">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="\b(asm|asm_fragment|break|case|cbuffer|centroid|class|column_major|compile|compile_fragment|const|continue|default|discard|do|else|export|extern|for|fxgroup|globallycoherent|groupshared|if|in|inline|inout|interface|line|lineadj|linear|namespace|nointerpolation|noperspective|NULL|out|packoffset|pass|pixelfragment|point|precise|return|register|row_major|sample|sampler|shared|stateblock|stateblock_state|static|struct|switch|tbuffer|technique|technique10|technique11|texture|typedef|triangle|triangleadj|uniform|vertexfragment|volatile|while)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="\b(true|false)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="\b(auto|catch|char|const_cast|delete|dynamic_cast|enum|explicit|friend|goto|long|mutable|new|operator|private|protected|public|reinterpret_cast|short|signed|sizeof|static_cast|template|this|throw|try|typename|union|unsigned|using|virtual)\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="\b(dword|matrix|snorm|string|unorm|unsigned|void|vector|BlendState|Buffer|ByteAddressBuffer|ComputeShader|DepthStencilState|DepthStencilView|DomainShader|GeometryShader|HullShader|InputPatch|LineStream|OutputPatch|PixelShader|PointStream|RasterizerState|RenderTargetView|RasterizerOrderedBuffer|RasterizerOrderedByteAddressBuffer|RasterizerOrderedStructuredBuffer|RasterizerOrderedTexture1D|RasterizerOrderedTexture1DArray|RasterizerOrderedTexture2D|RasterizerOrderedTexture2DArray|RasterizerOrderedTexture3D|RWBuffer|RWByteAddressBuffer|RWStructuredBuffer|RWTexture1D|RWTexture1DArray|RWTexture2D|RWTexture2DArray|RWTexture3D|SamplerState|SamplerComparisonState|StructuredBuffer|Texture1D|Texture1DArray|Texture2D|Texture2DArray|Texture2DMS|Texture2DMSArray|Texture3D|TextureCube|TextureCubeArray|TriangleStream|VertexShader)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="\b(bool|double|float|int|half|min16float|min10float|min16int|min12int|min16uint|uint)([1-4](x[1-4])?)?\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="\b(abort|abs|acos|all|AllMemoryBarrier|AllMemoryBarrierWithGroupSync|any|AppendStructuredBuffer|asdouble|asfloat|asin|asint|asuint|asuint|atan|atan2|ceil|CheckAccessFullyMapped|clamp|clip|CompileShader|ConsumeStructuredBuffer|cos|cosh|countbits|cross|D3DCOLORtoUBYTE4|ddx|ddx_coarse|ddx_fine|ddy|ddy_coarse|ddy_fine|degrees|determinant|DeviceMemoryBarrier|DeviceMemoryBarrierWithGroupSync|distance|dot|dst|errorf|EvaluateAttributeAtCentroid|EvaluateAttributeAtSample|EvaluateAttributeSnapped|exp|exp2|f16tof32|f32tof16|faceforward|firstbithigh|firstbitlow|floor|fma|fmod|frac|frexp|fwidth|GetRenderTargetSampleCount|GetRenderTargetSamplePosition|GlobalOrderedCountIncrement|GroupMemoryBarrier|GroupMemoryBarrierWithGroupSync|InterlockedAdd|InterlockedAnd|InterlockedCompareExchange|InterlockedCompareStore|InterlockedExchange|InterlockedMax|InterlockedMin|InterlockedOr|InterlockedXor|isfinite|isinf|isnan|ldexp|length|lerp|lit|log|log10|log2|mad|max|min|modf|msad4|mul|noise|normalize|pow|printf|Process2DQuadTessFactorsAvg|Process2DQuadTessFactorsMax|Process2DQuadTessFactorsMin|ProcessIsolineTessFactors|ProcessQuadTessFactorsAvg|ProcessQuadTessFactorsMax|ProcessQuadTessFactorsMin|ProcessTriTessFactorsAvg|ProcessTriTessFactorsMax|ProcessTriTessFactorsMin|QuadReadLaneAt|QuadSwapX|QuadSwapY|radians|rcp|reflect|refract|reversebits|round|rsqrt|saturate|sign|sin|sincos|sinh|smoothstep|sqrt|step|tan|tanh|tex1D|tex1D|tex1Dbias|tex1Dgrad|tex1Dlod|tex1Dproj|tex2D|tex2D|tex2Dbias|tex2Dgrad|tex2Dlod|tex2Dproj|tex3D|tex3D|tex3Dbias|tex3Dgrad|tex3Dlod|tex3Dproj|texCUBE|texCUBE|texCUBEbias|texCUBEgrad|texCUBElod|texCUBEproj|transpose|trunc|WaveAllBitAnd|WaveAllMax|WaveAllMin|WaveAllBitOr|WaveAllBitXor|WaveAllEqual|WaveAllProduct|WaveAllSum|WaveAllTrue|WaveAnyTrue|WaveBallot|WaveGetLaneCount|WaveGetLaneIndex|WaveGetOrderedIndex|WaveIsHelperLane|WaveOnce|WavePrefixProduct|WavePrefixSum|WaveReadFirstLane|WaveReadLaneAt)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="\b(SV_ClipDistance|SV_ClipDistance0|SV_ClipDistance1|SV_Culldistance|SV_CullDistance0|SV_CullDistance1|SV_Coverage|SV_Depth|SV_DepthGreaterEqual|SV_DepthLessEqual|SV_DispatchThreadID|SV_DomainLocation|SV_GroupID|SV_GroupIndex|SV_GroupThreadID|SV_GSInstanceID|SV_InnerCoverage|SV_InsideTessFactor|SV_InstanceID|SV_IsFrontFace|SV_OutputControlPointID|SV_Position|SV_PrimitiveID|SV_RenderTargetArrayIndex|SV_SampleIndex|SV_StencilRef|SV_TessFactor|SV_VertexID|SV_ViewportArrayIndex)\b">
|
||||
<token type="NameDecorator"/>
|
||||
</rule>
|
||||
<rule pattern="\bSV_Target[0-7]?\b">
|
||||
<token type="NameDecorator"/>
|
||||
</rule>
|
||||
<rule pattern="\b(allow_uav_condition|branch|call|domain|earlydepthstencil|fastopt|flatten|forcecase|instance|loop|maxtessfactor|numthreads|outputcontrolpoints|outputtopology|partitioning|patchconstantfunc|unroll)\b">
|
||||
<token type="NameDecorator"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="\\$">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\"\n]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
252
lexers/holyc.xml
Normal file
252
lexers/holyc.xml
Normal file
@ -0,0 +1,252 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>HolyC</name>
|
||||
<alias>holyc</alias>
|
||||
<filename>*.HC</filename>
|
||||
<filename>*.hc</filename>
|
||||
<filename>*.HH</filename>
|
||||
<filename>*.hh</filename>
|
||||
<filename>*.hc.z</filename>
|
||||
<filename>*.HC.Z</filename>
|
||||
<mime_type>text/x-chdr</mime_type>
|
||||
<mime_type>text/x-csrc</mime_type>
|
||||
<mime_type>image/x-xbitmap</mime_type>
|
||||
<mime_type>image/x-xpixmap</mime_type>
|
||||
<ensure_nl>true</ensure_nl>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="statement">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="statements"/>
|
||||
</rule>
|
||||
<rule pattern="[{}]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern=";">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="function">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="statements"/>
|
||||
</rule>
|
||||
<rule pattern=";">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\{">
|
||||
<token type="Punctuation"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\}">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern="[^\\"\n]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="macro">
|
||||
<rule pattern="(include)(\s*(?:/[*].*?[*]/\s*)?)([^\n]+)">
|
||||
<bygroups>
|
||||
<token type="CommentPreproc"/>
|
||||
<token type="Text"/>
|
||||
<token type="CommentPreprocFile"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[^/\n]+">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="/[*](.|\n)*?[*]/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="//.*?\n">
|
||||
<token type="CommentSingle"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="/">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=\\)\n">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="if0">
|
||||
<rule pattern="^\s*#if.*?(?<!\\)\n">
|
||||
<token type="CommentPreproc"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="^\s*#el(?:se|if).*\n">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="^\s*#endif.*?(?<!\\)\n">
|
||||
<token type="CommentPreproc"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern=".*?\n">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="whitespace">
|
||||
<rule pattern="^#if\s+0">
|
||||
<token type="CommentPreproc"/>
|
||||
<push state="if0"/>
|
||||
</rule>
|
||||
<rule pattern="^#">
|
||||
<token type="CommentPreproc"/>
|
||||
<push state="macro"/>
|
||||
</rule>
|
||||
<rule pattern="^(\s*(?:/[*].*?[*]/\s*)?)(#if\s+0)">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="CommentPreproc"/>
|
||||
</bygroups>
|
||||
<push state="if0"/>
|
||||
</rule>
|
||||
<rule pattern="^(\s*(?:/[*].*?[*]/\s*)?)(#)">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="CommentPreproc"/>
|
||||
</bygroups>
|
||||
<push state="macro"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\\\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="//(\n|[\w\W]*?[^\\]\n)">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\\n)?[*][\w\W]*?[*](\\\n)?/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\\n)?[*][\w\W]*">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="statements">
|
||||
<rule pattern="(L?)(")">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralString"/>
|
||||
</bygroups>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="(L?)(')(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])(')">
|
||||
<bygroups>
|
||||
<token type="LiteralStringAffix"/>
|
||||
<token type="LiteralStringChar"/>
|
||||
<token type="LiteralStringChar"/>
|
||||
<token type="LiteralStringChar"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="(\d+\.\d*|\.\d+|\d+[fF])[fF]?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0x[0-9a-fA-F]+[LlUu]*">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="0[0-7]+[LlUu]*">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="\d+[LlUu]*">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="\*/">
|
||||
<token type="Error"/>
|
||||
</rule>
|
||||
<rule pattern="[~!%^&*+=|?:<>/-]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[()\[\],.]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(break|case|continue|default|do|else|for|goto|if|return|switch|while|throw|try|catch|extern|MOV|CALL|PUSH|LEAVE|RET|SUB|SHR|ADD|RETF|CMP|JNE|BTS|INT|XOR|JC|JZ|LOOP|POP|TEST|SHL|ADC|SBB|JMP|INC)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(U0|I8|U8|I16|U16|I32|U32|I64|U64|F64|Bool|class|union|DU8|DU16|DU32|DU64|RAX|RCX|RDX|RBX|RSP|RBP|RSI|RDI|EAX|ECX|EDX|EBX|ESP|EBP|ESI|EDI|AX|CX|DX|BX|SP|BP|SI|DI|SS|CS|DS|ES|FS|GS|CH|asm|const|extern|register|restrict|static|volatile|inline|_extern|_import|IMPORT|public)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="__()\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="(NULL|TRUE|FALSE|ON|OFF)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="([a-zA-Z_]\w*)(\s*)(:)(?!:)">
|
||||
<bygroups>
|
||||
<token type="NameLabel"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b[A-Za-z_]\w*(?=\s*\()">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule>
|
||||
<include state="whitespace"/>
|
||||
</rule>
|
||||
<rule pattern="((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;{]*)(\{)">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="NameFunction"/>
|
||||
<usingself state="root"/>
|
||||
<usingself state="root"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="function"/>
|
||||
</rule>
|
||||
<rule pattern="((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;]*)(;)">
|
||||
<bygroups>
|
||||
<usingself state="root"/>
|
||||
<token type="NameFunction"/>
|
||||
<usingself state="root"/>
|
||||
<usingself state="root"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule>
|
||||
<push state="statement"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
159
lexers/html.xml
Normal file
159
lexers/html.xml
Normal file
@ -0,0 +1,159 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>HTML</name>
|
||||
<alias>html</alias>
|
||||
<filename>*.html</filename>
|
||||
<filename>*.htm</filename>
|
||||
<filename>*.xhtml</filename>
|
||||
<filename>*.xslt</filename>
|
||||
<mime_type>text/html</mime_type>
|
||||
<mime_type>application/xhtml+xml</mime_type>
|
||||
<case_insensitive>true</case_insensitive>
|
||||
<dot_all>true</dot_all>
|
||||
<not_multiline>true</not_multiline>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="script-content">
|
||||
<rule pattern="(<)(\s*)(/)(\s*)(script)(\s*)(>)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameTag"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern=".+?(?=<\s*/\s*script\s*>)">
|
||||
<using lexer="Javascript"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="style-content">
|
||||
<rule pattern="(<)(\s*)(/)(\s*)(style)(\s*)(>)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameTag"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern=".+?(?=<\s*/\s*style\s*>)">
|
||||
<using lexer="CSS"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="attr">
|
||||
<rule pattern="".*?"">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="'.*?'">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[^\s>]+">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="[^<&]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="&\S*?;">
|
||||
<token type="NameEntity"/>
|
||||
</rule>
|
||||
<rule pattern="\<\!\[CDATA\[.*?\]\]\>">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="<!--">
|
||||
<token type="Comment"/>
|
||||
<push state="comment"/>
|
||||
</rule>
|
||||
<rule pattern="<\?.*?\?>">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="<![^>]*>">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="(<)(\s*)(script)(\s*)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameTag"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="script-content" state="tag"/>
|
||||
</rule>
|
||||
<rule pattern="(<)(\s*)(style)(\s*)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameTag"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="style-content" state="tag"/>
|
||||
</rule>
|
||||
<rule pattern="(<)(\s*)([\w:.-]+)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameTag"/>
|
||||
</bygroups>
|
||||
<push state="tag"/>
|
||||
</rule>
|
||||
<rule pattern="(<)(\s*)(/)(\s*)([\w:.-]+)(\s*)(>)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="NameTag"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="comment">
|
||||
<rule pattern="[^-]+">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="-->">
|
||||
<token type="Comment"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="-">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="tag">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="([\w:-]+\s*)(=)(\s*)">
|
||||
<bygroups>
|
||||
<token type="NameAttribute"/>
|
||||
<token type="Operator"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="attr"/>
|
||||
</rule>
|
||||
<rule pattern="[\w:-]+">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
<rule pattern="(/?)(\s*)(>)">
|
||||
<bygroups>
|
||||
<token type="Punctuation"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
104
lexers/hy.xml
Normal file
104
lexers/hy.xml
Normal file
@ -0,0 +1,104 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Hy</name>
|
||||
<alias>hylang</alias>
|
||||
<filename>*.hy</filename>
|
||||
<mime_type>text/x-hy</mime_type>
|
||||
<mime_type>application/x-hy</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern=";.*$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="[,\s]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="-?\d+\.\d+">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="-?\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="0[0-7]+j?">
|
||||
<token type="LiteralNumberOct"/>
|
||||
</rule>
|
||||
<rule pattern="0[xX][a-fA-F0-9]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="'(?!#)[\w!$%*+<=>?/.#-]+">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="\\(.|[a-z]+)">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="^(\s*)([rRuU]{,2}"""(?:.|\n)*?""")">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralStringDoc"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="^(\s*)([rRuU]{,2}'''(?:.|\n)*?''')">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralStringDoc"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="::?(?!#)[\w!$%*+<=>?/.#-]+">
|
||||
<token type="LiteralStringSymbol"/>
|
||||
</rule>
|
||||
<rule pattern="~@|[`\'#^~&@]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="py-keywords"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="py-builtins"/>
|
||||
</rule>
|
||||
<rule pattern="(eval-when-compile|eval-and-compile|with-decorator|unquote-splice|quasiquote|list_comp|unquote|foreach|kwapply|import|not-in|unless|is-not|quote|progn|slice|assoc|first|while|when|rest|cond|<<=|->>|for|get|>>=|let|cdr|car|is|->|do|in|\||~|,) ">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(defmacro|defclass|lambda|defun|defn|setv|def|fn) ">
|
||||
<token type="KeywordDeclaration"/>
|
||||
</rule>
|
||||
<rule pattern="(repeatedly|take_while|iterator\?|iterable\?|instance\?|distinct|take_nth|numeric\?|iterate|filter|repeat|remove|even\?|none\?|cycle|zero\?|odd\?|pos\?|neg\?|take|drop|inc|dec|nth) ">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(?<=\()(?!#)[\w!$%*+<=>?/.#-]+">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="(?!#)[\w!$%*+<=>?/.#-]+">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="(\[|\])">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(\{|\})">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="(\(|\))">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="py-keywords">
|
||||
<rule pattern="(yield from|continue|finally|lambda|assert|global|except|return|print|yield|while|break|raise|elif|pass|exec|else|with|try|for|del|as|if)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="py-builtins">
|
||||
<rule pattern="(?<!\.)(staticmethod|classmethod|__import__|isinstance|basestring|issubclass|frozenset|raw_input|bytearray|enumerate|property|callable|reversed|execfile|hasattr|setattr|compile|complex|delattr|unicode|globals|getattr|unichr|reduce|xrange|buffer|intern|filter|locals|divmod|coerce|sorted|reload|object|slice|round|float|super|input|bytes|apply|tuple|range|iter|dict|long|type|hash|vars|next|file|exit|open|repr|eval|bool|list|bin|pow|zip|ord|oct|min|set|any|max|map|all|len|sum|int|dir|hex|chr|abs|cmp|str|id)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="(?<!\.)(self|None|Ellipsis|NotImplemented|False|True|cls)\b">
|
||||
<token type="NameBuiltinPseudo"/>
|
||||
</rule>
|
||||
<rule pattern="(?<!\.)(PendingDeprecationWarning|UnicodeTranslateError|NotImplementedError|UnicodeEncodeError|UnicodeDecodeError|DeprecationWarning|FloatingPointError|UnboundLocalError|KeyboardInterrupt|ZeroDivisionError|EnvironmentError|IndentationError|ArithmeticError|OverflowWarning|ReferenceError|RuntimeWarning|AttributeError|AssertionError|NotImplemented|UnicodeWarning|FutureWarning|BaseException|StopIteration|SyntaxWarning|OverflowError|StandardError|ImportWarning|GeneratorExit|RuntimeError|WindowsError|UnicodeError|LookupError|SyntaxError|SystemError|ImportError|MemoryError|UserWarning|ValueError|IndexError|SystemExit|Exception|TypeError|NameError|EOFError|VMSError|KeyError|TabError|IOError|OSError|Warning)\b">
|
||||
<token type="NameException"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
216
lexers/idris.xml
Normal file
216
lexers/idris.xml
Normal file
@ -0,0 +1,216 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Idris</name>
|
||||
<alias>idris</alias>
|
||||
<alias>idr</alias>
|
||||
<filename>*.idr</filename>
|
||||
<mime_type>text/x-idris</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="escape">
|
||||
<rule pattern="[abfnrtv"\'&\\]">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\^[][A-Z@^_]">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="NUL|SOH|[SE]TX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|S[OI]|DLE|DC[1-4]|NAK|SYN|ETB|CAN|EM|SUB|ESC|[FGRU]S|SP|DEL">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="o[0-7]+">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="x[\da-fA-F]+">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\d+">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\s+\\">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="^(\s*)(%lib|link|flag|include|hide|freeze|access|default|logging|dynamic|name|error_handlers|language)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="KeywordReserved"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\s*)(--(?![!#$%&*+./<=>?@^|_~:\\]).*?)$">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="CommentSingle"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\s*)(\|{3}.*?)$">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="CommentSingle"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(\s*)(\{-)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="CommentMultiline"/>
|
||||
</bygroups>
|
||||
<push state="comment"/>
|
||||
</rule>
|
||||
<rule pattern="^(\s*)([^\s(){}]+)(\s*)(:)(\s*)">
|
||||
<bygroups>
|
||||
<token type="Text"/>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="OperatorWord"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="\b(case|class|data|default|using|do|else|if|in|infix[lr]?|instance|rewrite|auto|namespace|codata|mutual|private|public|abstract|total|partial|let|proof|of|then|static|where|_|with|pattern|term|syntax|prefix|postulate|parameters|record|dsl|impossible|implicit|tactics|intros|intro|compute|refine|exact|trivial)(?!\')\b">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="(import|module)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordReserved"/>
|
||||
<token type="Text"/>
|
||||
</bygroups>
|
||||
<push state="module"/>
|
||||
</rule>
|
||||
<rule pattern="('')?[A-Z][\w\']*">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="[a-z][\w\']*">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="(<-|::|->|=>|=)">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
<rule pattern="([(){}\[\]:!#$%&*+.\\/<=>?@^|~-]+)">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
<rule pattern="\d+[eE][+-]?\d+">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="\d+\.\d+([eE][+-]?\d+)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="0[xX][\da-fA-F]+">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern="\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="LiteralStringChar"/>
|
||||
<push state="character"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="string"/>
|
||||
</rule>
|
||||
<rule pattern="[^\s(){}]+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\s+?">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="module">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="([A-Z][\w.]*)(\s+)(\()">
|
||||
<bygroups>
|
||||
<token type="NameNamespace"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
<push state="funclist"/>
|
||||
</rule>
|
||||
<rule pattern="[A-Z][\w.]*">
|
||||
<token type="NameNamespace"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="funclist">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="[A-Z]\w*">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(_[\w\']+|[a-z][\w\']*)">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="--.*$">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\{-">
|
||||
<token type="CommentMultiline"/>
|
||||
<push state="comment"/>
|
||||
</rule>
|
||||
<rule pattern=",">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="[:!#$%&*+.\\/<=>?@^|~-]+">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="Punctuation"/>
|
||||
<push state="funclist" state="funclist"/>
|
||||
</rule>
|
||||
<rule pattern="\)">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="2"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="comment">
|
||||
<rule pattern="[^-{}]+">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="\{-">
|
||||
<token type="CommentMultiline"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="-\}">
|
||||
<token type="CommentMultiline"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[-{}]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="character">
|
||||
<rule pattern="[^\\']">
|
||||
<token type="LiteralStringChar"/>
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<push state="escape"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="LiteralStringChar"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern="[^\\"]+">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="LiteralStringEscape"/>
|
||||
<push state="escape"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
47
lexers/igor.xml
Normal file
47
lexers/igor.xml
Normal file
File diff suppressed because one or more lines are too long
45
lexers/ini.xml
Normal file
45
lexers/ini.xml
Normal file
@ -0,0 +1,45 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>INI</name>
|
||||
<alias>ini</alias>
|
||||
<alias>cfg</alias>
|
||||
<alias>dosini</alias>
|
||||
<filename>*.ini</filename>
|
||||
<filename>*.cfg</filename>
|
||||
<filename>*.inf</filename>
|
||||
<filename>*.service</filename>
|
||||
<filename>*.socket</filename>
|
||||
<filename>.gitconfig</filename>
|
||||
<filename>.editorconfig</filename>
|
||||
<filename>pylintrc</filename>
|
||||
<filename>.pylintrc</filename>
|
||||
<mime_type>text/x-ini</mime_type>
|
||||
<mime_type>text/inf</mime_type>
|
||||
<priority>0.1</priority> <!-- higher priority than Inform 6 -->
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="[;#].*">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\[.*?\]$">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(.*?)([ \t]*)(=)([ \t]*)(.*(?:\n[ \t].+)*)">
|
||||
<bygroups>
|
||||
<token type="NameAttribute"/>
|
||||
<token type="Text"/>
|
||||
<token type="Operator"/>
|
||||
<token type="Text"/>
|
||||
<token type="LiteralString"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="(.+?)$">
|
||||
<token type="NameAttribute"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
71
lexers/io.xml
Normal file
71
lexers/io.xml
Normal file
@ -0,0 +1,71 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Io</name>
|
||||
<alias>io</alias>
|
||||
<filename>*.io</filename>
|
||||
<mime_type>text/x-iosrc</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="\n">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="//(.*?)\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="#(.*?)\n">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="/(\\\n)?[*](.|\n)*?[*](\\\n)?/">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="/\+">
|
||||
<token type="CommentMultiline"/>
|
||||
<push state="nestedcomment"/>
|
||||
</rule>
|
||||
<rule pattern=""(\\\\|\\"|[^"])*"">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="::=|:=|=|\(|\)|;|,|\*|-|\+|>|<|@|!|/|\||\^|\.|%|&|\[|\]|\{|\}">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="(clone|do|doFile|doString|method|for|if|else|elseif|then)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(nil|false|true)\b">
|
||||
<token type="NameConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(Object|list|List|Map|args|Sequence|Coroutine|File)\b">
|
||||
<token type="NameBuiltin"/>
|
||||
</rule>
|
||||
<rule pattern="[a-zA-Z_]\w*">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="nestedcomment">
|
||||
<rule pattern="[^+/]+">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="/\+">
|
||||
<token type="CommentMultiline"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="\+/">
|
||||
<token type="CommentMultiline"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[+/]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
96
lexers/iscdhcpd.xml
Normal file
96
lexers/iscdhcpd.xml
Normal file
@ -0,0 +1,96 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>ISCdhcpd</name>
|
||||
<alias>iscdhcpd</alias>
|
||||
<filename>dhcpd.conf</filename>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="interpol">
|
||||
<rule pattern="\$[{(]">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push/>
|
||||
</rule>
|
||||
<rule pattern="[})]">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[^${()}]+">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="#.*?\n">
|
||||
<token type="Comment"/>
|
||||
</rule>
|
||||
<rule pattern="(hardware|packet|leased-address|host-decl-name|lease-time|max-lease-time|client-state|config-option|option|filename|next-server|allow|deny|match|ignore)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(include|group|host|subnet|subnet6|netmask|class|subclass|pool|failover|include|shared-network|range|range6|prefix6)\b">
|
||||
<token type="KeywordType"/>
|
||||
</rule>
|
||||
<rule pattern="(on|off|true|false|none)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(if|elsif|else)\b">
|
||||
<token type="Keyword"/>
|
||||
</rule>
|
||||
<rule pattern="(exists|known|static)\b">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="(and|or|not)\b">
|
||||
<token type="OperatorWord"/>
|
||||
</rule>
|
||||
<rule pattern="(==|!=|~=|~~|=)">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[{},;\)]">
|
||||
<token type="Punctuation"/>
|
||||
</rule>
|
||||
<rule pattern="\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2}">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}">
|
||||
<token type="LiteralNumberHex"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<push state="doublequotestring"/>
|
||||
</rule>
|
||||
<rule pattern="([\w\-.]+)(\s*)(\()">
|
||||
<bygroups>
|
||||
<token type="NameFunction"/>
|
||||
<token type="Text"/>
|
||||
<token type="Punctuation"/>
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="[\w\-.]+">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="doublequotestring">
|
||||
<rule pattern="\$[{(]">
|
||||
<token type="LiteralStringInterpol"/>
|
||||
<push state="interpol"/>
|
||||
</rule>
|
||||
<rule pattern="\\.">
|
||||
<token type="LiteralStringEscape"/>
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern=".">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
157
lexers/j.xml
Normal file
157
lexers/j.xml
Normal file
@ -0,0 +1,157 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>J</name>
|
||||
<alias>j</alias>
|
||||
<filename>*.ijs</filename>
|
||||
<mime_type>text/x-j</mime_type>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="singlequote">
|
||||
<rule pattern="[^']">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="''">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="LiteralString"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="root">
|
||||
<rule pattern="#!.*$">
|
||||
<token type="CommentPreproc"/>
|
||||
</rule>
|
||||
<rule pattern="NB\..*">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\n+\s*Note">
|
||||
<token type="CommentMultiline"/>
|
||||
<push state="comment"/>
|
||||
</rule>
|
||||
<rule pattern="\s*Note.*">
|
||||
<token type="CommentSingle"/>
|
||||
</rule>
|
||||
<rule pattern="\s+">
|
||||
<token type="Text"/>
|
||||
</rule>
|
||||
<rule pattern="'">
|
||||
<token type="LiteralString"/>
|
||||
<push state="singlequote"/>
|
||||
</rule>
|
||||
<rule pattern="0\s+:\s*0|noun\s+define\s*$">
|
||||
<token type="NameEntity"/>
|
||||
<push state="nounDefinition"/>
|
||||
</rule>
|
||||
<rule pattern="(([1-4]|13)\s+:\s*0|(adverb|conjunction|dyad|monad|verb)\s+define)\b">
|
||||
<token type="NameFunction"/>
|
||||
<push state="explicitDefinition"/>
|
||||
</rule>
|
||||
<rule pattern="(label_|goto_|for_)\b[a-zA-Z]\w*\.">
|
||||
<token type="NameLabel"/>
|
||||
</rule>
|
||||
<rule pattern="(continue|select|return|assert|catchd|catcht|elseif|whilst|break|catch|fcase|while|throw|else|case|end|try|for|do|if)\.">
|
||||
<token type="NameLabel"/>
|
||||
</rule>
|
||||
<rule pattern="\b[a-zA-Z]\w*">
|
||||
<token type="NameVariable"/>
|
||||
</rule>
|
||||
<rule pattern="(timespacex|fixdotdot|nameclass|namelist|file2url|tmoutput|ucpcount|boxxopen|smoutput|JVERSION|datatype|toupper|tolower|alpha17|alpha27|getargs|evtloop|boxopen|fliprgb|inverse|scriptd|iospath|cutopen|isatty|toCRLF|toHOST|isutf8|getenv|stdout|script|usleep|sminfo|expand|stderr|clear|fetch|every|erase|empty|Debug|EMPTY|split|names|timex|cutLF|stdin|apply|items|table|exit|Note|list|take|leaf|type|bind|drop|rows|each|echo|sign|CRLF|utf8|sort|pick|ARGV|uucp|ucp|DEL|inv|hfd|dfh|def|LF2|EAV|toJ|TAB|nl|FF|LF|bx|nc|CR|on)">
|
||||
<token type="NameFunction"/>
|
||||
</rule>
|
||||
<rule pattern="=[.:]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[-=+*#$%@!~`^&";:.,<>{}\[\]\\|/]">
|
||||
<token type="Operator"/>
|
||||
</rule>
|
||||
<rule pattern="[abCdDeEfHiIjLMoprtT]\.">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="[aDiLpqsStux]\:">
|
||||
<token type="KeywordReserved"/>
|
||||
</rule>
|
||||
<rule pattern="(_[0-9])\:">
|
||||
<token type="KeywordConstant"/>
|
||||
</rule>
|
||||
<rule pattern="\(">
|
||||
<token type="Punctuation"/>
|
||||
<push state="parentheses"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="numbers"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="comment">
|
||||
<rule pattern="[^)]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
<rule pattern="^\)">
|
||||
<token type="CommentMultiline"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[)]">
|
||||
<token type="CommentMultiline"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="explicitDefinition">
|
||||
<rule pattern="\b[nmuvxy]\b">
|
||||
<token type="NameDecorator"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
<rule pattern="[^)]">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
<rule pattern="^\)">
|
||||
<token type="NameLabel"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[)]">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="numbers">
|
||||
<rule pattern="\b_{1,2}\b">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="_?\d+(\.\d+)?(\s*[ejr]\s*)_?\d+(\.?=\d+)?">
|
||||
<token type="LiteralNumber"/>
|
||||
</rule>
|
||||
<rule pattern="_?\d+\.(?=\d+)">
|
||||
<token type="LiteralNumberFloat"/>
|
||||
</rule>
|
||||
<rule pattern="_?\d+x">
|
||||
<token type="LiteralNumberIntegerLong"/>
|
||||
</rule>
|
||||
<rule pattern="_?\d+">
|
||||
<token type="LiteralNumberInteger"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="nounDefinition">
|
||||
<rule pattern="[^)]">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
<rule pattern="^\)">
|
||||
<token type="NameLabel"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule pattern="[)]">
|
||||
<token type="LiteralString"/>
|
||||
</rule>
|
||||
</state>
|
||||
<state name="parentheses">
|
||||
<rule pattern="\)">
|
||||
<token type="Punctuation"/>
|
||||
<pop depth="1"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="explicitDefinition"/>
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="root"/>
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
193
lexers/java.xml
Normal file
193
lexers/java.xml
Normal file
@ -0,0 +1,193 @@
|
||||
<lexer>
|
||||
<config>
|
||||
<name>Java</name>
|
||||
<alias>java</alias>
|
||||
<filename>*.java</filename>
|
||||
<mime_type>text/x-java</mime_type>
|
||||
<dot_all>true</dot_all>
|
||||
</config>
|
||||
<rules>
|
||||
<state name="root">
|
||||
<rule pattern="(^\s*)((?:(?:public|private|protected|static|strictfp)(?:\s+))*)(record)\b">
|
||||
<bygroups>
|
||||
<token type="TextWhitespace" />
|
||||
<usingself state="root" />
|
||||
<token type="KeywordDeclaration" />
|
||||
</bygroups>
|
||||
<push state="class" />
|
||||
</rule>
|
||||
<rule pattern="[^\S\n]+">
|
||||
<token type="TextWhitespace" />
|
||||
</rule>
|
||||
<rule pattern="(//.*?)(\n)">
|
||||
<bygroups>
|
||||
<token type="CommentSingle" />
|
||||
<token type="TextWhitespace" />
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="/\*.*?\*/">
|
||||
<token type="CommentMultiline" />
|
||||
</rule>
|
||||
<rule
|
||||
pattern="(assert|break|case|catch|continue|default|do|else|finally|for|if|goto|instanceof|new|return|switch|this|throw|try|while)\b">
|
||||
<token type="Keyword" />
|
||||
</rule>
|
||||
<rule pattern="((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)((?:[^\W\d]|\$)[\w$]*)(\s*)(\()">
|
||||
<bygroups>
|
||||
<usingself state="root" />
|
||||
<token type="NameFunction" />
|
||||
<token type="TextWhitespace" />
|
||||
<token type="Punctuation" />
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="@[^\W\d][\w.]*">
|
||||
<token type="NameDecorator" />
|
||||
</rule>
|
||||
<rule
|
||||
pattern="(abstract|const|enum|extends|final|implements|native|private|protected|public|sealed|static|strictfp|super|synchronized|throws|transient|volatile|yield)\b">
|
||||
<token type="KeywordDeclaration" />
|
||||
</rule>
|
||||
<rule pattern="(boolean|byte|char|double|float|int|long|short|void)\b">
|
||||
<token type="KeywordType" />
|
||||
</rule>
|
||||
<rule pattern="(package)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace" />
|
||||
<token type="TextWhitespace" />
|
||||
</bygroups>
|
||||
<push state="import" />
|
||||
</rule>
|
||||
<rule pattern="(true|false|null)\b">
|
||||
<token type="KeywordConstant" />
|
||||
</rule>
|
||||
<rule pattern="(class|interface)\b">
|
||||
<token type="KeywordDeclaration" />
|
||||
<push state="class" />
|
||||
</rule>
|
||||
<rule pattern="(var)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordDeclaration" />
|
||||
<token type="TextWhitespace" />
|
||||
</bygroups>
|
||||
<push state="var" />
|
||||
</rule>
|
||||
<rule pattern="(import(?:\s+static)?)(\s+)">
|
||||
<bygroups>
|
||||
<token type="KeywordNamespace" />
|
||||
<token type="TextWhitespace" />
|
||||
</bygroups>
|
||||
<push state="import" />
|
||||
</rule>
|
||||
<rule pattern=""""\n">
|
||||
<token type="LiteralString" />
|
||||
<push state="multiline_string" />
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString" />
|
||||
<push state="string" />
|
||||
</rule>
|
||||
<rule pattern="'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'">
|
||||
<token type="LiteralStringChar" />
|
||||
</rule>
|
||||
<rule pattern="(\.)((?:[^\W\d]|\$)[\w$]*)">
|
||||
<bygroups>
|
||||
<token type="Punctuation" />
|
||||
<token type="NameAttribute" />
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="^(\s*)(default)(:)">
|
||||
<bygroups>
|
||||
<token type="TextWhitespace" />
|
||||
<token type="Keyword" />
|
||||
<token type="Punctuation" />
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="^(\s*)((?:[^\W\d]|\$)[\w$]*)(:)">
|
||||
<bygroups>
|
||||
<token type="TextWhitespace" />
|
||||
<token type="NameLabel" />
|
||||
<token type="Punctuation" />
|
||||
</bygroups>
|
||||
</rule>
|
||||
<rule pattern="([^\W\d]|\$)[\w$]*">
|
||||
<token type="Name" />
|
||||
</rule>
|
||||
<rule
|
||||
pattern="([0-9][0-9_]*\.([0-9][0-9_]*)?|\.[0-9][0-9_]*)([eE][+\-]?[0-9][0-9_]*)?[fFdD]?|[0-9][eE][+\-]?[0-9][0-9_]*[fFdD]?|[0-9]([eE][+\-]?[0-9][0-9_]*)?[fFdD]|0[xX]([0-9a-fA-F][0-9a-fA-F_]*\.?|([0-9a-fA-F][0-9a-fA-F_]*)?\.[0-9a-fA-F][0-9a-fA-F_]*)[pP][+\-]?[0-9][0-9_]*[fFdD]?">
|
||||
<token type="LiteralNumberFloat" />
|
||||
</rule>
|
||||
<rule pattern="0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?">
|
||||
<token type="LiteralNumberHex" />
|
||||
</rule>
|
||||
<rule pattern="0[bB][01][01_]*[lL]?">
|
||||
<token type="LiteralNumberBin" />
|
||||
</rule>
|
||||
<rule pattern="0[0-7_]+[lL]?">
|
||||
<token type="LiteralNumberOct" />
|
||||
</rule>
|
||||
<rule pattern="0|[1-9][0-9_]*[lL]?">
|
||||
<token type="LiteralNumberInteger" />
|
||||
</rule>
|
||||
<rule pattern="[~^*!%&\[\]<>|+=/?-]">
|
||||
<token type="Operator" />
|
||||
</rule>
|
||||
<rule pattern="[{}();:.,]">
|
||||
<token type="Punctuation" />
|
||||
</rule>
|
||||
<rule pattern="\n">
|
||||
<token type="TextWhitespace" />
|
||||
</rule>
|
||||
</state>
|
||||
<state name="class">
|
||||
<rule pattern="\s+">
|
||||
<token type="Text" />
|
||||
</rule>
|
||||
<rule pattern="([^\W\d]|\$)[\w$]*">
|
||||
<token type="NameClass" />
|
||||
<pop depth="1" />
|
||||
</rule>
|
||||
</state>
|
||||
<state name="var">
|
||||
<rule pattern="([^\W\d]|\$)[\w$]*">
|
||||
<token type="Name" />
|
||||
<pop depth="1" />
|
||||
</rule>
|
||||
</state>
|
||||
<state name="import">
|
||||
<rule pattern="[\w.]+\*?">
|
||||
<token type="NameNamespace" />
|
||||
<pop depth="1" />
|
||||
</rule>
|
||||
</state>
|
||||
<state name="multiline_string">
|
||||
<rule pattern=""""">
|
||||
<token type="LiteralString" />
|
||||
<pop depth="1" />
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString" />
|
||||
</rule>
|
||||
<rule>
|
||||
<include state="string" />
|
||||
</rule>
|
||||
</state>
|
||||
<state name="string">
|
||||
<rule pattern="[^\\"]+">
|
||||
<token type="LiteralString" />
|
||||
</rule>
|
||||
<rule pattern="\\\\">
|
||||
<token type="LiteralString" />
|
||||
</rule>
|
||||
<rule pattern="\\"">
|
||||
<token type="LiteralString" />
|
||||
</rule>
|
||||
<rule pattern="\\">
|
||||
<token type="LiteralString" />
|
||||
</rule>
|
||||
<rule pattern=""">
|
||||
<token type="LiteralString" />
|
||||
<pop depth="1" />
|
||||
</rule>
|
||||
</state>
|
||||
</rules>
|
||||
</lexer>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user