neue config Files

This commit is contained in:
Thomas Sindt
2026-06-04 18:11:33 +02:00
parent 03e01ec9ce
commit 0fd4d241a7
230 changed files with 14435 additions and 30 deletions

View File

@@ -0,0 +1,22 @@
Micro's syntax files are licensed under the MIT "Expat" License:
Copyright (c) 2020: Zachary Yedidia, et al.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,128 @@
# PowerShell syntax highlighting file for micro - https://micro-editor.github.io/
# PowerShell syntax taken from: https://github.com/PowerShell/EditorSyntax
filetype: powershell
detect:
filename: "\\.ps(1|m1|d1)$"
rules:
# - comment.block: # Block Comment
# - comment.doc: # Doc Comment
# - comment.line: # Line Comment
# - comment.shebang: # Shebang Line
# - constant: # Constant
# - constant.bool: # Constant (true, false)
# - constant.interpolation:
# - constant.number: # Constant (null)
# - constant.specialChar:
# - constant.string: # String
# - constant.string.char:
# - constant.string.url: # Uri
# - constant.unicode:
# - identifier: # Also used for functions
# - identifier.class: # Also used for functions
# - identifier.macro:
# - identifier.var:
# - preproc: # Preprocessor
# - preproc.DebugIdentifier: # Preprocessor
# - preproc.shebang: # The #! at the beginning of a file that tells the os what script interpreter to use
# - special: # Special (global|local|private|script|using|workflow)
# - statement: # Statements Keywords
# - statement.built_in:
# - statement.declaration: # Declaration Keywords
# - statement.meta: # Meta
# - statement.reserved: # Reserved Keywords
# - symbol
# - symbol.brackets: # {}()[] and sometimes <>
# - symbol.operator: # Operators
# - symbol.tag: # For html tags, among other things
# - type
# - type.collections: # Collections (array, hashtable)
# - type.ctypes: # CTypes (CBool, CChar, etc.)
# - type.keyword: # If you want a special highlight for keywords like 'private'
# - type.storage: # Storage Types (int, uint, string, etc.)
# Class
- identifier.class: "class +[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?"
- identifier.class: "(function)(?:([[:space:]][A-Za-z0-9]+[[:space:]]*))"
# Verbs taken from PwSh 6.0.2
- identifier: "(Add|Approve|Assert|Backup|Block|Build|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy)[-][A-Za-z0-9]+"
- identifier: "(Debug|Deny|Deploy|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|Format|Get|Grant|Group|Hide)[-][A-Za-z0-9]+"
- identifier: "(Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Mount|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push)[-][A-Za-z0-9]+"
- identifier: "(Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke)[-][A-Za-z0-9]+"
- identifier: "(Save|Search|Select|Send|Set|Show|Skip|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Test|Trace)[-][A-Za-z0-9]+"
- identifier: "(Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Write)[-][A-Za-z0-9]+"
- identifier.var: "\\$(?i)((Global|Local|Private|Script|Using|Workflow)[:])?[A-Za-z0-9]*"
# Expression and types
- type: "\\[\\b([A-Za-z]+|[A-Za-z]+[0-9]+)\\b\\]"
# Keywords
- statement: "\\b(alias|as|begin|break|catch|continue|data|default|define|do|dynamicparam)\\b"
- statement: "\\b(else|elseif|end|exit|finally|for|foreach|foreach-object|from|if|in|inlinescript)\\b"
- statement: "\\b(parallel|param|process|return|switch|throw|trap|try|until|using|var|where|where-object|while)\\b"
# Special Keywords
- special: "\\b(break|continue|exit)\\b"
- symbol.brackets: "(\\{|\\})"
- symbol.brackets: "(\\(|\\))"
- symbol.brackets: "(\\[|\\])"
- symbol.operator: "[\\-+/*=<>?:!~%&|]"
- symbol.operator: "[[:space:]][-](ne|eq|gt|ge|lt|le|like|notlike|match|notmatch|contains|notcontains|in|notin|replace|is|isnot)[[:space:]]"
# Constants
- constant.bool: "\\b\\$(true|false|null)\\b"
- constant.number: "\\b([0-9._]+|0x[A-Fa-f0-9_]+|0b[0-1_]+)[FL]?\\b"
# Expression Mode String
- constant.string:
start: "\""
end: "\""
#skip: "\\\\."
rules:
- constant.specialChar: "\\\\([btnfr]|'|\\\"|\\\\)"
- constant.specialChar: "\\\\u[A-Fa-f0-9]{4}"
# Argument Mode String
- constant.string:
start: "'"
end: "'"
#skip: "\\\\."
rules:
- constant.specialChar: "\\\\([btnfr]|'|\\\"|\\\\)"
- constant.specialChar: "\\\\u[A-Fa-f0-9]{4}"
# Line Comment
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME|BUG):?"
# Block Comment
- comment:
start: "<#"
end: "#>"
rules:
- todo: "(TODO|XXX|FIXME|BUG):?"
# Embedded C#
- default:
start: "@\""
end: "\"@"
rules:
- include: "csharp"
# Todo
- todo: "(TODO|XXX|FIXME|BUG):?"

View File

@@ -0,0 +1,63 @@
# Syntax Files
Here are micro's syntax files.
Each yaml file specifies how to detect the filetype based on file extension or header (first line of the line).
In addition, a signature can be provided to help resolving ambiguities when multiple matching filetypes are detected.
Then there are patterns and regions linked to highlight groups which tell micro how to highlight that filetype.
You can read more about how to write syntax files (and colorschemes) in the [colors](../help/colors.md) documentation.
# Legacy '.micro' filetype
Micro used to use the `.micro` filetype for syntax files which is no longer supported. If you have `.micro`
syntax files that you would like to convert to the new filetype, you can use the [`syntax_converter.go`](./syntax_converter.go) program (also located in this directory):
```
$ go run syntax_converter.go c.micro > c.yaml
```
Most of the syntax files here have been converted using that tool.
Note that the tool isn't perfect and though it is unlikely, you may run into some small issues that you will have to fix manually
(about 4 files from this directory had issues after being converted).
# Micro syntax highlighting files
These are the syntax highlighting files for micro. To install them, just
put all the syntax files in `~/.config/micro/syntax`.
They are taken from Nano, specifically from [this repository](https://github.com/scopatz/nanorc).
Micro syntax files are almost identical to Nano's, except for some key differences:
* Micro does not use `icolor`. Instead, for a case insensitive match, use the case insensitive flag (`i`) in the regular expression
* For example, `icolor green ".*"` would become `color green "(?i).*"`
# Using with colorschemes
Not all of these files have been converted to use micro's colorscheme feature. Most of them just hardcode the colors, which can be problematic depending on the colorscheme you use.
Here is a list of the files that have been converted to properly use colorschemes:
* vi
* go
* c
* d
* markdown
* html
* lua
* swift
* rust
* java
* javascript
* pascal
* python
* ruby
* sh
* git
* tex
* solidity
# License
See [LICENSE](LICENSE).

View File

@@ -0,0 +1,43 @@
filetype: ada
detect:
filename: "(\\.ads$|\\.adb$|\\.ada$)"
rules:
# Operators
- symbol.operator: ([.:;,+*|=!?\\%]|<|>|/|-|&)
- symbol.brackets: "[(){}]|\\[|\\]"
# keyword.reserved
- statement.reserved: \b(abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case)\b
- statement.reserved: \b(constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function)\b
- statement.reserved: \b(generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|or|others|out|overriding)\b
- statement.reserved: \b(package|pragma|private|procedure|protected|raise|range|record|rem|renames|return|requeue)\b
- statement.reserved: \b(reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until)\b
- statement.reserved: \b(use|when|while|with|xor)\b
# Constant
- constant.bool: \b(TRUE|FALSE)
- constant.number: ([0-9]+)
# Storage Types
- type.storage: \b(INTEGER|NATURAL|POSITIVE|FLOAT|CHARACTER|STRING)\b
- type.storage: \b(LONG_INTEGER|SHORT_INTEGER|LONG_FLOAT|SHORT_FLOAT)\b
#Character
- constant.string.char: \'.\'
# String
- constant.string:
start: \"
end: \"
skip: \\.
rules:
- constant.specialChar: (\\0|\\\\|\\t|\\n|\\r|\\"|\\')
- constant.interpolation: \\\([[:graph:]]*\)
- constant.unicode: \\u\{[[:xdigit:]]+}
# Line Comment
- comment.line: "--.*"
# Todo
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,59 @@
filetype: apacheconf
detect:
filename: "httpd\\.conf|mime\\.types|vhosts\\.d\\\\*|\\.htaccess"
rules:
- identifier: "(AcceptMutex|AcceptPathInfo|AccessFileName|Action|AddAlt|AddAltByEncoding|AddAltByType|AddCharset|AddDefaultCharset|AddDescription|AddEncoding)"
- identifier: "(AddHandler|AddIcon|AddIconByEncoding|AddIconByType|AddInputFilter|AddLanguage|AddModuleInfo|AddOutputFilter|AddOutputFilterByType|AddType|Alias|AliasMatch)"
- identifier: "(Allow|AllowCONNECT|AllowEncodedSlashes|AllowOverride|Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID)"
- identifier: "(Anonymous_VerifyEmail|AssignUserID|AuthAuthoritative|AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile|AuthDigestAlgorithm)"
- identifier: "(AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize)"
- identifier: "(AuthGroupFile|AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases)"
- identifier: "(AuthLDAPEnabled|AuthLDAPFrontPageHack|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPRemoteUserIsDN|AuthLDAPUrl|AuthName|AuthType|AuthUserFile)"
- identifier: "(BrowserMatch|BrowserMatchNoCase|BS2000Account|BufferedLogs|CacheDefaultExpire|CacheDirLength|CacheDirLevels|CacheDisable|CacheEnable|CacheExpiryCheck)"
- identifier: "(CacheFile|CacheForceCompletion|CacheGcClean|CacheGcDaily|CacheGcInterval|CacheGcMemUsage|CacheGcUnused|CacheIgnoreCacheControl|CacheIgnoreHeaders)"
- identifier: "(CacheIgnoreNoLastMod|CacheLastModifiedFactor|CacheMaxExpire|CacheMaxFileSize|CacheMinFileSize|CacheNegotiatedDocs|CacheRoot|CacheSize|CacheTimeMargin)"
- identifier: "(CGIMapExtension|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckSpelling|ChildPerUserID|ContentDigest|CookieDomain|CookieExpires|CookieLog|CookieName)"
- identifier: "(CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|Dav|DavDepthInfinity|DavLockDB|DavMinTimeout|DefaultIcon|DefaultLanguage|DefaultType)"
- identifier: "(DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateMemLevel|DeflateWindowSize|Deny|Directory|DirectoryIndex|DirectoryMatch|DirectorySlash)"
- identifier: "(DocumentRoot|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|ErrorDocument|ErrorLog|Example|ExpiresActive|ExpiresByType)"
- identifier: "(ExpiresDefault|ExtendedStatus|ExtFilterDefine|ExtFilterOptions|FileETag|Files|FilesMatch|ForceLanguagePriority|ForceType|ForensicLog|Group|Header)"
- identifier: "(HeaderName|HostnameLookups|IdentityCheck|IfDefine|IfModule|IfVersion|ImapBase|ImapDefault|ImapMenu|Include|IndexIgnore|IndexOptions|IndexOrderDefault)"
- identifier: "(ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer|KeepAlive|KeepAliveTimeout)"
- identifier: "(LanguagePriority|LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionTimeout|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPSharedCacheFile|LDAPSharedCacheSize)"
- identifier: "(LDAPTrustedCA|LDAPTrustedCAType|Limit|LimitExcept|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine)"
- identifier: "(LimitXMLRequestBody|Listen|ListenBackLog|LoadFile|LoadModule|Location|LocationMatch|LockFile|LogFormat|LogLevel|MaxClients|MaxKeepAliveRequests)"
- identifier: "(MaxMemFree|MaxRequestsPerChild|MaxRequestsPerThread|MaxSpareServers|MaxSpareThreads|MaxThreads|MaxThreadsPerChild|MCacheMaxObjectCount|MCacheMaxObjectSize)"
- identifier: "(MCacheMaxStreamingBuffer|MCacheMinObjectSize|MCacheRemovalAlgorithm|MCacheSize|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads)"
- identifier: "(MMapFile|ModMimeUsePathInfo|MultiviewsMatch|NameVirtualHost|NoProxy|NumServers|NWSSLTrustedCerts|NWSSLUpgradeable|Options|Order|PassEnv|PidFile)"
- identifier: "(ProtocolEcho|Proxy|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyIOBufferSize|ProxyMatch|ProxyMaxForwards|ProxyPass|ProxyPassReverse)"
- identifier: "(ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxyTimeout|ProxyVia|ReadmeName|Redirect|RedirectMatch)"
- identifier: "(RedirectPermanent|RedirectTemp|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader)"
- identifier: "(Require|RewriteBase|RewriteCond|RewriteEngine|RewriteLock|RewriteLog|RewriteLogLevel|RewriteMap|RewriteOptions|RewriteRule|RLimitCPU|RLimitMEM|RLimitNPROC)"
- identifier: "(Satisfy|ScoreBoardFile|Script|ScriptAlias|ScriptAliasMatch|ScriptInterpreterSource|ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock|SecureListen)"
- identifier: "(SendBufferSize|ServerAdmin|ServerAlias|ServerLimit|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|SetEnv|SetEnvIf|SetEnvIfNoCase|SetHandler)"
- identifier: "(SetInputFilter|SetOutputFilter|SSIEndTag|SSIErrorMsg|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSLCACertificateFile|SSLCACertificatePath)"
- identifier: "(SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLEngine|SSLMutex|SSLOptions)"
- identifier: "(SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCipherSuite)"
- identifier: "(SSLProxyEngine|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRequire)"
- identifier: "(SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLUserName|SSLVerifyClient|SSLVerifyDepth|StartServers|StartThreads|SuexecUserGroup|ThreadLimit)"
- identifier: "(ThreadsPerChild|ThreadStackSize|TimeOut|TraceEnable|TransferLog|TypesConfig|UnsetEnv|UseCanonicalName|User|UserDir|VirtualDocumentRoot)"
- identifier: "(VirtualDocumentRootIP|VirtualHost|VirtualScriptAlias|VirtualScriptAliasIP|Win32DisableAcceptEx|XBitHack)"
- symbol.tag: "<[^>]+>"
- identifier: "</?[A-Za-z]+"
- identifier: "(<|</|>)"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,101 @@
filetype: ino
detect:
filename: "\\.ino$"
rules:
- identifier: "\\b[A-Z_][0-9A-Z_]+\\b"
## Sized (u)int types
- type: "\\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\\b"
## Constants
- constant: "(?i)\\b(HIGH|LOW|INPUT|OUTPUT)\\b"
## Serial Print
- constant: "(?i)\\b(DEC|BIN|HEX|OCT|BYTE)\\b"
## PI Constants
- constant: "(?i)\\b(PI|HALF_PI|TWO_PI)\\b"
## ShiftOut
- constant: "(?i)\\b(LSBFIRST|MSBFIRST)\\b"
## Attach Interrupt
- constant: "(?i)\\b(CHANGE|FALLING|RISING)\\b"
## Analog Reference
- constant: "(?i)\\b(DEFAULT|EXTERNAL|INTERNAL|INTERNAL1V1|INTERNAL2V56)\\b"
## === FUNCTIONS === ##
## Data Types
- type: "\\b(boolean|byte|char|float|int|long|word)\\b"
## Control Structions
- statement: "\\b(case|class|default|do|double|else|false|for|if|new|null|private|protected|public|short|signed|static|String|switch|this|throw|try|true|unsigned|void|while)\\b"
- statement: "\\b(goto|continue|break|return)\\b"
## Math
- identifier: "\\b(abs|acos|asin|atan|atan2|ceil|constrain|cos|degrees|exp|floor|log|map|max|min|radians|random|randomSeed|round|sin|sq|sqrt|tan)\\b"
## Bits & Bytes
- identifier: "\\b(bitRead|bitWrite|bitSet|bitClear|bit|highByte|lowByte)\\b"
## Analog I/O
- identifier: "\\b(analogReference|analogRead|analogWrite)\\b"
## External Interrupts
- identifier: "\\b(attachInterrupt|detachInterrupt)\\b"
## Time
- identifier: "\\b(delay|delayMicroseconds|millis|micros)\\b"
## Digital I/O
- identifier: "\\b(pinMode|digitalWrite|digitalRead)\\b"
## Interrupts
- identifier: "\\b(interrupts|noInterrupts)\\b"
## Advanced I/O
- identifier: "\\b(noTone|pulseIn|shiftIn|shiftOut|tone)\\b"
## Serial
- identifier: "\\b(Serial|Serial1|Serial2|Serial3|begin|end|peek|read|print|println|available|flush)\\b"
## Structure
- identifier: "\\b(setup|loop)\\b"
##
- statement: "^[[:space:]]*#[[:space:]]*(define|include(_next)?|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)"
## GCC builtins
- constant: "(__attribute__[[:space:]]*\\(\\([^)]*\\)\\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__)"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- preproc: "..+"
- constant.specialChar: "\\\\."
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "/\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,51 @@
filetype: asciidoc
detect:
filename: "\\.(asc|asciidoc|adoc)$"
rules:
# main header
- preproc: "^====+$"
# h1
- statement: "^==[[:space:]].*$"
- statement: "^----+$"
# h2
- symbol: "^===[[:space:]].*$"
- symbol: "^~~~~+$"
# h4
- type: "^====[[:space:]].*$"
- type: "^\\^\\^\\^\\^+$"
# h5
- constant: "^=====[[:space:]].*$"
- constant: "^\\+\\+\\+\\++$"
# attributes
- type.keyword: ":.*:"
- identifier.macro: "\\{[a-z0-9]*\\}"
- identifier: "\\\\\\{[a-z0-9]*\\}"
- identifier: "\\+\\+\\+\\{[a-z0-9]*\\}\\+\\+\\+"
# Paragraph Title
- statement: "^\\..*$"
# source
- identifier: "^\\[(source,.+|NOTE|TIP|IMPORTANT|WARNING|CAUTION)\\]"
# Other markup
- constant.string: ".*[[:space:]]\\+$"
- constant.string: "_[^_]+_"
- constant.string: "\\*[^\\*]+\\*"
- constant.string: "\\+[^\\+]+\\+"
- constant.string: "`[^`]+`"
- constant.string: "\\^[^\\^]+\\^"
- constant.string: "~[^~]+~"
- constant.string: "'[^']+'"
- constant: "`{1,2}[^']+'{1,2}"
# bullets
- symbol: "^[[:space:]]*[\\*\\.-]{1,5}[[:space:]]"
# anchors
- "bold default": "\\[\\[.*\\]\\]"
- "bold default": "<<.*>>"

View File

@@ -0,0 +1,123 @@
filetype: asm
detect:
filename: "\\.(S|s|asm)$"
rules:
# This file is made mainly for NASM assembly
## Instructions
# x86
- statement: "\\b(?i)(mov|aaa|aad|aam|aas|adc|add|and|call|cbw|clc|cld|cli|cmc|cmp|cmpsb|cmpsw|cwd|daa|das|dec|div|esc|hlt|idiv|imul|in|inc|int|into|iret|ja|jae|jb|jbe|jc|je|jg|jge|jl|jle|jna|jnae|jnb|jnbe|jnc|jne|jng|jnge|jnl|jnle|jno|jnp|jns|jnz|jo|jp|jpe|jpo|js|jz|jcxz|jmp|lahf|lds|lea|les|lock|lodsb|lodsw|loop|loope|loopne|loopnz|loopz|movsb|movsw|mul|neg|nop|or|pop|popf|push|pushf|rcl|rcr|rep|repe|repne|repnz|repz|ret|retn|retf|rol|ror|sahf|sal|sar|sbb|scasb|scasw|shl|shr|stc|std|sti|stosb|stosw|sub|test|wait|xchg|xlat|xor)(?-i)\\b"
- statement: "\\b(?i)(bound|enter|ins|leave|outs|popa|pusha)(?-i)\\b"
- statement: "\\b(?i)(arpl|clts|lar|lgdt|lidt|lldt|lmsw|loadall|lsl|ltr|sgdt|sidt|sldt|smsw|str|verr|verw)(?-i)\\b"
- statement: "\\b(?i)(bsf|bsr|bt|btc|btr|bts|cdq|cmpsd|cwde|insd|iret|iretd|iretf|jecxz|lfs|lgs|lss|lodsd|loopw|loopew|loopnew|loopnzw|loopzw|loopd|looped|loopned|loopnzd|loopzd|cr|tr|dr|movsd|movsx|movzx|outsd|popad|popfd|pushad|pushfd|scasd|seta|setae|setb|setbe|setc|sete|setg|setge|setl|setle|setna|setnae|setnb|setnbe|setnc|setne|setng|setnge|setnl|setnle|setno|setnp|setns|setnz|seto|setp|setpe|setpo|sets|setz|shdl|shrd|stosd)(?-i)\\b"
- statement: "\\b(?i)(bswap|cmpxcgh|invd|invlpg|wbinvd|xadd)(?-i)\\b"
- statement: "\\b(?i)(cpuid|cmpxchg8b|rdmsr|rdtsc|wrmsr|rsm)(?-i)\\b"
- statement: "\\b(?i)(rdpmc)(?-i)\\b"
- statement: "\\b(?i)(syscall|sysret)(?-i)\\b"
- statement: "\\b(?i)(cmova|cmovae|cmovb|cmovbe|cmovc|cmove|cmovg|cmovge|cmovl|cmovle|cmovna|cmovnae|cmovnb|cmovnbe|cmovnc|cmovne|cmovng|cmovnge|cmovnle|cmovno|cmovpn|cmovns|cmovnz|cmovo|cmovp|cmovpe|cmovpo|cmovs|cmovz|sysenter|sysexit|ud2)(?-i)\\b"
- statement: "\\b(?i)(maskmovq|movntps|movntq|prefetch0|prefetch1|prefetch2|prefetchnta|sfence)(?-i)\\b"
- statement: "\\b(?i)(clflush|lfence|maskmovdqu|mfence|movntdq|movnti|movntpd|pause)(?-i)\\b"
- statement: "\\b(?i)(monitor|mwait)(?-i)\\b"
- statement: "\\b(?i)(cdqe|cqo|cmpsq|cmpxchg16b|iretq|jrcxz|lodsq|movsdx|popfq|pushfq|rdtscp|scasq|stosq|swapgs)(?-i)\\b"
- statement: "\\b(?i)(clgi|invlpga|skinit|stgi|vmload|vmmcall|vmrun|vmsave)(?-i)\\b"
- statement: "\\b(?i)(vmptrdl|vmptrst|vmclear|vmread|vmwrite|vmcall|vmlaunch|vmresume|vmxoff|vmxon)(?-i)\\b"
- statement: "\\b(?i)(lzcnt|popcnt)(?-i)\\b"
- statement: "\\b(?i)(bextr|blcfill|blci|blcic|blcmask|blcs|blsfill|blsic|t1mskc|tzmsk)(?-i)\\b"
# x87
- statement: "\\b(?i)(f2xm1|fabs|fadd|faddp|fbld|fbstp|fchs|fclex|fcom|fcomp|fcompp|fdecstp|fdisi|fdiv|fvidp|fdivr|fdivrp|feni|ffree|fiadd|ficom|ficomp|fidiv|fidivr|fild|fimul|fincstp|finit|fist|fistp|fisub|fisubr|fld|fld1|fldcw|fldenv|fldenvw|fldl2e|fldl2t|fldlg2|fldln2|fldpi|fldz|fmul|fmulp|fnclex|fndisi|fneni|fninit|fnop|fnsave|fnsavenew|fnstcw|fnstenv|fnstenvw|fnstsw|fpatan|fprem|fptan|frndint|frstor|frstorw|fsave|fsavew|fscale|fsqrt|fst|fstcw|fstenv|fstenvw|fstp|fstpsw|fsub|fsubp|fsubr|fsubrp|ftst|fwait|fxam|fxch|fxtract|fyl2x|fyl2xp1)(?-i)\\b"
- statement: "\\b(?i)(fsetpm)(?-i)\\b"
- statement: "\\b(?i)(fcos|fldenvd|fsaved|fstenvd|fprem1|frstord|fsin|fsincos|fstenvd|fucom|fucomp|fucompp)(?-i)\\b"
- statement: "\\b(?i)(fcmovb|fcmovbe|fcmove|fcmove|fcmovnb|fcmovnbe|fcmovne|fcmovnu|fcmovu)(?-i)\\b"
- statement: "\\b(?i)(fcomi|fcomip|fucomi|fucomip)(?-i)\\b"
- statement: "\\b(?i)(fxrstor|fxsave)(?-i)\\b"
- statement: "\\b(?i)(fisttp)(?-i)\\b"
- statement: "\\b(?i)(ffreep)(?-i)\\b"
# SIMD
- statement: "\\b(?i)(emms|movd|movq|packssdw|packsswb|packuswb|paddb|paddw|paddd|paddsb|paddsw|paddusb|paddusw|pand|pandn|por|pxor|pcmpeqb|pcmpeqw|pcmpeqd|pcmpgtb|pcmpgtw|pcmpgtd|pmaddwd|pmulhw|pmullw|psllw|pslld|psllq|psrad|psraw|psrlw|psrld|psrlq|psubb|psubw|psubd|psubsb|psubsw|psubusb|punpckhbw|punpckhwd|punpckhdq|punkcklbw|punpckldq|punpcklwd)(?-i)\\b"
- statement: "\\b(?i)(paveb|paddsiw|pmagw|pdistib|psubsiw|pmwzb|pmulhrw|pmvnzb|pmvlzb|pmvgezb|pmulhriw|pmachriw)(?-i)\\b"
- statement: "\\b(?i)(femms|pavgusb|pf2id|pfacc|pfadd|pfcmpeq|pfcmpge|pfcmpgt|pfmax|pfmin|pfmul|pfrcp|pfrcpit1|pfrcpit2|pfrsqit1|pfrsqrt|pfsub|pfsubr|pi2fd|pmulhrw|prefetch|prefetchw)(?-i)\\b"
- statement: "\\b(?i)(pf2iw|pfnacc|pfpnacc|pi2fw|pswapd)(?-i)\\b"
- statement: "\\b(?i)(pfrsqrtv|pfrcpv)(?-i)\\b"
- statement: "\\b(?i)(addps|addss|cmpps|cmpss|comiss|cvtpi2ps|cvtps2pi|cvtsi2ss|cvtss2si|cvttps2pi|cvttss2si|divps|divss|ldmxcsr|maxps|maxss|minps|minss|movaps|movhlps|movhps|movlhps|movlps|movmskps|movntps|movss|movups|mulps|mulss|rcpps|rcpss|rsqrtps|rsqrtss|shufps|sqrtps|sqrtss|stmxcsr|subps|subss|ucomiss|unpckhps|unpcklps)(?-i)\\b"
- statement: "\\b(?i)(andnps|andps|orps|pavgb|pavgw|pextrw|pinsrw|pmaxsw|pmaxub|pminsw|pminub|pmovmskb|pmulhuw|psadbw|pshufw|xorps)(?-i)\\b"
- statement: "\\b(?i)(movups|movss|movlps|movhlps|movlps|unpcklps|unpckhps|movhps|movlhps|prefetchnta|prefetch0|prefetch1|prefetch2|nop|movaps|cvtpi2ps|cvtsi2ss|cvtps2pi|cvttss2si|cvtps2pi|cvtss2si|ucomiss|comiss|sqrtps|sqrtss|rsqrtps|rsqrtss|rcpps|andps|orps|xorps|addps|addss|mulps|mulss|subps|subss|minps|minss|divps|divss|maxps|maxss|pshufw|ldmxcsr|stmxcsr|sfence|cmpps|cmpss|pinsrw|pextrw|shufps|pmovmskb|pminub|pmaxub|pavgb|pavgw|pmulhuw|movntq|pminsw|pmaxsw|psadbw|maskmovq)(?-i)\\b"
- statement: "\\b(?i)(addpd|addsd|addnpd|cmppd|cmpsd)(?-i)\\b"
- statement: "\\b(?i)(addpd|addsd|andnpd|andpd|cmppd|cmpsd|comisd|cvtdq2pd|cvtdq2ps|cvtpd2dq|cvtpd2pi|cvtpd2ps|cvtpi2pd|cvtps2dq|cvtps2pd|cvtsd2si|cvtsd2ss|cvtsi2sd|cvtss2sd|cvttpd2dq|cvttpd2pi|cvttps2dq|cvttsd2si|divpd|divsd|maxpd|maxsd|minpd|minsd|movapd|movhpd|movlpd|movmskpd|movsd|movupd|mulpd|mulsd|orpd|shufpd|sqrtpd|sqrtsd|subpd|subsd|ucomisd|unpckhpd|unpcklpd|xorpd)(?-i)\\b"
- statement: "\\b(?i)(movdq2q|movdqa|movdqu|movq2dq|paddq|psubq|pmuludq|pshufhw|pshuflw|pshufd|pslldq|psrldq|punpckhqdq|punpcklqdq)(?-i)\\b"
- statement: "\\b(?i)(addsubpd|addsubps|haddpd|haddps|hsubpd|hsubps|movddup|movshdup|movsldu)(?-i)\\b"
- statement: "\\b(?i)(lddqu)(?-i)\\b"
- statement: "\\b(?i)(psignw|psignd|psignb|pshufb|pmulhrsw|pmaddubsw|phsubw|phsubsw|phsubd|phaddw|phaddsw|phaddd|palignr|pabsw|pabsd|pabsb)(?-i)\\b"
- statement: "\\b(?i)(dpps|dppd|blendps|blendpd|blendvps|blendvpd|roundps|roundss|roundpd|roundsd|insertps|extractps)(?-i)\\b"
- statement: "\\b(?i)(mpsadbw|phminposuw|pmulld|pmuldq|pblendvb|pblendw|pminsb|pmaxsb|pminuw|pmaxuw|pminud|pmaxud|pminsd|pmaxsd|pinsrb|pinsrd/pinsrq|pextrb|pextrw|pextrd/pextrq|pmovsxbw|pmovzxbw|pmovsxbd|pmovzxbd|pmovsxbq|pmovzxbq|pmovsxwd|pmovzxwd|pmovsxwq|pmovzxwq|pmovsxdq|pmovzxdq|ptest|pcmpeqq|packusdw|movntdqa)(?-i)\\b"
- statement: "\\b(?i)(extrq|insertq|movntsd|movntss)(?-i)\\b"
- statement: "\\b(?i)(crc32|pcmpestri|pcmpestrm|pcmpistri|pcmpistrm|pcmpgtq)(?-i)\\b"
- statement: "\\b(?i)(vfmaddpd|vfmaddps|vfmaddsd|vfmaddss|vfmaddsubpd|vfmaddsubps|vfmsubaddpd|vfmsubaddps|vfmsubpd|vfmsubps|vfmsubsd|vfmsubss|vfnmaddpd|vfnmaddps|vfnmaddsd|vfnmaddss|vfnmsubps|vfnmsubsd|vfnmsubss)(?-i)\\b"
# Crypto
- statement: "\\b(?i)(aesenc|aesenclast|aesdec|aesdeclast|aeskeygenassist|aesimc)(?-i)\\b"
- statement: "\\b(?i)(sha1rnds4|sha1nexte|sha1msg1|sha1msg2|sha256rnds2|sha256msg1|sha256msg2)(?-i)\\b"
# Undocumented
- statement: "\\b(?i)(aam|aad|salc|icebp|loadall|loadalld|ud1)(?-i)\\b"
## Registers
- identifier: "\\b(?i)(al|ah|bl|bh|cl|ch|dl|dh|bpl|sil|r8b|r9b|r10b|r11b|dil|spl|r12b|r13b|r14b|r15)(?-i)\\b"
- identifier: "\\b(?i)(cw|sw|tw|fp_ds|fp_opc|fp_ip|fp_dp|fp_cs|cs|ss|ds|es|fs|gs|gdtr|idtr|tr|ldtr|ax|bx|cx|dx|bp|si|r8w|r9w|r10w|r11w|di|sp|r12w|r13w|r14w|r15w|ip)(?-i)\\b"
- identifier: "\\b(?i)(fp_dp|fp_ip|eax|ebx|ecx|edx|ebp|esi|r8d|r9d|r10d|r11d|edi|esp|r12d|r13d|r14d|r15d|eip|eflags|mxcsr)(?-i)\\b"
- identifier: "\\b(?i)(mm0|mm1|mm2|mm3|mm4|mm5|mm6|mm7|rax|rbx|rcx|rdx|rbp|rsi|r8|r9|r10|r11|rdi|rsp|r12|r13|r14|r15|rip|rflags|cr0|cr1|cr2|cr3|cr4|cr5|cr6|cr7|cr8|cr9|cr10|cr11|cr12|cr13|cr14|cr15|msw|dr0|dr1|dr2|dr3|r4|dr5|dr6|dr7|dr8|dr9|dr10|dr11|dr12|dr13|dr14|dr15)(?-i)\\b"
- identifier: "\\b(?i)(st0|st1|st2|st3|st4|st5|st6|st7)(?-i)\\b"
- identifier: "\\b(?i)(xmm0|xmm1|xmm2|xmm3|xmm4|xmm5|xmm6|xmm7|xmm8|xmm9|xmm10|xmm11|xmm12|xmm13|xmm14|xmm15)(?-i)\\b"
- identifier: "\\b(?i)(ymm0|ymm1|ymm2|ymm3|ymm4|ymm5|ymm6|ymm7|ymm8|ymm9|ymm10|ymm11|ymm12|ymm13|ymm14|ymm15)(?-i)\\b"
- identifier: "\\b(?i)(zmm0|zmm1|zmm2|zmm3|zmm4|zmm5|zmm6|zmm7|zmm8|zmm9|zmm10|zmm11|zmm12|zmm13|zmm14|zmm15|zmm16|zmm17|zmm18|zmm19|zmm20|zmm21|zmm22|zmm23|zmm24|zmm25|zmm26|zmm27|zmm28|zmm29|zmm30|zmm31)(?-i)\\b"
## Constants
# Number - it works
- constant.number: "\\b(|h|A|0x)+[0-9]+(|h|A)+\\b"
- constant.number: "\\b0x[0-9 a-f A-F]+\\b"
## Preprocessor (NASM)
- preproc: "%+(\\+|\\?|\\?\\?|)[a-z A-Z 0-9]+"
- preproc: "%\\[[. a-z A-Z 0-9]*\\]"
## Other
- statement: "\\b(?i)(extern|global|section|segment|_start|\\.text|\\.data|\\.bss)(?-i)\\b"
- statement: "\\b(?i)(db|dw|dd|dq|dt|ddq|do)(?-i)\\b"
- identifier: "[a-z A-Z 0-9 _]+:"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: ";"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
## C-like comments (supported by some assemblers)
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "/\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,99 @@
filetype: ATS
detect:
filename: "\\.(d|h|s)ats$"
rules:
- default: \b[[:alnum:]]+[^0-9A-Za-z]
# Operators
- symbol.operator: "[.:;+`|~<>?='\\&]|/|%|-|,|!|\\*|@|\\#"
- symbol.operator: \^
# Types, abstract types and some predefined sorts
- type: \b(addr|age?z|bool|char|cls|schar|uchar|double|ldouble|eff|exn|float|int(ptr)?|lincloptr|uint)\b
- type: \b(lint|ulint|llint|ullint|nat|ptr|real|ref|size_t|ssize_t|sint|usint|string|tkind|viewt|v?t0p|vt|void)\b
- type: \b(prop|t[@0]ype|type|viewt[@0]ype|viewtype|vt[@0]ype|vtype|view)\b
- type: \b(prop[+-]|t[@0]ype[+-]|type[+-]|viewt[@0]ype[+-]|viewtype[+-]|vt[@0]ype[+-]|vtype[+-]|view[+-])
# Statements
- statement: \b(abstype|abst|absprop|absviewt|absvt(ype)?|absview|and|andalso|as|(re)?assume|begin|(pr)?case|s?case)\b
- statement: \b(classdec|dataprop|data(v|view)?type|dataview|datasort|do|dynload|else|end|exception|extype|extva(r|l)|s?if)\b
- statement: \b(ifcase|import|for|in|infix(l|r)?|let|local|macrodef|macdef|not|of|op|or|orelse|overload|(pre|post|non)fix)\b
- statement: \b(propdef|rec|sortdef|stacst|stadef|staload|stavar|sta(tic)?|symelim|symintr|tkindef|then|try|viewdef|v?typedef)\b
- statement: \b(viewtypedef|(pr)?va(l|r)|when|where|while|with|withtype|withprop|withv(iew)?type|withview)\b
- statement: \b(abst[@0]ype|absviewt[@0]?ype|absvt[@0]ype|abstbox|abstflat|absvtbox|absvtflat|absimpl|absreimpl|abs)\b
- statement: \b(case[+-]|(pr)?va(l|r)[+-]|for\*|while\*)
# Numbers
- constant.number: \b[0-9.]+([eE][+-]?[0-9]+)?[fFlL]?\b
- constant.number: \b0[xX][0-9A-Fa-f]*(\.[0-9A-Fa-f]*)?[pP][+-]?[0-9]+[fFlL]?\b
- constant.number: \b([0-9]+|0[xX][0-9A-Fa-f]+)[lLuU]*\b
# Function-related keywords, special functions and namespaces. Not really identifiers
- identifier: \b(fix|(pr)?fu?n|fnx|castfn|praxi|extern|lam|llam|(pr)?implement|(pr)?implmnt)\b
- identifier: \b(fix@|fold@|free@|lam@|llam@|addr@|view@|ref@|fn\*)
- identifier: \$\w*\b
# Other keywords, function effects...
- special: (\$(arrpsz|arrptrsize|break|continue|d2ctype|delay|effmask_(ntm|exn|ref|wrt|all)))\b
- special: (\$(effmask|extern|extype_struct|extype|extkind|extval|extfcall|extmcall|ldelay|literal))\b
- special: (\$(li?st_vt|li?st_t|li?st|myfilename|myfunction|mylocation|raise|rec(ord)?_vt))\b
- special: (\$(rec(ord)?_t|rec(ord)?|showtype|solver_assert|solver_verify|tempenver))\b
- special: (\$(tup(le)?_vt|tup(le)?_t|tup(le)?|tyrep|vararg|vcopyenv_vt|vcopyenv_v))\b
- special: \!(wrt|exnref|exnwrt|exn|refwrt|ref|all|ntm|laz)\b
- special: \b(fun(0|1)|(lin)?cloptr(0|1)?|cloref(0|1)?|clo(0|1)?|lin|prf)\b
- special: \b(f?print(ln)?!|prerr(ln)?!|tupz!)
# Some C macros and other ATS macros
- preproc: ^[[:space:]]*#[[:space:]]*(define|pragma|include|(un|ifn?)def|endif|el(if|se)|if|warning|error|assert)\b
- preproc: ^[[:space:]]*#[[:space:]]*(codegen2|codegen3|elifdef|elifndef|prerr|print|require|then|staload|dynload)\b
# Boolean values
- constant.bool: \b(true|false|null)\b
# The "%{ ... %}" block inserts foreign code into ATS at compile-time
# Code inside of it is generally C or JavaScript
- default:
start: "%{[#^$]?"
end: "%}"
skip: "\\."
limit-group: symbol.operator
rules:
- include: "c"
- include: "javascript"
# Strings and chars
- constant.string: \"[^"]*\"
- constant.string: \'[^']*\'
# Comments
# "////" comments everything until it reaches EOF
- comment.block:
start: ////
end: $a
rules:
- todo: (TODO|XXX|FIXME)
- comment.line:
start: //
end: $
rules:
- todo: (TODO|XXX|FIXME)
# ML-like block comment
- comment.block:
start: \(\*
end: \*\)
rules:
- todo: (TODO|XXX|FIXME)
# C-like block comment
- comment.block:
start: /\*
end: \*\/
rules:
- todo: (TODO|XXX|FIXME)

View File

@@ -0,0 +1,44 @@
filetype: awk
detect:
filename: "\\.awk$"
header: "^#!.*bin/(env +)?awk( |$)"
rules:
- preproc: "\\$[A-Za-z0-9_!@#$*?\\-]+"
- preproc: "\\b(ARGC|ARGIND|ARGV|BINMODE|CONVFMT|ENVIRON|ERRNO|FIELDWIDTHS)\\b"
- preproc: "\\b(FILENAME|FNR|FS|IGNORECASE|LINT|NF|NR|OFMT|OFS|ORS)\\b"
- preproc: "\\b(PROCINFO|RS|RT|RSTART|RLENGTH|SUBSEP|TEXTDOMAIN)\\b"
- identifier.class: "\\b(function|extension|BEGIN|END)\\b"
- symbol.operator: "[\\-+*/%^|!=&<>?;:]|\\\\|\\[|\\]"
- statement: "\\b(for|if|while|do|else|in|delete|exit)\\b"
- special: "\\b(break|continue|return)\\b"
- statement: "\\b(close|getline|next|nextfile|print|printf|system|fflush)\\b"
- statement: "\\b(atan2|cos|exp|int|log|rand|sin|sqrt|srand)\\b"
- statement: "\\b(asort|asorti|gensub|gsub|index|length|match)\\b"
- statement: "\\b(split|sprintf|strtonum|sub|substr|tolower|toupper)\\b"
- statement: "\\b(mktime|strftime|systime)\\b"
- statement: "\\b(and|compl|lshift|or|rshift|xor)\\b"
- statement: "\\b(bindtextdomain|dcgettext|dcngettext)\\b"
- special: "/.*[^\\\\]/"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,87 @@
filetype: B
detect:
filename: '\.b$'
# core control words + storage classes (Thompson B-ish)
signature: '\b(if|else|while|switch|case|default|break|return|goto|extrn|auto)\b'
rules:
# -------------------------
# Comments (B: /* ... */)
# -------------------------
- comment:
start: '/\*'
end: '\*/'
rules: []
# Optional: // line comments (convenient, not “original” B)
- comment:
start: '//'
end: '$'
rules: []
# -------------------------
# Strings + escapes
# -------------------------
- constant.string:
start: '"'
end: '"'
skip: '\\\\.'
rules:
# common escapes: \n \t \e \r \0 \" \\ \( \) \*
- constant.specialChar: '\\\\([0netr"\\\\\\*\\(\\)])'
# printf-ish: %s %c %d %o and %%
- constant.specialChar: '%(%|[scdo])'
- constant.string:
start: "'"
end: "'"
skip: '\\\\.'
rules:
- constant.specialChar: '\\\\([0netr"\\\\\\*\\(\\)])'
- constant.specialChar: '%(%|[scdo])'
# -------------------------
# Numbers
# (leading 0 commonly used for octal constants)
# -------------------------
- constant.number: '\b0[0-7]+\b'
- constant.number: '\b[0-9]+\b'
# -------------------------
# Keywords / storage (keep tight + old-school)
# -------------------------
- statement: '\b(if|else|while|switch|case|default|break|return|goto)\b'
- type: '\b(extrn|auto)\b'
# -------------------------
# Common B library calls (/etc/libb.a era list)
# -------------------------
- constant.builtin: '\b(char|getchr|putchr|exit|printf|seek|setuid|stat|time|unlink|wait|lchar|chdir|chmod|chown|close|creat|execl|execv|fork|fstat|getuid|intr|link|makdir|open|read|write|ctime)\b'
# -------------------------
# Labels and function-ish identifiers
# -------------------------
# label (often at bol)
- identifier: '^\s*[_A-Za-z][_A-Za-z0-9]*\s*:'
# function call/def name before '('
- identifier: '\b[_A-Za-z][_A-Za-z0-9]*\s*\('
# -------------------------
# Operators (order matters: longer first)
# Thompson-ish assignment operators in B are =+, =-, =*, =/, =%, =<<, =>>, =& , =|
# -------------------------
- symbol.operator: '(=<<|=>>|=\+|=-|=\*|=/|=%|=&|=\|)'
- symbol.operator: '(==|!=|<=|>=|<<|>>)'
- symbol.operator: '(\+\+|--|\*\*)'
- symbol.operator: '[-+*/%&|^~!=<>?:=]'
# -------------------------
# Brackets
# -------------------------
- symbol.brackets: '[(){}\[\]]'
# -------------------------
# Identifiers / variables (last so keywords win)
# -------------------------
- identifier: '\b[_A-Za-z][_A-Za-z0-9]*\b'

View File

@@ -0,0 +1,57 @@
filetype: batch
detect:
filename: "(\\.bat$|\\.cmd$)"
rules:
# Numbers
- constant.number: "\\b[0-9]+\\b"
# Brackets and symbols
- special: "(\\{|\\}|\\(|\\)|\\;|\\]|\\[|`|\\\\|\\$|<|>|!|=|&|\\|)"
# Conditionals and control flow
# note (?i) means case insensitive match
- type: "\\b(?i)(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|then|until|while)\\b"
- type: "\\b(?i)(equ|neq|lss|leq|gtr|geq|on|off)\\b"
- type: "\\b(?i)(goto|for|in|do|call|exit|not|exist|errorlevel|defined)\\b"
- type: "\\b(?i)(prn|nul|lpt3|lpt2|lpt1|con|com4|com3|com2|com1|aux)\\b"
# keywords
- statement: "\\b(?i)(adprep|append|arp|assoc|at|atmadm|attrib|auditpol|autochk|autoconv|autofmt|bcdboot|bcdedit|bdehdcfg|bitsadmin|bootcfg|break|brea)\\b"
- statement: "\\b(?i)(cacls|cd|certreq|certutil|chcp|change|choice|cipher|chdir|chkdsk|chkntfs|chglogon|chgport|chgusr|clip|cls|clscluadmin|cluster|cmd|cmdkey|cmstp|color)\\b"
- statement: "\\b(?i)(comp|compact|convert|copy|cprofile|cscript|csvde|date|dcdiag|dcgpofix|dcpromo|defra|del|dfscmd|dfsdiag|dfsrmig|diantz|dir|dirquota|diskcomp|diskcopy|diskpart|diskperf|diskraid|diskshadow|dispdiag|doin|dnscmd|doskey|driverquery|dsacls|dsadd|dsamain|dsdbutil|dsget|dsmgmt|dsmod|dsmove|dsquery|dsrm)\\b"
- statement: "\\b(?i)(echo|edit|endlocal|erase|esentutl|eventcreate|eventquery|eventtriggers|evntcmd|expand|extract)\\b"
- statement: "\\b(?i)(fc|filescrn|find|findstr|finger|flattemp|fonde|forfiles|format|freedisk|fs|fsutil|ftp|ftype|fveupdate|getmac|gettype|gpfixup|gpresult|gpupdate|graftabl)\\b"
- statement: "\\b(?i)(hashgen|hep|help|helpctr|hostname|icacls|iisreset|inuse|ipconfig|ipxroute|irftp|ismserv|jetpack|keyb|klist|ksetup|ktmutil|ktpass|label|ldifd|ldp|lodctr|logman|logoff|lpq|lpr|macfile)\\b"
- statement: "\\b(?i)(makecab|manage-bde|mapadmin|md|mkdir|mklink|mmc|mode|more|mount|mountvol|move|mqbup|mqsvc|mqtgsvc|msdt|msg|msiexec|msinfo32|mstsc|nbtstat|net computer|net group)\\b"
- statement: "\\b(?i)(net localgroup|net print|net session|net share|net start|net stop|net use|net user|net view|net|netcfg|netdiag|netdom|netsh|netstat|nfsadmin|nfsshare|nfsstat|nlb)\\b"
- statement: "\\b(?i)(nlbmgr|nltest|nslookup|ntackup|ntcmdprompt|ntdsutil|ntfrsutl|openfiles|pagefileconfig|path|pathping|pause|pbadmin|pentnt|perfmon|ping|pnpunatten|pnputil|popd)\\b"
- statement: "\\b(?i)(powercfg|powershell|powershell_ise|print|prncnfg|prndrvr|prnjobs|prnmngr|prnport|prnqctl|prompt|pubprn|pushd|pushprinterconnections|pwlauncher|qappsrv|qprocess)\\b"
- statement: "\\b(?i)(query|quser|qwinsta|rasdial|rcp|rd|rdpsign|regentc|recover|redircmp|redirusr|reg|regini|regsvr32|relog|ren|rename|rendom|repadmin|repair-bde|replace|reset|restore)\\b"
- statement: "\\b(?i)(rxec|risetup|rmdir|robocopy|route|rpcinfo|rpcping|rsh|runas|rundll32|rwinsta|scp|sc|setlocal|session|schtasks|scwcmd|secedit|serverceipoptin|servrmanagercmd|serverweroptin|set|setspn)\\b"
- statement: "\\b(?i)(setx|sfc|shadow|shift|showmount|shutdown|sort|ssh|start|storrept|subst|sxstrace|ysocmgr|systeminfo|takeown|tapicfg|taskkill|tasklist|tcmsetup|telnet|tftp|time)\\b"
- statement: "\\b(?i)(timeout|title|tlntadmn|tpmvscmgr|tpmvscmgr|tacerpt|tracert|tree|tscon|tsdiscon|tsecimp|tskill|tsprof|type|typeperf|tzutil|uddiconfig|umount|unlodctr|ver|verify)\\b"
- statement: "\\b(?i)(verifier|verif|vol|vssadmin|w32tm|waitfor|wbadmin|wdsutil|wecutil|wevtutil|where|whoami|winnt|winnt32|winpop|winrm|winrs|winsat|wlbs|mic|wscript|xcopy)\\b"
# / Flags
- constant: "(/\\w+)"
# Variables
- special: "(%%\\w+)"
- special: "(%\\w+%)"
# Conditional flags
- type: "--[a-z-]+"
- type: "\\ -[a-z]+"
- identifier: "\\$\\{?[0-9A-Z_!@#$*?-]+\\}?"
- identifier: "\\$\\{?[0-9A-Z_!@#$*?-]+\\}?"
# "" String
- constant.string:
start: \"
end: \"
skip: \.
rules:
- constant.specialChar: (\\0|\\\\|\\t|\\n|\\r|\\"|\\')
- constant.unicode: \\u\{[[:xdigit:]]+}
# '' string
- constant.string: "(\\'.+\\')"
# rem as comment
- comment.rem: "(?i)(rem\\s.*)"
# :: as comment
- comment.rem: "(?i)(\\:\\:\\s.*)"

View File

@@ -0,0 +1,60 @@
filetype: c
detect:
filename: "(\\.(c|C)$|\\.(h|H)$|\\.ii?$|\\.(def)$)"
rules:
- identifier: "\\b[A-Z_][0-9A-Z_]+\\b"
- type: "\\b(_Atomic|_BitInt|float|double|_Decimal32|_Decimal64|_Decimal128|_Complex|complex|_Imaginary|imaginary|_Bool|bool|char|int|short|long|enum|void|struct|union|typedef|typeof|typeof_unqual|(un)?signed|inline|_Noreturn)\\b"
- type: "\\b((s?size)|((u_?)?int(8|16|32|64|ptr))|char(8|16|32)|wchar)_t\\b"
# GCC float/decimal/fixed types
- type: "\\b(_Float16|__fp16|_Float32|_Float32x|_Float64|_Float64x|__float80|_Float128|_Float128x|__float128|__ibm128|__int128|_Fract|_Sat|_Accum)\\b"
- type: "\\b[a-z_][0-9a-z_]+(_t|_T)\\b"
- statement: "\\b(auto|volatile|register|restrict|_Alignas|alignas|_Alignof|alignof|static|const|constexpr|extern|_Thread_local|thread_local)\\b"
- statement: "\\b(for|if|while|do|else|case|default|switch|_Generic|_Static_assert|static_assert)\\b"
- statement: "\\b(goto|continue|break|return)\\b"
- statement: "\\b(asm|fortran)\\b"
- preproc: "^[[:space:]]*#[[:space:]]*(define|embed|pragma|include|(un|ifn?)def|endif|el(if|ifdef|ifndef|se)|if|line|warning|error|__has_include|__has_embed|__has_c_attribute)"
- preproc: "^[[:space:]]*_Pragma\\b"
# GCC builtins
- statement: "__attribute__[[:space:]]*\\(\\([^)]*\\)\\)"
- statement: "__(aligned|asm|builtin|extension|hidden|inline|packed|restrict|section|typeof|weak)__"
# Operator Color
- symbol.operator: "[-+*/%=<>.:;,~&|^!?]|\\b(offsetof|sizeof)\\b"
- symbol.brackets: "[(){}]|\\[|\\]"
# Integer Constants
- constant.number: "(\\b([1-9][0-9]*|0[0-7]*|0[Xx][0-9A-Fa-f]+|0[Bb][01]+)([Uu][Ll]?[Ll]?|[Ll][Ll]?[Uu]?)?\\b)"
# Decimal Floating Constants
- constant.number: "(\\b(([0-9]*[.][0-9]+|[0-9]+[.][0-9]*)([Ee][+-]?[0-9]+)?|[0-9]+[Ee][+-]?[0-9]+)[FfLl]?\\b)"
# Hexadecimal Floating Constants
- constant.number: "(\\b0[Xx]([0-9A-Za-z]*[.][0-9A-Za-z]+|[0-9A-Za-z]+[.][0-9A-Za-z]*)[Pp][+-]?[0-9]+[FfLl]?\\b)"
- constant.bool: "(\\b(true|false|NULL|nullptr|TRUE|FALSE)\\b)"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
# TODO: Revert back to - error: "..+" once #3127 is merged
- error: "[[:graph:]]{2,}'"
- constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "/\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,23 @@
filetype: caddyfile
detect:
filename: "Caddyfile"
rules:
- identifier: "^\\s*\\S+(\\s|$)"
- type: "^([\\w.:/-]+,? ?)+[,{]$"
- constant.specialChar: "\\s{$"
- constant.specialChar: "^\\s*}$"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- preproc: "\\{(\\w+|\\$\\w+|%\\w+%)\\}"
- comment:
start: "#"
end: "$"
rules: []

View File

@@ -0,0 +1,7 @@
filetype: cake
detect:
filename: "\\.cake$"
rules:
- include: "csharp"
- preproc: "^[[:space:]]*#(addin|break|l(oad)?|module|r(eference)?|tool)"

View File

@@ -0,0 +1,38 @@
filetype: clojure
detect:
filename: "\\.(clj[sc]?|edn)$"
rules:
# Constants
- constant.bool: "\\b(true|false)\\b"
- constant.macro: "\\b(nil)\\b"
# Valid numbers
- constant.number: "[\\-]?[0-9]+?\\b"
- constant.number: "0x[0-9][A-Fa-f]+?\\b"
- constant.number: "[\\-]?(3[0-6]|2[0-9]|1[0-9]|[2-9])r[0-9A-Z]+?\\b"
# Invalid numbers
- error: "[\\-]?([4-9][0-9]|3[7-9]|1|0)r[0-9A-Z]+?\\b"
# Symbols
- symbol.operator: "[=>+\\-*/'?]"
# Types/casting
- type: "\\b(byte|short|(big)?int(eger)?|long|float|num|bigdec|rationalize)\\b"
# String highlighting
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "(\\\\u[0-9A-fa-f]{4,4}|\\\\newline|\\\\space|\\\\tab|\\\\formfeed|\\\\backspace|\\\\return|\\\\.)"
# Comments
- comment:
start: ";"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,42 @@
filetype: cmake
detect:
filename: "(CMakeLists\\.txt|\\.cmake)$"
rules:
- identifier.var: "^[[:space:]]*[A-Z0-9_]+"
- preproc: "^[[:space:]]*(include|include_directories|include_external_msproject)\\b"
- statement: "^[[:space:]]*\\b((else|end)?if|else|(end)?while|(end)?foreach|break)\\b"
- statement: "\\b(COPY|NOT|COMMAND|PROPERTY|POLICY|TARGET|EXISTS|IS_(DIRECTORY|ABSOLUTE)|DEFINED)\\b[[:space:]]"
- statement: "[[:space:]]\\b(OR|AND|IS_NEWER_THAN|MATCHES|(STR|VERSION_)?(LESS|GREATER|EQUAL))\\b[[:space:]]"
- special: "^[[:space:]]*\\b((end)?(function|macro)|return)"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- preproc:
start: "\\$(\\{|ENV\\{)"
end: "\\}"
rules: []
- identifier.macro: "\\b(APPLE|UNIX|WIN32|CYGWIN|BORLAND|MINGW|MSVC(_IDE|60|71|80|90)?)\\b"
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,56 @@
filetype: coffeescript
detect:
filename: "\\.coffee$"
rules:
- symbol.operator: "([-+/*=<>!~%?:&|]|[.]{3})|\\b(and|or|is|isnt|not)\\b"
- identifier.class: "([A-Za-z_][A-Za-z0-9_]*:[[:space:]]*(->|\\()|->)"
- symbol.brackets: "[()]"
- statement: "\\b(await|when|catch|continue|debugger|default|by|until)\\b"
- statement: "\\b(delete|do|else|export|finally|for|class|extends|while|then)\\b"
- statement: "\\b(get|if|import|from|in|instanceof|new|reject|resolve|return)\\b"
- statement: "\\b(set|super|switch|this|throw|try|typeof|with|yield|unless)\\b"
- constant.bool: "\\b(true|false|yes|no|on|off)\\b"
- constant.bool.false: "\\b(false|no|off)\\b"
- constant.bool.true: "\\b(true|yes|on)\\b"
- constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b"
- constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
- constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
- identifier: "@[A-Za-z0-9_]*"
- error: "\\b(enum|implements|interface|package|private|protected|public)"
- constant: "\\b(globalThis|Infinity|null|undefined|NaN)\\b"
- constant: "\\b(null|undefined|NaN)\\b"
- constant: "\\b(true|false|yes|no|on|off)\\b"
- type: "\\b(Array|Boolean|Date|Enumerator|Error|Function|Generator|Map|Math)\\b"
- type: "\\b(Number|Object|Promise|Proxy|Reflect|RegExp|Set|String|Symbol|WeakMap|WeakSet)\\b"
- type: "\\b(BigInt64Array|BigUint64Array|Float32Array|Float64Array|Int16Array)\\b"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "###"
end: "###"
rules: []
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,19 @@
filetype: colortest
detect:
filename: "ColorTest$"
rules:
- black: "\\bPLAIN\\b"
- red: "\\bred\\b"
- green: "\\bgreen\\b"
- yellow: "\\byellow\\b"
- blue: "\\bblue\\b"
- magenta: "\\bmagenta\\b"
- cyan: "\\bcyan\\b"
- brightred: "\\bbrightred\\b"
- brightgreen: "\\bbrightgreen\\b"
- brightyellow: "\\bbrightyellow\\b"
- brightblue: "\\bbrightblue\\b"
- brightmagenta: "\\bbrightmagenta\\b"
- brightcyan: "\\bbrightcyan\\b"

View File

@@ -0,0 +1,17 @@
filetype: conky
detect:
filename: "(\\.*conkyrc.*$|conky.conf)"
rules:
- type: "\\b(alignment|append_file|background|border_inner_margin|border_outer_margin|border_width|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|colorN|cpu_avg_samples|default_bar_height|default_bar_width|default_color|default_gauge_height|default_gauge_width|default_graph_height|default_graph_width|default_outline_color|default_shade_color|diskio_avg_samples|display|double_buffer|draw_borders|draw_graph_borders|draw_outline|draw_shades|extra_newline|font|format_human_readable|gap_x|gap_y|http_refresh|if_up_strictness|imap|imlib_cache_flush_interval|imlib_cache_size|lua_draw_hook_post|lua_draw_hook_pre|lua_load|lua_shutdown_hook|lua_startup_hook|mail_spool|max_port_monitor_connections|max_text_width|max_user_text|maximum_width|minimum_height|minimum_width|mpd_host|mpd_password|mpd_port|music_player_interval|mysql_host|mysql_port|mysql_user|mysql_password|mysql_db|net_avg_samples|no_buffers|nvidia_display|out_to_console|out_to_http|out_to_ncurses|out_to_stderr|out_to_x|override_utf8_locale|overwrite_file|own_window|own_window_class|own_window_colour|own_window_hints|own_window_title|own_window_transparent|own_window_type|pad_percents|pop3|sensor_device|short_units|show_graph_range|show_graph_scale|stippled_borders|temperature_unit|template|template0|template1|template2|template3|template4|template5|template6|template7|template8|template9|text|text_buffer_size|times_in_seconds|top_cpu_separate|top_name_width|total_run_times|update_interval|update_interval_on_battery|uppercase|use_spacer|use_xft|xftalpha|xftfont)\\b"
# Configuration item constants
- statement: "\\b(above|below|bottom_left|bottom_right|bottom_middle|desktop|dock|no|none|normal|override|skip_pager|skip_taskbar|sticky|top_left|top_right|top_middle|middle_left|middle_right|middle_middle|undecorated|yes)\\b"
# Variables
- preproc: "\\b(acpiacadapter|acpifan|acpitemp|addr|addrs|alignc|alignr|apcupsd|apcupsd_cable|apcupsd_charge|apcupsd_lastxfer|apcupsd_linev|apcupsd_load|apcupsd_loadbar|apcupsd_loadgauge|apcupsd_loadgraph|apcupsd_model|apcupsd_name|apcupsd_status|apcupsd_temp|apcupsd_timeleft|apcupsd_upsmode|apm_adapter|apm_battery_life|apm_battery_time|audacious_bar|audacious_bitrate|audacious_channels|audacious_filename|audacious_frequency|audacious_length|audacious_length_seconds|audacious_main_volume|audacious_playlist_length|audacious_playlist_position|audacious_position|audacious_position_seconds|audacious_status|audacious_title|battery|battery_bar|battery_percent|battery_short|battery_time|blink|bmpx_album|bmpx_artist|bmpx_bitrate|bmpx_title|bmpx_track|bmpx_uri|buffers|cached|cmdline_to_pid|color|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|combine|conky_build_arch|conky_build_date|conky_version|cpu|cpubar|cpugauge|cpugraph|curl|desktop|desktop_name|desktop_number|disk_protect|diskio|diskio_read|diskio_write|diskiograph|diskiograph_read|diskiograph_write|distribution|downspeed|downspeedf|downspeedgraph|draft_mails|else|endif|entropy_avail|entropy_bar|entropy_perc|entropy_poolsize|eval|eve|exec|execbar|execgauge|execgraph|execi|execibar|execigauge|execigraph|execp|execpi|flagged_mails|font|format_time|forwarded_mails|freq|freq_g|fs_bar|fs_bar_free|fs_free|fs_free_perc|fs_size|fs_type|fs_used|fs_used_perc|goto|gw_iface|gw_ip|hddtemp|head|hr|hwmon|i2c|i8k_ac_status|i8k_bios|i8k_buttons_status|i8k_cpu_temp|i8k_left_fan_rpm|i8k_left_fan_status|i8k_right_fan_rpm|i8k_right_fan_status|i8k_serial|i8k_version|ibm_brightness|ibm_fan|ibm_temps|ibm_volume|ical|iconv_start|iconv_stop|if_empty|if_existing|if_gw|if_match|if_mixer_mute|if_mounted|if_mpd_playing|if_running|if_smapi_bat_installed|if_up|if_updatenr|if_xmms2_connected|image|imap_messages|imap_unseen|ioscheduler|irc|kernel|laptop_mode|lines|loadavg|loadgraph|lua|lua_bar|lua_gauge|lua_graph|lua_parse|machine|mails|mboxscan|mem|memwithbuffers|membar|memwithbuffersbar|memeasyfree|memfree|memgauge|memgraph|memmax|memperc|mixer|mixerbar|mixerl|mixerlbar|mixerr|mixerrbar|moc_album|moc_artist|moc_bitrate|moc_curtime|moc_file|moc_rate|moc_song|moc_state|moc_timeleft|moc_title|moc_totaltime|monitor|monitor_number|mpd_album|mpd_artist|mpd_bar|mpd_bitrate|mpd_elapsed|mpd_file|mpd_length|mpd_name|mpd_percent|mpd_random|mpd_repeat|mpd_smart|mpd_status|mpd_title|mpd_track|mpd_vol|mysql|nameserver|new_mails|nodename|nodename_short|no_update|nvidia|obsd_product|obsd_sensors_fan|obsd_sensors_temp|obsd_sensors_volt|obsd_vendor|offset|outlinecolor|pb_battery|pid_chroot|pid_cmdline|pid_cwd|pid_environ|pid_environ_list|pid_exe|pid_nice|pid_openfiles|pid_parent|pid_priority|pid_state|pid_state_short|pid_stderr|pid_stdin|pid_stdout|pid_threads|pid_thread_list|pid_time_kernelmode|pid_time_usermode|pid_time|pid_uid|pid_euid|pid_suid|pid_fsuid|pid_gid|pid_egid|pid_sgid|pid_fsgid|pid_read|pid_vmpeak|pid_vmsize|pid_vmlck|pid_vmhwm|pid_vmrss|pid_vmdata|pid_vmstk|pid_vmexe|pid_vmlib|pid_vmpte|pid_write|platform|pop3_unseen|pop3_used|processes|read_tcp|read_udp|replied_mails|rss|running_processes|running_threads|scroll|seen_mails|shadecolor|smapi|smapi_bat_bar|smapi_bat_perc|smapi_bat_power|smapi_bat_temp|sony_fanspeed|stippled_hr|stock|swap|swapbar|swapfree|swapmax|swapperc|sysname|tab|tail|tcp_ping|tcp_portmon|template0|template1|template2|template3|template4|template5|template6|template7|template8|template9|texeci|texecpi|threads|time|to_bytes|top|top_io|top_mem|top_time|totaldown|totalup|trashed_mails|tztime|gid_name|uid_name|unflagged_mails|unforwarded_mails|unreplied_mails|unseen_mails|updates|upspeed|upspeedf|upspeedgraph|uptime|uptime_short|user_names|user_number|user_terms|user_times|user_time|utime|voffset|voltage_mv|voltage_v|weather|wireless_ap|wireless_bitrate|wireless_essid|wireless_link_bar|wireless_link_qual|wireless_link_qual_max|wireless_link_qual_perc|wireless_mode|words|xmms2_album|xmms2_artist|xmms2_bar|xmms2_bitrate|xmms2_comment|xmms2_date|xmms2_duration|xmms2_elapsed|xmms2_genre|xmms2_id|xmms2_percent|xmms2_playlist|xmms2_size|xmms2_smart|xmms2_status|xmms2_timesplayed|xmms2_title|xmms2_tracknr|xmms2_url)\\b"
- identifier.var: "\\$\\{?[0-9A-Z_!@#$*?-]+\\}?"
- symbol.operator: "(\\{|\\}|\\(|\\)|\\;|\\]|\\[|`|\\\\|\\$|<|>|!|=|&|\\|)"
- constant.macro: "^TEXT$"

View File

@@ -0,0 +1,91 @@
filetype: c++
detect:
filename: "(\\.c(c|pp|xx)$|\\.h(h|pp|xx)?$|\\.ii?$|\\.(def)$)"
signature: "\\b(namespace|class|public|protected|private|template|constexpr|noexcept|nullptr|throw)\\b"
rules:
- identifier: "\\b[A-Z_][0-9A-Z_]*\\b"
- type: "\\b(auto|float|double|bool|char|int|short|long|enum|void|struct|union|typedef|(un)?signed|inline)\\b"
- type: "\\b(((s?size)|((u_?)?int(8|16|32|64|ptr))|char(8|16|32))_t|wchar_t)\\b"
- type: "\\b[a-z_][0-9a-z_]+(_t|_T)\\b"
- type: "\\b(final|override)\\b"
- statement: "\\b(volatile|const(expr|eval|init)?|mutable|register|thread_local|static|extern|decltype|explicit|virtual)\\b"
- statement: "\\b(class|namespace|template|typename|this|friend|using|public|protected|private|noexcept)\\b"
- statement: "\\b(concept|requires)\\b"
- statement: "\\b(import|export|module)\\b"
- statement: "\\b(for|if|while|do|else|case|default|switch)\\b"
- statement: "\\b(try|throw|catch|operator|new|delete|static_assert)\\b"
- statement: "\\b(goto|continue|break|return)\\b"
- preproc: "^[[:space:]]*#[[:space:]]*(define|pragma|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)|_Pragma"
# Conditionally-supported/extension keywords
- statement: "\\b(asm|fortran)\\b"
# GCC builtins
- statement: "(__attribute__[[:space:]]*\\(\\([^)]*\\)\\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__)"
# Operator Color
- symbol.operator: "[-+*/%=<>.:;,~&|^!?]|\\b(sizeof|alignof|typeid|(and|or|xor|not)(_eq)?|bitor|compl|bitand|(const|dynamic|reinterpret|static)_cast)\\b"
# Parenthetical Color
- symbol.brackets: "[(){}]|\\[|\\]"
# Integer Literals
- constant.number: "(\\b([0-9]|0[0-7]|0[Xx][0-9A-Fa-f]|0[Bb][01])([Uu][Ll]?[Ll]?|[Ll][Ll]?[Uu]?)?\\b)" # Base case (Without ' separtor)
- constant.number: "(\\b([1-9][0-9']*[0-9])([Uu][Ll]?[Ll]?|[Ll][Ll]?[Uu]?)?\\b)" # Decimal
- constant.number: "(\\b(0[0-7][0-7']*[0-7])([Uu][Ll]?[Ll]?|[Ll][Ll]?[Uu]?)?\\b)" # Oct
- constant.number: "(\\b(0[Xx][0-9A-Fa-f][0-9A-Fa-f']*[0-9A-Fa-f])([Uu][Ll]?[Ll]?|[Ll][Ll]?[Uu]?)?\\b)" # Hex
- constant.number: "(\\b(0[Bb][01][01']*[01])([Uu][Ll]?[Ll]?|[Ll][Ll]?[Uu]?)?\\b)" # Binary
# Decimal Floating-point Literals
- constant.number: "(([0-9]?[.]?\\b[0-9]+)([Ee][+-]?[0-9]+)?[FfLl]?\\b)" # Base case optional interger part with exponent base case
- constant.number: "(\\b([0-9]+[.][0-9]?)([Ee][+-]?[0-9]+)?[FfLl]?)" # Base case optional fractional part with exponent base case
- constant.number: "(([0-9]?[.]?\\b[0-9]+)([Ee][+-]?[0-9][0-9']*[0-9])?[FfLl]?\\b)" # Base case optional interger part with exponent
- constant.number: "(\\b([0-9]+[.][0-9]?)([Ee][+-]?[0-9][0-9']*[0-9])?[FfLl]?)" # Base case optional fractional part with exponent
- constant.number: "(([0-9][0-9']*[0-9])?[.]?\\b([0-9][0-9']*[0-9])+([Ee][+-]?[0-9]+)?[FfLl]?\\b)" # Optional interger part with exponent base case
- constant.number: "(\\b([0-9][0-9']*[0-9])+[.]([0-9][0-9']*[0-9])?([Ee][+-]?[0-9]+)?[FfLl]?)" # Optional fractional part with exponent base case
- constant.number: "(([0-9][0-9']*[0-9])?[.]?\\b([0-9][0-9']*[0-9])+([Ee][+-]?[0-9][0-9']*[0-9])?[FfLl]?\\b)" # Optional interger part with exponent
- constant.number: "(\\b([0-9][0-9']*[0-9])+[.]([0-9][0-9']*[0-9])?([Ee][+-]?[0-9][0-9']*[0-9])?[FfLl]?)" # Optional fractional part with exponent
# Hexadecimal Floating-point Literals
- constant.number: "(\\b0[Xx]([0-9a-zA-Z]?[.]?[0-9a-zA-Z]+)([Pp][+-]?[0-9]+)?[FfLl]?\\b)" # Base case optional interger part with exponent base case
- constant.number: "(\\b0[Xx]([0-9a-zA-Z]+[.][0-9a-zA-Z]?)([Pp][+-]?[0-9]+)?[FfLl]?)" # Base case optional fractional part with exponent base case
- constant.number: "(\\b0[Xx]([0-9a-zA-Z]?[.]?[0-9a-zA-Z]+)([Pp][+-]?[0-9][0-9']*[0-9])?[FfLl]?\\b)" # Base case optional interger part with exponent
- constant.number: "(\\b0[Xx]([0-9a-zA-Z]+[.][0-9a-zA-Z]?)([Pp][+-]?[0-9][0-9']*[0-9])?[FfLl]?)" # Base case optional fractional part with exponent
- constant.number: "(\\b0[Xx]([0-9a-zA-Z][0-9a-zA-Z']*[0-9a-zA-Z])?[.]?([0-9a-zA-Z][0-9a-zA-Z']*[0-9a-zA-Z])+([Pp][+-]?[0-9]+)?[FfLl]?\\b)" # Optional interger part with exponent base case
- constant.number: "(\\b0[Xx]([0-9a-zA-Z][0-9a-zA-Z']*[0-9a-zA-Z])+[.]([0-9a-zA-Z][0-9a-zA-Z']*[0-9a-zA-Z])?([Pp][+-]?[0-9]+)?[FfLl]?)" # Optional fractional part with exponent base case
- constant.number: "(\\b0[Xx]([0-9a-zA-Z][0-9a-zA-Z']*[0-9a-zA-Z])?[.]?([0-9a-zA-Z][0-9a-zA-Z']*[0-9a-zA-Z])+([Pp][+-]?[0-9][0-9']*[0-9])?[FfLl]?\\b)" # Optional interger part with exponent
- constant.number: "(\\b0[Xx]([0-9a-zA-Z][0-9a-zA-Z']*[0-9a-zA-Z])+[.]([0-9a-zA-Z][0-9a-zA-Z']*[0-9a-zA-Z])?([Pp][+-]?[0-9][0-9']*[0-9])?[FfLl]?)" # Optional fractional part with exponent
- constant.bool: "(\\b(true|false|NULL|nullptr|TRUE|FALSE)\\b)"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"
- constant.string:
start: "'"
end: "'"
skip: "(\\\\.)|\\b([1-9][0-9']+[0-9]|0[0-7']+[0-7]|0[Xx][0-9A-Fa-f][0-9A-Fa-f']+[0-9A-Fa-f]|0[Bb][01][01']*[01])([Uu][Ll]?[Ll]?|[Ll][Ll]?[Uu]?)?\\b"
rules:
# TODO: Revert back to - error: "..+" once #3127 is merged
- error: "[[:graph:]]{2,}'"
- constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "/\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,36 @@
filetype: crontab
detect:
filename: "crontab$|/tmp/crontab\\.\\w+$"
header: "^#.*?/etc/crontab"
rules:
# The time and date fields are:
# field allowed values
# ----- --------------
# minute 0-59
# hour 0-23
# day of month 0-31
# month 0-12 (or names, see below)
# day of week 0-7 (0 or 7 is Sun, or use names)
- statement: "^([\\*0-9,\\-\\/]+)\\s+([\\*0-9,\\-\\/]+)\\s+([\\*0-9,\\-\\/]+)\\s+(([\\*0-9,\\-\\/]+)|(\\b(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\\b))\\s+(([\\*0-9,\\-\\/]+)|(\\b(sun|mon|tue|wed|thu|fri|sat)\\b))\\s+(.*)$\\n?"
- constant: "^([\\*0-9,\\-\\/]+)\\s+([\\*0-9,\\-\\/]+)\\s+([\\*0-9,\\-\\/]+)\\s+(([\\*0-9,\\-\\/]+)|(\\b(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\\b))\\s+(([\\*0-9,\\-\\/]+)|(\\b(sun|mon|tue|wed|thu|fri|sat)\\b))"
# Shell Values
- type: "^[A-Z]+\\="
# Months and weekday keywords
- constant: "\\b(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\\b"
- constant: "\\b(sun|mon|tue|wed|thu|fri|sat)\\b"
- type: "\\@(reboot|yearly|annually|monthly|weekly|daily|midnight|hourly)\\b"
# Conditionals
- special: "(\\{|\\}|\\(|\\)|\\;|\\]|\\[|`|\\\\|\\$|<|>|^|!|=|&|\\|)"
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,72 @@
filetype: crystal
detect:
filename: "\\.cr$"
rules:
# Asciibetical list of reserved words
- statement: "\\b(abstract|alias|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|in|include|instance_sizeof|lib|loop|macro|module|next|of|out|pointerof|private|protected|raise|require|rescue|return|select|self|sizeof|spawn|struct|super|then|type|typeof|uninitialized|union|unless|until|verbatim|when|while|with|yield)\\b"
# Constants
- constant: "\\b(true|false|nil)\\b"
- constant.number: "\\b[0-9]+\\b"
# Ones that can't be in the same regex because they include non-words.
# The nil? one has to be after the constants.
- statement: "\\b(nil\\?|as(\\?|\\b)|is_a\\?|responds_to\\?)"
- type: "(\\$|@|@@)?\\b[A-Z]+[0-9A-Z_a-z]*"
# Crystal "symbols"
- constant: "([ ]|^):[0-9A-Z_]+\\b"
# Some unique things we want to stand out
- constant: "\\b(__FILE__|__LINE__)\\b"
# Regular expressions
- constant: "/([^/]|(\\\\/))*/[iomx]*|%r\\{([^}]|(\\\\}))*\\}[iomx]*"
# Shell command expansion is in `backticks` or like %x{this}. These are
# "double-quotish" (to use a perlism).
- constant.string: "`[^`]*`|%x\\{[^}]*\\}"
- constant.string:
start: "`"
end: "`"
rules: []
- constant.string:
start: "%x\\{"
end: "\\}"
rules: []
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- symbol.brackets:
start: "#\\{"
end: "\\}"
rules:
- default: ".*"
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment.bright:
start: "##"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- constant:
start: "<<-?'?EOT'?"
end: "^EOT"
rules: []

View File

@@ -0,0 +1,52 @@
filetype: csharp
detect:
filename: "\\.cs$"
rules:
# Class
- identifier.class: "class +[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?"
# Annotation
- identifier.var: "@[A-Za-z]+"
- preproc: "^[[:space:]]*#[[:space:]]*(define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)"
- identifier: "([A-Za-z0-9_]*[[:space:]]*[()])"
- type: "\\b(bool|byte|sbyte|char|decimal|double|float|IntPtr|int|uint|long|ulong|managed|unmanaged|nint|nuint|object|short|ushort|string|base|this|var|void)\\b"
- statement: "\\b(alias|as|case|catch|checked|default|do|dynamic|else|finally|fixed|for|foreach|goto|if|is|lock|new|null|return|switch|throw|try|unchecked|when|while|with)\\b"
- statement: "\\b(abstract|add|and|args|async|await|class|const|delegate|enum|event|explicit|extern|file|get|global|implicit|in|init|internal|interface|nameof|namespace|not|notnull|operator|or|out|override|params|partial|private|protected|public|readonly|record|ref|remove|required|scoped|sealed|set|sizeof|stackalloc|static|struct|typeof|unsafe|using|value|virtual|volatile|yield)\\b"
# LINQ-only keywords (ones that cannot be used outside of a LINQ query - lots others can)
- statement: "\\b(from|where|select|group|info|orderby|join|let|in|on|equals|by|ascending|descending)\\b"
- special: "\\b(break|continue)\\b"
- constant.bool: "\\b(true|false)\\b"
- symbol.operator: "[\\-+/*=<>?:!~%&|]"
- constant.number: "\\b([0-9._]+|0x[A-Fa-f0-9_]+|0b[0-1_]+)[FL]?\\b"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([btnfr]|'|\\\"|\\\\)"
- constant.specialChar: "\\\\u[A-Fa-f0-9]{4}"
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([btnfr]|'|\\\"|\\\\)"
- constant.specialChar: "\\\\u[A-Fa-f0-9]{4}"
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "/\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
filetype: csharp-script
detect:
filename: "\\.csx$"
header: "^#!.*/(env +)?dotnet-script( |$)"
rules:
- include: "csharp"
- preproc: "\\B(\\#!|\\#[r|load|]+\\b)"

View File

@@ -0,0 +1,68 @@
filetype: cuda
detect:
filename: "(\\.cu[h]?$)"
rules:
- identifier: "\\b[A-Z_][0-9A-Z_]*\\b"
- type: "\\b(float|double|bool|char|int|short|long|enum|void|struct|union|typedef|(un)?signed|inline)\\b"
- type: "\\b(((s?size)|((u_?)?int(8|16|32|64|ptr))|char(8|16|32))_t|wchar_t)\\b"
- type: "\\b[a-z_][0-9a-z_]+(_t|_T)\\b"
- type: "\\b(final|override)\\b"
- type.keyword: "\\b(auto|volatile|const(expr|eval|init)?|mutable|register|thread_local|static|extern|decltype|explicit|virtual)\\b"
- statement: "\\b(class|namespace|template|typename|this|friend|using|public|protected|private|noexcept)\\b"
- statement: "\\b(concept|requires)\\b"
- statement: "\\b(import|export|module)\\b"
- statement: "\\b(for|if|while|do|else|case|default|switch)\\b"
- statement: "\\b(try|throw|catch|operator|new|delete|static_assert)\\b"
- statement: "\\b(goto|continue|break|return)\\b"
- preproc: "^[[:space:]]*#[[:space:]]*(define|pragma|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)|_Pragma"
# Conditionally-supported/extension keywords
- statement: "\\b(asm|fortran)\\b"
# GCC builtins
- statement: "(__attribute__[[:space:]]*\\(\\([^)]*\\)\\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__)"
# CUDA specific keywords
- statement: "__(global|device|host|shared)__"
# Operator Color
- symbol.operator: "[-+*/%=<>.:;,~&|^!?]|\\b(sizeof|alignof|typeid|(and|or|xor|not)(_eq)?|bitor|compl|bitand|(const|dynamic|reinterpret|static)_cast)\\b"
# Parenthetical Color
- symbol.brackets: "[(){}]|\\[|\\]"
# Integer Literals
- constant.number: "(\\b([1-9][0-9']*|0[0-7']*|0[Xx][0-9a-fA-F']+|0[Bb][01]+)([Uu]?[Ll][Ll]?|[Ll][Ll]?[Uu]?)?\\b)"
# Decimal Floating-point Literals
- constant.number: "(\\b(([0-9']*[.][0-9']+|[0-9']+[.][0-9']*)([Ee][+-]?[0-9']+)?|[0-9']+[Ee][+-]?[0-9']+)[FfLl]?\\b)"
# Hexadecimal Floating-point Literals
- constant.number: "(\\b0[Xx]([0-9a-zA-Z']*[.][0-9a-zA-Z']+|[0-9a-zA-Z']+[.][0-9a-zA-Z']*)[Pp][+-]?[0-9']+[FfLl]?\\b)"
- constant.bool: "(\\b(true|false|NULL|nullptr)\\b)"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- error: "..+"
- constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "/\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,52 @@
filetype: cython
detect:
filename: "\\.pyx$|\\.pxd$|\\.pyi$"
rules:
# Python Keyword Color
- statement: "\\b(and|as|assert|class|def|DEF|del|elif|ELIF|else|ELSE|except|exec|finally|for|from|global|if|IF|import|in|is|lambda|map|not|or|pass|print|raise|try|while|with|yield)\\b"
- special: "\\b(continue|break|return)\\b"
# Cython Keyword Color
- identifier.macro: "\\b(cdef|cimport|cpdef|cppclass|ctypedef|extern|include|namespace|property|struct)\\b"
- type: "\\b(bint|char|double|int|public|void|unsigned)\\b"
# Operator Color
- symbol: "[.:;,+*|=!\\%]|<|>|/|-|&"
# Parenthetical Color
- symbol.brackets: "[(){}]|\\[|\\]"
- constant.string:
start: "\"\"\""
end: "\"\"\""
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'''"
end: "'''"
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

121
config/micro/syntax/d.yaml Normal file
View File

@@ -0,0 +1,121 @@
filetype: d
detect:
filename: "\\.(d(i|d)?)$"
rules:
# Operators and punctuation
- statement: "(\\*|/|%|\\+|-|>>|<<|>>>|&|\\^(\\^)?|\\||~)?="
- statement: "\\.\\.(\\.)?|!|\\*|&|~|\\(|\\)|\\[|\\]|\\\\|/|\\+|-|%|<|>|\\?|:|;"
# Octal integer literals are deprecated
- error: "(0[0-7_]*)(L[uU]?|[uU]L?)?"
# Decimal integer literals
- constant.number: "([0-9]|[1-9][0-9_]*)(L[uU]?|[uU]L?)?\\b"
# Binary integer literals
- constant: "(0[bB][01_]*)(L[uU]?|[uU]L?)?"
# Decimal float literals
- constant.number: "[0-9][0-9_]*\\.([0-9][0-9_]*)([eE][+-]?([0-9][0-9_]*))?[fFL]?i?"
- constant.number: "[0-9][0-9_]*([eE][+-]?([0-9][0-9_]*))[fFL]?i?"
- constant.number: "[^.]\\.([0-9][0-9_]*)([eE][+-]?([0-9][0-9_]*))?[fFL]?i?"
- constant.number: "[0-9][0-9_]*([fFL]?i|[fF])"
# Hexadecimal integer literals
- constant.number: "(0[xX]([0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F]))(L[uU]?|[uU]L?)?"
# Hexadecimal float literals
- constant.number: "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_]*|[0-9a-fA-F_]*[0-9a-fA-F])?[pP][+-]?([0-9][0-9_]*)[fFL]?i?"
- constant.number: "0[xX]\\.([0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F])[pP][+-]?([0-9][0-9_]*)[fFL]?i?"
# Character literals
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
# Keywords
# a-e
- statement: "\\b(abstract|alias|align|asm|assert|auto|body|break|case|cast|catch|class|const|continue|debug|default|delegate|do|else|enum|export|extern)\\b"
# f-l
- statement: "\\b(false|final|finally|for|foreach|foreach_reverse|function|goto|if|immutable|import|in|inout|interface|invariant|is|lazy)\\b"
# m-r
- statement: "\\b(macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|public|pure|ref|return)\\b"
# s-w
- statement: "\\b(scope|shared|static|struct|super|switch|synchronized|template|this|throw|true|try|typeid|typeof|union|unittest|version|while|with)\\b"
# __
- statement: "\\b(__FILE__|__MODULE__|__LINE__|__FUNCTION__|__PRETTY_FUNCTION__|__gshared|__traits|__vector|__parameters)\\b"
# Deprecated keywords
- error: "\\b(delete|deprecated|typedef|volatile)\\b"
# Primitive types
- type: "\\b(bool|byte|cdouble|cent|cfloat|char|creal|dchar|double|float|idouble|ifloat|int|ireal|long|real|short|ubyte|ucent|uint|ulong|ushort|void|wchar)\\b"
# Globally defined symbols
- type: "\\b(string|wstring|dstring|size_t|ptrdiff_t)\\b"
# Special tokens
- constant: "\\b(__DATE__|__EOF__|__TIME__|__TIMESTAMP__|__VENDOR__|__VERSION__)\\b"
# String literals
# DoubleQuotedString
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
# WysiwygString
- constant.string:
start: "r\""
end: "\""
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "`"
end: "`"
rules:
- constant.specialChar: "\\\\."
# HexString
- constant.string:
start: "x\""
end: "\""
rules:
- constant.specialChar: "\\\\."
# DelimitedString
- constant.string:
start: "q\"\\("
end: "\\)\""
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "q\"\\{"
end: "q\"\\}"
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "q\"\\["
end: "q\"\\]"
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "q\"<"
end: "q\">"
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "q\"[^({[<\"][^\"]*$"
end: "^[^\"]+\""
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "q\"([^({[<\"])"
end: "\""
rules:
- constant.specialChar: "\\\\."
# Comments
- comment:
start: "//"
end: "$"
rules: []
- comment:
start: "/\\*"
end: "\\*/"
rules: []
- comment:
start: "/\\+"
end: "\\+/"
rules: []

View File

@@ -0,0 +1,46 @@
filetype: dart
detect:
filename: "\\.dart$"
rules:
- constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b"
- constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
- constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
- statement: "\\b(break|case|catch|continue|default|else|finally)\\b"
- statement: "\\b(for|function|get|if|in|as|is|new|return|set|switch|final|await|async|sync)\\b"
- statement: "\\b(switch|this|throw|try|var|void|while|with|import|library|part|const|export)\\b"
- constant: "\\b(true|false|null)\\b"
- type: "\\b(List|String)\\b"
- type: "\\b(int|num|double|bool)\\b"
- statement: "[-+/*=<>!~%?:&|]"
- constant: "/[^*]([^/]|(\\\\/))*[^\\\\]/[gim]*"
- constant: "\\\\[0-7][0-7]?[0-7]?|\\\\x[0-9a-fA-F]+|\\\\[bfnrt'\"\\?\\\\]"
- comment:
start: "//"
end: "$"
rules:
- todo: "TODO:?"
- comment:
start: "/\\*"
end: "\\*/"
rules:
- todo: "TODO:?"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."

View File

@@ -0,0 +1,10 @@
filetype: unknown
detect:
filename: ""
rules:
# Mails
- special: "[[:alnum:].%_+-]+@[[:alnum:].-]+"
# URLs
- identifier: "(https?|ftp|ssh)://\\S*[^])>\\s,.]"

View File

@@ -0,0 +1,36 @@
filetype: dockerfile
detect:
filename: "((Docker|Container)file[^/]*$|\\.(docker|container)file$)"
rules:
## Keywords
- type.keyword: "(?i)^(FROM|MAINTAINER|RUN|CMD|LABEL|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ONBUILD|ARG|HEALTHCHECK|STOPSIGNAL|SHELL)[[:space:]]"
## Brackets & parenthesis
- statement: "(\\(|\\)|\\[|\\])"
## Double ampersand
- special: "&&"
## Comments
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."

View File

@@ -0,0 +1,29 @@
filetype: dot
detect:
filename: "\\.(dot|gv)$"
rules:
- type: "\\b(digraph|edge|graph|node|subgraph)\\b"
- statement: "\\b(arrow(head|size|tail)|(bg|fill|font)?color|center|constraint|decorateP|dir|distortion|font(name|size)|head(clip|label)|height|label(angle|distance|font(color|name|size))?|layer(s)?|margin|mclimit|minlen|name|nodesep|nslimit|ordering|orientation|page(dir)?|peripheries|port_label_distance|rank(dir|sep)?|ratio|regular|rotate|same(head|tail)|shape(file)?|sides|size|skew|style|tail(clip|label)|URL|weight|width)\\b"
- symbol: "=|->|--"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "/\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,30 @@
filetype: elixir
detect:
filename: "\\.ex$|\\.exs$"
rules:
- statement: "\\b(abs|trunc|rem|div|round|max|min|and|or|not|throw|raise|reraise|hd|tl|in|length|elem|put_elem|destructure|to_(string|charlist)|is_(atom|binary|bitstring|boolean|float|function|integer|list|map|nil|number|pid|port|reference|tuple)|(bit|byte|map|tuple)_size|binary_part|def(delegate|exception|guard|guardp|impl|macro|macrop|module|overridable|p|protocol|struct)?|sigil_[crswCRSWDNT]|if|else|unless|cond|binding|node|self|spawn|spawn_link|spawn_monitor|send|exit|struct|get_and_update_in|get_in|put_in|pop_in|update_in|apply|inspect|make_ref|use|do|end)\\b"
- statement: "\\b(alias|import|require|case|fn|receive|after|try|catch|rescue|super|quote|unquote|unquote_splicing|for|with)\\b"
- constant: "\\b\\[A-Z]+\\b"
- constant.number: "\\b[0-9]+\\b"
- constant.string: "`[^`]*`|%x\\{[^}]*\\}"
- constant.string: "\"([^\"]|(\\\\\"))*\"|%[QW]?\\{[^}]*\\}|%[QW]?\\([^)]*\\)|%[QW]?<[^>]*>|%[QW]?\\[[^]]*\\]|%[QW]?\\$[^$]*\\$|%[QW]?\\^[^^]*\\^|%[QW]?![^!]*!"
- constant.string: "'([^']|(\\\\'))*'|%[qw]\\{[^}]*\\}|%[qw]\\([^)]*\\)|%[qw]<[^>]*>|%[qw]\\[[^]]*\\]|%[qw]\\$[^$]*\\$|%[qw]\\^[^^]*\\^|%[qw]![^!]*!"
- symbol.brackets: "\\{|\\}|\\[|\\]|\\(|\\)"
- comment: "#[^{].*$|#$"
- comment.bright: "##[^{].*$|##$"
- type.keyword: "\\:[a-zA-Z][a-zA-Z0-9_]*"
- type.keyword: "\\b(describe|test)"
- statement: "\\b(expected|assert|assert_raise|assert_in_delta|assert_received|catch_error|catch_throw|flunk|refute|refute_in_delta|refute_received)\\b"
- symbol.tag: "^\\s*\\@[a-zA-Z][a-zA-Z0-9_]*\\b"
- identifier.macro: "\\b(__CALLER__|__DIR__|__ENV__|__MODULE__|__aliases__|__block__|defmacro)\\b"
- todo: "(XXX|TODO|FIXME|\\?\\?\\?)"
- preproc.shebang: "\\W*#!.+?( |$)"

View File

@@ -0,0 +1,38 @@
filetype: elm
detect:
filename: "\\.elm$"
rules:
- statement: "\\b(as|alias|case|else|exposing|if|import|in|let|module|of|port|then|type|)\\b"
- statement: "(\\=|\\:|\\->)"
- type: "\\b([A-Z][A-Za-z\\d]*)\\b"
- identifier: "^([a-z][A-Za-z\\d]*)\\b"
- constant.string:
start: "\"\"\""
end: "\"\"\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "--"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "\\{-"
end: "-\\}"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,42 @@
filetype: erb
detect:
filename: "\\.erb$|\\.rhtml$"
rules:
- error: "<[^!].*?>"
- symbol.tag: "(?i)<[/]?(a(bbr|cronym|ddress|pplet|rea|rticle|side|udio)?|b(ase(font)?|d(i|o)|ig|lockquote|r)?|ca(nvas|ption)|center|cite|co(de|l|lgroup)|d(ata(list)?|d|el|etails|fn|ialog|ir|l|t)|em(bed)?|fieldset|fig(caption|ure)|font|form|(i)?frame|frameset|h[1-6]|hr|i|img|in(put|s)|kbd|keygen|label|legend|li(nk)?|ma(in|p|rk)|menu(item)?|met(a|er)|nav|no(frames|script)|o(l|pt(group|ion)|utput)|p(aram|icture|re|rogress)?|q|r(p|t|uby)|s(trike)?|samp|se(ction|lect)|small|source|span|strong|su(b|p|mmary)|textarea|time|track|u(l)?|var|video|wbr)( .*|>)*?>"
- symbol.tag.extended: "(?i)<[/]?(body|div|html|head(er)?|footer|title|table|t(body|d|h(ead)?|r|foot))( .*|>)*?>"
- preproc: "(?i)<[/]?(script|style)( .*|>)*?>"
- special: "&[^;[[:space:]]]*;"
- symbol: "[:=]"
- identifier: "(alt|bgcolor|height|href|id|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)="
- constant.string: "\"[^\"]*\""
- constant.number: "(?i)#[0-9a-fA-F]{6,6}"
- constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+"
- comment: "<!--.+?-->"
- preproc: "<!DOCTYPE.+?>"
- default:
start: "<%"
end: "%>"
rules: []
- preproc: "<%|%>"
- red: "&[^;[[:space:]]]*;"
- statement: "\\b(BEGIN|END|alias|and|begin|break|case|class|def|defined\\?|do|else|elsif|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\\b"
- identifier.var: "(\\$|@|@@)?\\b[A-Z]+[0-9A-Z_a-z]*"
- magenta: "(?i)([ ]|^):[0-9A-Z_]+\\b"
- identifier.macro: "\\b(__FILE__|__LINE__)\\b"
- brightmagenta: "!/([^/]|(\\\\/))*/[iomx]*|%r\\{([^}]|(\\\\}))*\\}[iomx]*"
- brightblue: "`[^`]*`|%x\\{[^}]*\\}"
- constant.string: "\"([^\"]|(\\\\\"))*\"|%[QW]?\\{[^}]*\\}|%[QW]?\\([^)]*\\)|%[QW]?<[^>]*>|%[QW]?\\[[^]]*\\]|%[QW]?\\$[^$]*\\$|%[QW]?\\^[^^]*\\^|%[QW]?![^!]*!"
- brightgreen: "#\\{[^}]*\\}"
- green: "'([^']|(\\\\'))*'|%[qw]\\{[^}]*\\}|%[qw]\\([^)]*\\)|%[qw]<[^>]*>|%[qw]\\[[^]]*\\]|%[qw]\\$[^$]*\\$|%[qw]\\^[^^]*\\^|%[qw]![^!]*!"
- comment: "#[^{].*$|#$"
- comment.bright: "##[^{].*$|##$"
- identifier.macro:
start: "<<-?'?EOT'?"
end: "^EOT"
rules: []
- todo: "(XXX|TODO|FIXME|\\?\\?\\?)"

View File

@@ -0,0 +1,45 @@
filetype: erlang
detect:
filename: "\\.erl$"
rules:
- identifier: "\\b[A-Z][0-9a-z_]*\\b"
# See: https://erlang.org/doc/reference_manual/data_types.html
- constant.number: "\\b[0-9]+(\\.[0-9]+)?(e-?[0-9]+)?\\b"
- constant.number: "\\b[0-9]{1,2}\\#[a-zA-Z0-9]+\\b"
- constant.bool: "\\b(true|false)\\b"
- constant.number: "\\$\\\\?\\S{1}"
# See: https://erlang.org/doc/reference_manual/introduction.html
- statement: "\\b(after|and|andalso|band|begin|bnot|bor|bsl|bsr|bxor|case|catch|cond|div|end|fun|if|let|not|of|or|orelse|receive|rem|try|when|xor)\\b"
# See: https://erlang.org/doc/reference_manual/macros.html
- preproc: "\\-(module|export|record|include|include_lib|define|undef|ifdef|ifndef|else|endif|if|elif|error|warning)\\b"
- identifier.macro: "\\?[A-Z0-9_]+\\b"
# See: https://erlang.org/doc/man/erlang.html
- special: "\\b(ext_binary|binary|iovec|message_queue_data|time(_unit|stamp)|abs|apply|atom(_to_binary|_to_list)|binary_(part|to_atom|to_existing_atom|to_float|to_integer|to_list|to_term)|bit(_size|string_to_list)|byte_size|ceil|check_(old_code|process_code)|date|delete_module|demonitor|disconnect_node|element|erase|error|exit|float(_to_binary|_to_list)?|floor|garbage_collect|get|group_leader|halt|integer(_to_binary|to_list)|iolist_(size|to_binary)|is_(alive|atom|binary|bitstring|boolean|float|function|integer|list|map|map_key|number|pid|port|process_alive|record|reference|tuple|length)|link|list_to_(atom|binary|bitstring|existing_atom|float|integer|pid|port|ref|tuple)|load_module|make_ref|map_(get|size)|max|min|module_loaded|monitor(_node)?|nodes?|now|open_port|pid_to_list|port(_close|command|connect|control|to_list)|pre_loaded|process(_flag|_info|es)|purge_module|put|register(ed)?|round|self|setelement|size|spawn(_link|_monitor|_opt|_binary)?|statistics|trunc|tuple_(size|to_list)|unlink|unregister|whereis)\\b"
# See: https://erlang.org/doc/reference_manual/data_types.html#atom
- symbol:
start: "'"
end: "'"
skip: "\\\\."
rules: []
# - constant.specialChar: "%."
# - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
# - constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "%."
- constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
- comment:
start: "\\(\\*"
end: "\\*\\)"
rules:
- todo: "(TODO|FIXME|WONTFIX|NOTE|HACK):?"
- comment:
start: "%"
end: "$"
rules: []

View File

@@ -0,0 +1,48 @@
filetype: fish
detect:
filename: "\\.fish$"
header: "^#!.*/(env +)?fish( |$)"
rules:
# Numbers
- constant: "\\b[0-9]+\\b"
# Conditionals and control flow
- statement: "\\b(and|begin|break|case|continue|else|end|for|function|if|in|not|or|return|select|shift|switch|while)\\b"
- special: "(\\{|\\}|\\(|\\)|\\;|\\]|\\[|`|\\\\|\\$|<|>|^|!|=|&|\\|)"
# Fish commands
- type: "\\b(bg|bind|block|breakpoint|builtin|cd|count|command|commandline|complete|dirh|dirs|echo|emit|eval|exec|exit|fg|fish|fish_config|fish_ident|fish_pager|fish_prompt|fish_right_prompt|fish_update_completions|fishd|funced|funcsave|functions|help|history|jobs|math|mimedb|nextd|open|popd|prevd|psub|pushd|pwd|random|read|set|set_color|source|status|string|trap|type|ulimit|umask|vared)\\b"
# Common linux commands
- type: "\\b((g|ig)?awk|bash|dash|find|\\w{0,4}grep|kill|killall|\\w{0,4}less|make|pkill|sed|sh|tar)\\b"
# Coreutils commands
- type: "\\b(base64|basename|cat|chcon|chgrp|chmod|chown|chroot|cksum|comm|cp|csplit|cut|date|dd|df|dir|dircolors|dirname|du|env|expand|expr|factor|false|fmt|fold|head|hostid|id|install|join|link|ln|logname|ls|md5sum|mkdir|mkfifo|mknod|mktemp|mv|nice|nl|nohup|nproc|numfmt|od|paste|pathchk|pinky|pr|printenv|printf|ptx|pwd|readlink|realpath|rm|rmdir|runcon|seq|(sha1|sha224|sha256|sha384|sha512)sum|shred|shuf|sleep|sort|split|stat|stdbuf|stty|sum|sync|tac|tail|tee|test|time|timeout|touch|tr|true|truncate|tsort|tty|uname|unexpand|uniq|unlink|users|vdir|wc|who|whoami|yes)\\b"
# Conditional flags
- statement: "--[a-z-]+"
- statement: "\\ -[a-z]+"
- identifier: "(?i)\\{?\\$[0-9A-Z_!@#$*?-]+\\}?"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules: []
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,34 @@
filetype: forth
detect:
filename: "\\.(forth|4th|fs|fs8|ft|fth|frt)$"
rules:
- identifier: "\\b[A-Za-z_0-9-]*\\b"
- statement: "\\b(?i:(if|else|then|do|loop|case|endcase|of|endof|begin|while|repeat|until|again|unloop|leave|exit|done|next|\\?do|\\+do|\\-do|\\+loop|\\-loop|\\?leave))\\b"
- statement: "(^:|;$)"
- type: "\\b(?i:(variable|constant|cells))\\b"
- special: "\\B[?.]\\B" #for some reason, \b and \B are inverted for symbols
- constant.number: "\\b[0-9]+\\b"
- constant.string:
start: "\\b([Ss.]\" )"
end: "\""
rules: []
- comment:
start: "\\("
end: "\\)"
rules:
- todo: "(TODO|NOTE|XXX|FIXME):?"
- comment:
start: "\\\\"
end: "$"
rules:
- todo: "(TODO|NOTE|XXX|FIXME):?"

View File

@@ -0,0 +1,64 @@
filetype: fortran
detect:
filename: "\\.([Ff]|[Ff]90|[Ff]95|[Ff][Oo][Rr])$"
rules:
- type: "(?i)\\b(action|advance|all|allocatable|allocated|any|apostrophe)\\b"
- type: "(?i)\\b(append|asis|assign|assignment|associated|bind|character|common)\\b"
- type: "(?i)\\b(complex|data|default|delim|dimension|double precision)\\b"
- type: "(?i)\\b(elemental|enum|enumerator|epsilon|external|file|fmt|form|format|huge)\\b"
- type: "(?i)\\b(implicit|include|index|inquire|integer|intent|interface)\\b"
- type: "(?i)\\b(intrinsic|iostat|kind|logical|module|none|null|only)\\\\b"
- type: "(?i)\\b(operator|optional|pack|parameter|pointer|position|private)\\b"
- type: "(?i)\\b(program|public|real|recl|recursive|selected_int_kind)\\b"
- type: "(?i)\\b(selected_real_kind|subroutine|status|module|function|logical)\\b"
- constant: "(?i)\\b(abs|achar|adjustl|adjustr|allocate|bit_size|call|char)\\b"
- constant: "(?i)\\b(close|contains|count|cpu_time|cshift|date_and_time)\\b"
- constant: "(?i)\\b(deallocate|digits|dot_product|eor|eoshift|iachar)\\b"
- constant: "(?i)\\b(iand|ibclr|ibits|ibset|ichar|ieor|iolength|ior|ishft|ishftc)\\b"
- constant: "(?i)\\b(lbound|len|len_trim|matmul|maxexponent|maxloc|maxval|merge)\\b"
- constant: "(?i)\\b(minexponent|minloc|minval|mvbits|namelist|nearest|nullify)\\b"
- constant: "(?i)\\b(open|pad|present|print|product|pure|quote|radix)\\b"
- constant: "(?i)\\b(random_number|random_seed|range|read|readwrite|replace)\\b"
- constant: "(?i)\\b(reshape|rewind|save|scan|sequence|shape|sign|size|spacing)\\b"
- constant: "(?i)\\b(spread|sum|system_clock|target|transfer|transpose|trim)\\b"
- constant: "(?i)\\b(ubound|unpack|verify|write|tiny|type|use|yes|true|false|not)\\b"
- constant.number: "\\b([0-9]+)\\b"
- statement: "(?i)\\b(.and.|case|do|else|else?if|else?where|end|end?do|end?if)\\b"
- statement: "(?i)\\b(end?select|.eqv.|forall|if|lge|lgt|lle|llt|.neqv.|.not.)\\b"
- statement: "(?i)\\b(or|and|repeat|select|case|then|where|while|import)\\b"
- special: "(?i)\\b(continue|cycle|exit|go?to|result|return)\\b"
#Operator Color
- symbol.operator: "[.:;,+*|=!\\%]|/|-|>|<|&"
#Parenthetical Color
- symbol.bracket: "[(){}]|\\[|\\]"
# Add preprocessor commands.
- preproc: "^[[:space:]]*#[[:space:]]*(define|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "!"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,14 @@
filetype: freebsd-kernel
detect:
filename: "GENERIC$"
rules:
- identifier: "^(cpu|ident|options|makeoptions|device|include)"
- statement: "\\s\\S*"
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,48 @@
filetype: fsharp
detect:
filename: "\\.fs?$"
rules:
- identifier: "\\b[A-Z][0-9a-z_]{2,}\\b"
#declarations
- statement: "\\b(let|val|method|in|and|rec|private|virtual|constraint)\\b"
#structure items
- type: "\\b(type|open|class|module|exception|external)\\b"
#patterns
- statement: "\\b(fun|function|functor|match|try|with)\\b"
#patterns-modifiers
- statement: "\\b(as|when|of)\\b"
#conditions
- statement: "\\b(if|then|else)\\b"
#blocs
- type: "\\b(begin|end|object|struct|sig|for|while|do|done|to|downto)\\b"
#constantes
- constant.bool: "\\b(true|false)\\b"
#modules/classes
- special: "\\b(include|inherit|initializer)\\b"
#expr modifiers
- special: "\\b(new|ref|mutable|lazy|assert|raise)\\b"
#keywords which don't exist in ocaml
- type: "\\b(base|delegate|downcast|extern|finally|fixed|global|inline|interface|internal|let!|member|namespace|null|override|private|public)\\b"
- type: "\\b(return|return!|select|static|upcast|use|use!|void|yield|yield!)\\b"
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "%."
- constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "%."
- constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
- comment:
start: "\\(\\*"
end: "\\*\\)"
rules: []

View File

@@ -0,0 +1,61 @@
filetype: gdscript
detect:
filename: "\\.gd$"
rules:
# Built-in constants
- constant: "\\b(INF|NAN|PI|TAU)\\b"
- constant.bool: "\\b(null|true|false)\\b"
# Built-in functions
- identifier: "\\b(abs|acos|asin|atan|atan2|ceil|clamp|convert|cos|cosh|db2linear|decimals|deg2rad|ease|exp|float|floor|fmod|fposmod|hash|int|isinf|isnan|lerp|linear2db|load|log|max|min|nearest_po2|pow|preload|print|printerr|printraw|prints|printt|rad2deg|rand_range|rand_seed|randomize|randi|randf|range|round|seed|sin|slerp|sqrt|str|str2var|tan|typeof|var2str|weakref)\\b"
# Built-in node names
- identifier: "\\b(AnimationPlayer|AnimationTreePlayer|Button|Control|Engine|HTTPClient|HTTPRequest|Input|InputEvent|MainLoop|Node|Node2D|OS|SceneTree|Spatial|StreamPeer|PacketPeer|PacketPeerUDP|Timer|Tween)\\b"
# Types
- type: "\\b(AABB|Array|Basis|Color|Dictionary|NodePath|Object|Plane|PoolByteArray|PoolColorArray|PoolIntArray|PoolRealArray|PoolVector2Array|PoolVector3Array|Quat|Rect2|RID|String|Transform|Transform2D|Vector2|Vector3)\\b"
# Definitions
- identifier: "func [a-zA-Z_0-9]+"
# Keywords
- statement: "\\b(and|as|assert|break|breakpoint|class|const|continue|elif|else|enum|export|extends|for|func|if|in|is|map|master|mastersync|match|not|onready|or|pass|remote|remotesync|return|self|setget|slave|slavesync|signal|sync|tool|var|while|yield)\\b"
# Operators
- statement: "[.:;,+*|=!\\%@]|<|>|/|-|&"
# Parentheses
- statement: "[(){}]|\\[|\\]"
# Numbers
- constant: "\\b[0-9]+\\b"
- constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b|'.'"
- comment:
start: "\"\"\""
end: "\"\"\""
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "'''"
end: "'''"
rules:
- todo: "(TODO|XXX|FIXME):?"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,19 @@
filetype: gemini
detect:
filename: "\\.(gmi|gemini)$"
rules:
# link lines
- constant: "^=>[[:space:]].*"
# preformatted text lines
- special:
start: "^```"
end: "^```"
rules: []
# heading lines
- special: "^#{1,3}.*"
# unordered list items
- identifier: "^\\*[[:space:]]"
# quote lines
- statement: "^>.*"

View File

@@ -0,0 +1,48 @@
filetype: ebuild
detect:
filename: "\\.e(build|class)$"
rules:
# All the standard portage functions
- identifier: "^src_(unpack|compile|install|test)|^pkg_(config|nofetch|setup|(pre|post)(inst|rm))"
# Highlight bash related syntax
- statement: "\\b(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while|continue|break)\\b"
- statement: "(\\{|\\}|\\(|\\)|\\;|\\]|\\[|`|\\\\|\\$|<|>|!|=|&|\\|)"
- statement: "-(e|d|f|r|g|u|w|x|L)\\b"
- statement: "-(eq|ne|gt|lt|ge|le|s|n|z)\\b"
# Highlight variables ... official portage ones in red, all others in bright red
- preproc: "\\$\\{?[a-zA-Z_0-9]+\\}?"
- special: "\\b(ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|FILESDIR|WORKDIR|(P|R)?DEPEND|PROVIDE|DISTDIR|RESTRICT|USERLAND)\\b"
- special: "\\b(S|D|T|PV|PF|P|PN|A)\\b|\\bC(XX)?FLAGS\\b|\\bLDFLAGS\\b|\\bC(HOST|TARGET|BUILD)\\b"
# Highlight portage commands
- identifier: "\\buse(_(with|enable))?\\b [!a-zA-Z0-9_+ -]*|inherit.*"
- statement: "\\be(begin|end|conf|install|make|warn|infon?|error|log|patch|new(group|user))\\b"
- statement: "\\bdie\\b|\\buse(_(with|enable))?\\b|\\binherit\\b|\\bhas\\b|\\b(has|best)_version\\b|\\bunpack\\b"
- statement: "\\b(do|new)(ins|s?bin|doc|lib(\\.so|\\.a)|man|info|exe|initd|confd|envd|pam|menu|icon)\\b"
- statement: "\\bdo(python|sed|dir|hard|sym|html|jar|mo)\\b|\\bkeepdir\\b"
- statement: "prepall(docs|info|man|strip)|prep(info|lib|lib\\.(so|a)|man|strip)"
- statement: "\\b(doc|ins|exe)into\\b|\\bf(owners|perms)\\b|\\b(exe|ins|dir)opts\\b"
# Highlight common commands used in ebuilds
- type: "\\bmake\\b|\\b(cat|cd|chmod|chown|cp|echo|env|export|grep|let|ln|mkdir|mv|rm|sed|set|tar|touch|unset)\\b"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,23 @@
filetype: etc-portage
detect:
filename: "\\.(keywords|mask|unmask|use)(/.+)?$"
rules:
# Use flags:
- constant.bool.false: "[[:space:]]+\\+?[a-zA-Z0-9_-]+"
- constant.bool.true: "[[:space:]]+-[a-zA-Z0-9_-]+"
# Likely version numbers:
- special: "-[[:digit:]].*([[:space:]]|$)"
# Accepted arches:
- identifier.class: "[~-]?\\b(alpha|amd64|arm|hppa|ia64|mips|ppc|ppc64|s390|sh|sparc|x86|x86-fbsd)\\b"
- identifier.class: "[[:space:]][~-]?\\*"
# Categories:
- statement: "^[[:space:]]*.*/"
# Masking regulators:
- symbol: "^[[:space:]]*(=|~|<|<=|=<|>|>=|=>)"
# Comments:
- comment:
start: "#"
end: "$"
rules: []

View File

@@ -0,0 +1,35 @@
filetype: git-commit
detect:
filename: '^(.*[\\/])?(COMMIT_EDITMSG|TAG_EDITMSG|MERGE_MSG)$'
rules:
# File changes
- type.keyword: "#[[:space:]](deleted|modified|new file|renamed):[[:space:]].*"
- type.keyword: "#[[:space:]]deleted:"
- type.keyword: "#[[:space:]]modified:"
- type.keyword: "#[[:space:]]new file:"
- type.keyword: "#[[:space:]]renamed:"
- type.keyword: "^#[[:space:]]Changes.*[:]"
- type.keyword: "^#[[:space:]]Your branch and '[^']+"
- type.keyword: "^#[[:space:]]Your branch and '"
- type.keyword: "^#[[:space:]]On branch [^ ]+"
- type.keyword: "^#[[:space:]]On branch"
# Color keywords for closing issues (such as on Github)
- type.keyword: "\\b(?i)((fix(es|ed)?|close(s|d)?) #[0-9]+)\\b"
# Comments
- comment.line:
start: "^#"
end: "$"
rules: []
# Diffs (i.e. git commit --verbose)
- default:
start: "^diff --git"
# Diff output puts a space before file contents on each line so this
# should never match valid diff output and extend highlighting to the
# end of the file
end: "^ENDOFFILE"
rules:
- include: "patch"

View File

@@ -0,0 +1,14 @@
filetype: git-config
detect:
filename: 'git(config|modules)$|^(.*[\\/])?\.?git[\\/]config$'
rules:
- constant: "\\<(true|false)\\>"
- type.keyword: "^[[:space:]]*[^=]*="
- constant: "^[[:space:]]*\\[.*\\]$"
- constant: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'"
- comment:
start: "#"
end: "$"
rules: []

View File

@@ -0,0 +1,19 @@
filetype: git-rebase-todo
detect:
filename: '^(.*[\\/])?git\-rebase\-todo$'
rules:
# Rebase commands
- statement: "^(p(ick)?|r(eword)?|e(dit)?|s(quash)?|f(ixup)?|x|exec|b(reak)?|d(rop)?|l(abel)?|t|reset|m(erge)?)\\b"
# Commit IDs
- identifier: "\\b([0-9a-fA-F]{7,40})\\b"
# Color keywords for Github (and others)
- type.keyword: "\\b(?i)((fix(es|ed)?|close(s|d)?) #[0-9]+)\\b"
# Comments
- comment.line:
start: "^#"
end: "$"
rules: []

View File

@@ -0,0 +1,69 @@
filetype: gleam
detect:
filename: "\\.gleam$"
rules:
- identifier: "\\b[a-z][a-z0-9_]*\\b"
- statement: "\\b(as|assert|auto|case|const|delegate|derive|echo|else|fn|if|implement|import|let|macro|opaque|panic|pub|test|todo|type|use)\\b"
- type: "\\b[A-Z][a-zA-Z0-9_]*\\b"
- type: "\\b(Int|Float|String|Bool|List|Option|Result|BitArray)\\b"
- constant: "\\b(True|False|Nil)\\b"
- preproc: "@[a-z][a-z_]*"
- statement: "(\\|>|->|<-)"
- statement: "(\\.\\.|<>)"
- statement: "(==|!=|<=\\.|>=\\.|<\\.|>\\.|<=|>=)"
- statement: "(&&|\\|\\|)"
- statement: "(\\+\\.|-\\.|\\*\\.|/\\.|\\+|-|\\*|/|%)"
- statement: "(=|<|>|!|<<|>>)"
- constant.number: "\\b0b[01](_?[01])*\\b"
- constant.number: "\\b0o[0-7](_?[0-7])*\\b"
- constant.number: "\\b0x[0-9a-fA-F](_?[0-9a-fA-F])*\\b"
- constant.number: "\\b[0-9](_?[0-9])*(\\.[0-9](_?[0-9])*)?([eE][+-]?[0-9](_?[0-9])*)?\\b"
- default:
start: "#\\("
end: "\\)"
limit-group: special
rules:
- identifier: "\\b[a-z][a-z0-9_]*\\b"
- statement: "\\b(as|assert|auto|case|const|delegate|derive|echo|else|fn|if|implement|import|let|macro|opaque|panic|pub|test|todo|type|use)\\b"
- type: "\\b[A-Z][a-zA-Z0-9_]*\\b"
- type: "\\b(Int|Float|String|Bool|List|Option|Result|BitArray)\\b"
- constant: "\\b(True|False|Nil)\\b"
- statement: "(\\|>|->|<-)"
- statement: "(\\.\\.|<>)"
- statement: "(==|!=|<=\\.|>=\\.|<\\.|>\\.|<=|>=)"
- statement: "(&&|\\|\\|)"
- statement: "(\\+\\.|-\\.|\\*\\.|/\\.|\\+|-|\\*|/|%)"
- statement: "(=|<|>|!|<<|>>)"
- constant.number: "\\b0b[01](_?[01])*\\b"
- constant.number: "\\b0o[0-7](_?[0-7])*\\b"
- constant.number: "\\b0x[0-9a-fA-F](_?[0-9a-fA-F])*\\b"
- constant.number: "\\b[0-9](_?[0-9])*(\\.[0-9](_?[0-9])*)?([eE][+-]?[0-9](_?[0-9])*)?\\b"
- constant.string:
start: '"'
end: '"'
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: '"'
end: '"'
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|FIXME|XXX):?"

View File

@@ -0,0 +1,26 @@
filetype: glsl
detect:
filename: "\\.(frag|vert|fp|vp|glsl)$"
rules:
- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[()]"
- type: "\\b(void|bool|bvec2|bvec3|bvec4|int|ivec2|ivec3|ivec4|float|vec2|vec3|vec4|mat2|mat3|mat4|struct|sampler1D|sampler2D|sampler3D|samplerCUBE|sampler1DShadow|sampler2DShadow)\\b"
- identifier: "\\bgl_(DepthRangeParameters|PointParameters|MaterialParameters|LightSourceParameters|LightModelParameters|LightModelProducts|LightProducts|FogParameters)\\b"
- statement: "\\b(const|attribute|varying|uniform|in|out|inout|if|else|return|discard|while|for|do)\\b"
- statement: "\\b(break|continue)\\b"
- constant.bool: "\\b(true|false)\\b"
- symbol.operator: "[-+/*=<>?:!~%&|^]"
- constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b"
- comment:
start: "//"
end: "$"
rules:
- todo: "TODO:?"
- comment:
start: "/\\*"
end: "\\*/"
rules:
- todo: "TODO:?"

View File

@@ -0,0 +1,15 @@
filetype: gnuplot
detect:
filename: "\\.(gnu|gpi|plt|gp)$"
rules:
- statement: "\\b(set|unset|plot|splot|replot|if|else|do|for|while|fit)\\b"
- symbol.operator: "[-+/*=<>?:!~%&|^$]"
- constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b"
- comment:
start: "#"
end: "$"
rules:
- todo: "TODO:?"

View File

@@ -0,0 +1,62 @@
filetype: go
detect:
filename: "\\.go$"
rules:
# Conditionals and control flow
- special: "\\b(break|case|continue|default|go|goto|range|return|println|fallthrough)\\b"
- statement: "\\b(else|for|if|switch|select)\\b"
- preproc: "\\b(package|import|const|var|type|struct|func|defer|iota|make|new|copy|len|cap|panic|append|close|delete|print|recover)\\b"
- symbol.operator: "[-+/*=<>!~%&|^]|:="
# Types
- symbol: "(,|\\.)"
- type: "\\b(u?int(8|16|32|64)?|float(32|64)|complex(64|128))\\b"
- type: "\\b(uintptr|byte|rune|string|interface|bool|map|chan|error)\\b"
- type.keyword: "\\b(struct)\\b"
- constant.bool: "\\b(true|false|nil)\\b"
# Brackets
- symbol.brackets: "(\\{|\\})"
- symbol.brackets: "(\\(|\\))"
- symbol.brackets: "(\\[|\\])"
# Numbers and strings
- constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b|'.'"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "%."
- constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- error: "..+"
- constant.specialChar: "%."
- constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
- constant.string:
start: "`"
end: "`"
rules: []
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "/\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,17 @@
# godoc
# example: go doc -all | micro
filetype: godoc
detect:
filename: "\\.godoc$"
header: package.*import
rules:
- preproc: "^[^ ].*"
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,73 @@
filetype: golo
detect:
filename: "\\.golo$"
rules:
- type: "\\b(function|fun|)\\b"
- type: "\\b(struct|DynamicObject|union|AdapterFabric|Adapter|DynamicVariable|Observable)\\b"
- type: "\\b(list|set|array|vector|tuple|map)\\b"
- type: "\\b(Ok|Error|Empty|None|Some|Option|Result|Result.ok|Result.fail|Result.error|Result.empty|Optional.empty|Optional.of)\\b"
- identifier.class: "\\b(augment|pimp)\\b"
- identifier.class: "\\b(interfaces|implements|extends|overrides|maker|newInstance)\\b"
- identifier.class: "\\b(isEmpty|isNone|isPresent|isSome|iterator|flattened|toList|flatMap|`and|orElseGet|`or|toResult|apply|either)\\b"
- identifier.class: "\\b(result|option|trying|raising|nullify|catching)\\b"
- identifier.class: "\\b(promise|setFuture|failedFuture|all|any)\\b"
- identifier.class: "\\b(initialize|initializeWithinThread|start|future|fallbackTo|onSet|onFail|cancel|enqueue)\\b"
- identifier.class: "\\b(println|print|raise|readln|readPassword|secureReadPassword|requireNotNull|require|newTypedArray|range|reversedRange|mapEntry|asInterfaceInstance|asFunctionalInterface|isClosure|fileToText|textToFile|fileExists|currentDir|sleep|uuid|isArray|arrayTypeOf|charValue|intValue|longValue|doubleValue|floatValue|removeByIndex|box)\\b"
- identifier.class: "\\b(likelySupported|reset|bold|underscore|blink|reverse_video|concealed|fg_black|fg_red|fg_green|fg_yellow|fg_blue|fg_magenta|fg_cyan|fg_white|bg_black|bg_red|bg_green|bg_yellow|bg_blue|bg_magenta|bg_cyan|bg_white|cursor_position|cursor_save_position|cursor_restore_position|cursor_up|cursor_down|cursor_forward|cursor_backward|erase_display|erase_line)\\b"
- identifier.class: "\\b(emptyList|cons|lazyList|fromIter|generator|repeat|iterate)\\b"
- identifier.class: "\\b(asLazyList|foldl|foldr|take|takeWhile|drop|dropWhile|subList)\\b"
- identifier.class: "\\b(import)\\b"
- identifier.class: "\\b(module)\\b"
- identifier.class: "\\b(JSON)\\b"
- identifier.class: "\\b(stringify|parse|toJSON|toDynamicObject|updateFromJSON)\\b"
- identifier.class: "\\b(newInstance|define|getKey|getValue|properties|fallback)\\b"
- identifier.class: "\\b(times|upTo|downTo)\\b"
- identifier.class: "\\b(format|toInt|toInteger|toDouble|toFloat|toLong)\\b"
- identifier.class: "\\b(head|tail|isEmpty|reduce|each|count|exists)\\b"
- identifier.class: "\\b(newWithSameType|destruct|append|add|addIfAbsent|prepend|insert|last|unmodifiableView|find|filter|map|join|reverse|reversed|order|ordered|removeAt|include|exclude|remove|delete|has|contains|getOrElse|toArray)\\b"
- identifier.class: "\\b(add|addTo|succ|pred|mul|neg|sub|rsub|div|rdiv|mod|rmod|pow|rpow|str|lt|gt|eq|ne|ge|le|`and|`or|`not|xor|even|odd|contains|isEmpty|`is|`isnt|`oftype|`orIfNull|fst|snd|getitem|setitem|getter|id|const|False|True|Null|curry|uncurry|unary|spreader|varargs|swapArgs|swapCurry|swapCouple|swap|invokeWith|pipe|compose|io|andThen|until|recur|cond)\\b"
- identifier.class: "\\b(toUpperCase|equals|startsWith)\\b"
- statement: "\\b(if|else|then|when|case|match|otherwise)\\b"
- special: "\\b(with|break|continue|return)\\b"
- error: "\\b(try|catch|finally|throw)\\b"
- identifier: "\\b(super|this|let|var|local)\\b"
- symbol.brackets: "[(){}]|\\[|\\]"
- statement: "\\b(for|while|foreach|in)\\b"
- constant: "\\b(and|in|is|not|or|isnt|orIfNull)\\b"
- constant.bool: "\\b(true|false)\\b"
- constant: "\\b(null|undefined)\\b"
- symbol.operator: "[\\-+/*=<>!~%&|^]|:="
- constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b|'.'"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "----"
end: "----"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,31 @@
filetype: gomod
detect:
filename: "go.mod"
rules:
# URL
- type: "(^|[ \\t])+\\b([a-zA-Z0-9-]+\\.?)+(/[a-zA-Z0-9-_\\.]+)*\\b"
# Keywords
- special: "(^|[ \\t])+\\b(module|go)\\b"
- preproc: "(^|[ \\t])+\\b(toolchain|require|exclude|replace|retract)\\b"
- symbol.operator: "=>"
# Brackets
- type: "(\\(|\\))"
# Go version
- type: "(^|[ \\t])+([0-9]+\\.?)+"
# Version
- constant.string: "(^|[ \\t])+v([0-9]+\\.?){3}.*"
- constant.number: "(^|[ \\t])+v([0-9]+\\.?){3}"
- comment:
start: "//"
end: "$"
rules:
- todo: "(indirect):?"
# (^|[ \\t])+ means after start of string or space or tab character

View File

@@ -0,0 +1,47 @@
filetype: graphql
detect:
filename: "\\.(gql|graphql)$"
rules:
- type: "\\b(?:(query|mutation|subscription|type|input|scalar|fragment|schema|union|on|extends?))\\b"
# scalar types
- statement: "\\b(ID|Int|Float|Boolean|String|Datetime|Null)\\b"
# introspection types
- statement: "(__\\w+)"
# parameters
- statement: "((\\w+)(?:\\:([\\s]*)?)(?:\\$))"
# directive locations
- statement: "\\b(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"
# directives
- constant: "(@\\w+)"
# root types
- constant: "\\b(Query|Mutation|Subscription|Schema|Root)\\b"
# variables
- special: "(\\$\\w+)"
# required symbol
- special: "(!)"
- symbol: "(:|=|\\||\\(|\\)|\\{|\\}|\\[|\\])"
- constant.bool: "\\b(true|false)\\b"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "#"
end: "$"
rules: []

View File

@@ -0,0 +1,30 @@
filetype: groff
detect:
filename: "\\.m[ems]$|\\.rof|\\.tmac$|^tmac."
rules:
- statement: "^\\.(ds|nr) [^[[:space:]]]*"
- constant.specialChar: "\\\\."
- constant.specialChar: "\\\\f.|\\\\f\\(..|\\\\s(\\+|\\-)?[0-9]"
- constant: "(\\\\|\\\\\\\\)n(.|\\(..)"
- constant:
start: "(\\\\|\\\\\\\\)n\\["
end: "]"
rules: []
- type: "^\\.[[:space:]]*[^[[:space:]]]*"
- comment: "^\\.\\\\\".*$"
- constant.string: "(\\\\|\\\\\\\\)\\*(.|\\(..)"
- constant.string:
start: "(\\\\|\\\\\\\\)\\*\\["
end: "]"
rules: []
- constant.specialChar: "\\\\\\(.."
- constant.specialChar:
start: "\\\\\\["
end: "]"
rules: []
- identifier.macro: "\\\\\\\\\\$[1-9]"

View File

@@ -0,0 +1,111 @@
filetype: groovy
detect:
filename: "(\\.(groovy|gy|gvy|gsh|gradle)$|^[Jj]enkinsfile$)"
header: "^#!.*/(env +)?groovy *$"
rules:
# And the style guide for constants is CONSTANT_CASE
- identifier: "\\b[A-Z_$]+\\b"
# The style guide for JVM languages is PascalCase for classes and interfaces
- identifier.class: "\\b[A-Z][a-zA-Z0-9$]+\\b"
# Primitive types
- type: "\\b(byte|short|int|long|float|double|char|boolean|void)\\b"
# Type-related keywords
- type.keyword: "\\b(private|public|protected|static|final|var|def)\\b"
# Keywords
- statement: "\\b(for|while|do|if|else|switch|case|default|try|catch|finally)\\b"
- statement: "\\b(break|continue|return|throw|assert)\\b"
- statement: "\\b(package|import|class|interface|trait|enum|extends|implements|throws)\\b"
- statement: "\\b(this|super)\\b"
# Unsused, but reserved keywords
- statement: "\\b(goto|const)\\b"
# Operators and punctuation
- symbol.operator: "[-+*/%=<>^~&|!?:;,.@]|\\b(in|is|as|instanceof|new)\\b"
- symbol.brackets: "[(){}]|\\[|\\]"
# Decimal integer literal
- constant.number: "(?i)\\b[1-9]([_0-9]*[0-9])?[GLIDF]?\\b"
# Binary integer literal
- constant.number: "(?i)\\b0b[01]([01_]*[01])?[GLIDF]?\\b"
# Octal integer literal
- constant.number: "(?i)\\b0[0-7]([0-7_]*[0-7])?[GLIDF]?\\b"
# Hexadecimal integer literal
- constant.number: "(?i)\\b0x[0-9a-fA-F]([0-9a-f_]*[0-9a-fA-F])?[GLIDF]?\\b"
# Floating-point literal
- constant.number: "(?i)\\b[0-9]([0-9_]*[0-9])?([.][0-9]([0-9_]*[0-9])?)?(e[+-]?[0-9]([0-9_]*[0-9])?)?[DF]?\\b"
- constant.bool: "\\b(true|false|null)\\b"
# Annotations
- identifier: "@[A-Za-z_$][A-Za-z0-9_$]*\\b"
# Triple-double-quoted strings
- constant.string:
start: "\"\"\""
end: "\"\"\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([\"'bfnrst\\x24\\\\]|u[a-fA-F0-9]{4})"
- identifier.var: "\\x24[\\w\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE]+([.][a-zA-Z0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE]+)*"
- identifier:
start: "[$][{]"
end: "[}]"
rules: []
# Triple-single-quoted strings
- constant.string:
start: "'''"
end: "'''"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([\"'bfnrst\\x24\\\\]|u[a-fA-F0-9]{4})"
# Nesting ${} are never going to be matched correctly with just regex either, so highlighting will break if one is to nest interpolation
# Double-quoted strings
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([\"'bfnrst\\x24\\\\]|u[a-fA-F0-9]{4})"
- identifier.var: "\\x24[\\w\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE]+([.][a-zA-Z0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE]+)*"
- identifier: "\\x24[{].*[}]"
# Single-quoted strings
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([\"'bfnrst\\x24\\\\]|u[a-fA-F0-9]{4})"
# Slashy strings are left out, because they match in unwanted places pretty much all the time
# Dollar-slashy strings
- constant.string:
start: "[$]/"
end: "/[$]"
rules: []
# Single-line comments
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
# Multiline comments
- comment:
start: "/[*]"
end: "[*]/"
rules:
- todo: "(TODO|XXX|FIXME):?"
# Groovydoc comments
- comment:
start: "/[*][*]@?"
end: "[*]/"
rules: []

View File

@@ -0,0 +1,16 @@
filetype: haml
detect:
filename: "\\.haml$"
rules:
- symbol: "-|="
- default: "->|=>"
- constant: "([ ]|^)%[0-9A-Za-z_]+>"
- special: ":[0-9A-Za-z_]+>"
- type: "\\.[A-Za-z_]+>"
- constant.string: "\"([^\"]|(\\\\\"))*\"|%[QW]?\\{[^}]*\\}|%[QW]?\\([^)]*\\)|%[QW]?<[^>]*>|%[QW]?\\$[^$]*\\$|%[QW]?\\^[^^]*\\^|%[QW]?![^!]*!"
- constant.string: "'([^']|(\\\\'))*'|%[qw]\\{[^}]*\\}|%[qw]\\([^)]*\\)|%[qw]<[^>]*>|%[qw]\\[[^]]*\\]|%[qw]\\$[^$]*\\$|%[qw]\\^[^^]*\\^|%[qw]![^!]*!"
- identifier: "#\\{[^}]*\\}"
- identifier.var: "(@|@@)[0-9A-Z_a-z]+"
- comment: "#[^{].*$|#$"

View File

@@ -0,0 +1,52 @@
filetype: hare
detect:
filename: "\\.ha$"
rules:
- identifier: "\\b[A-Z_][0-9A-Z_]+\\b"
- type: "\\b(bool|char|str|rune|void)\\b"
- type: "\\b(f32|f64|uint|int|u8|u16|u32|u64|i8|i16|i32|i64|uintptr)\\b"
- statement: "\\b(case|else|for|if|switch)\\b"
- statement: "\\b(continue|break|return)\\b"
- special: "\\b(as|const|def|defer|enum|export|fn|is|let|match|static|struct|type|union|yield|_)\\b"
- preproc: "\\b(abort|alloc|append|assert|delete|free|insert|len|nullable|offset|size)\\b"
- preproc: "^use .+;"
- preproc: "\\@([a-zA-Z_][0-9a-zA-Z_]+)\\b"
- constant: "\\b(false|null|true)\\b"
- constant.number: "\\b(0x[0-9A-Fa-f]+(i(8|16|32|64)?|u(8|16|32|64)?|z)?)\\b"
- constant.number: "\\b(0o[0-7]+(i(8|16|32|64)?|u(8|16|32|64)?|z)?)\\b"
- constant.number: "\\b(0b[01]+(i(8|16|32|64)?|u(8|16|32|64)?|z)?)\\b"
- constant.specialChar: "\\\".*\\\""
- constant.specialChar: "`.*`"
- constant.specialChar: "'([^'\\\\]|\\\\(0|a|b|f|n|r|t|v|\\\\|'|\\\"|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8}))'"
- symbol.operator: "([.:;,+*|=!\\%]|<|>|/|-|&)"
- symbol.brackets: "[(){}]|\\[|\\]"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- error: "..+"
- constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,52 @@
filetype: haskell
detect:
filename: "\\.hs$"
rules:
- symbol.operator: "[!#$%&:*+/<=>?@.\\\\^\\|~\\p{Sm}\\-]+"
# Identifiers (with or without a module name)
- type: "\\b([A-Z][A-Za-z0-9_]*\\.)*[A-Z]+[A-Za-z0-9_']*\\b"
- default: "\\b([A-Z][A-Za-z0-9_]*\\.)*[a-z][A-Za-z0-9_']*\\b"
- statement: ";"
- symbol.bracket: "[\\(\\)\\[\\]\\{\\}]"
- special: "`[A-Za-z0-9']+`"
# Keywords
- statement: "\\b(case|of|class|data|default|deriving|do|forall|foreign|hiding|if|then|else|import|infix|infixl|infixr|instance|let|in|mdo|module|newtype|qualified|type|where)\\b"
# Data constructors
- constant.bool: "\\b(True|False)\\b"
- constant: "\\b(Nothing|Just|Left|Right|LT|EQ|GT)\\b"
- constant: "\\(\\)" # Unit
- constant.number: "\\b(0[xX][0-9A-Fa-f]+|0[oO][0-7]+|0[bB][01]+|[-]?[0-9]+([.][0-9]+)?([eE][+-]?[0-9]+)?)\\b"
# Data classes
- identifier.class: "\\b(Additive|Applicative|Bounded|Data|Enum|Eq|Floating|Foldable|Fractional|Functor|Integral|Monad|MonadPlus|Monoid|Num|Ord|Read|Real|RealFloat|RealFrac|Semigroup|Show|Traversable|Typeable|Zip)[ ]"
# Strings
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- special: "\\\\&"
- constant.specialChar: "\\\\([abfnrtv\"'\\\\]|[0-9]+|x[0-9a-fA-F]+|o[0-7]+|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC[1-4]|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL)"
# Comments
- comment:
start: "--"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "\\{-"
end: "-\\}"
rules:
- todo: "(TODO|XXX|FIXME):?"
- identifier.macro: "undefined"

View File

@@ -0,0 +1,52 @@
filetype: hc
detect:
filename: "(\\.(hc|HC)$|\\.(hh|HH)$|\\.ii?$|\\.(def)$)"
rules:
- identifier: "\\b[A-Z_][0-9A-Z_]+\\b"
- type: "\\b(F64|I8|U8|I16|U16|I32|U32|I64|U64|sizeof|enum|U0|static|extern|struct|union|class|intern|public|argc|argv|asm)\\b"
- statement: "\\b(for|if|while|do|else|case|default|switch)\\b"
- statement: "\\b(try|catch|throw|goto|continue|break|return)\\b"
- preproc: "^[[:space:]]*#[[:space:]]*(define|pragma|include|(un|ifn?)def|endif|el(if|se)|if|help_index|ifjit|ifaot|exe)"
# Operator Color
- symbol.operator: "([.:;,+*|=!\\%]|<|>|/|-|&)"
- symbol.brackets: "[(){}]|\\[|\\]"
# Integer Constants
- constant.number: "(\\b([1-9][0-9]*|0[0-7]*|0[Xx][0-9A-Fa-f]+|0[Bb][01]+)([Uu]?[Ll][Ll]?|[Ll][Ll]?[Uu]?)?\\b)"
# Decimal Floating Constants
- constant.number: "(\\b(([0-9]*[.][0-9]+|[0-9]+[.][0-9]*)([Ee][+-]?[0-9]+)?|[0-9]+[Ee][+-]?[0-9]+)[FfLl]?\\b)"
# Hexadecimal Floating Constants
- constant.number: "(\\b0[Xx]([0-9A-Za-z]*[.][0-9A-Za-z]+|[0-9A-Za-z]+[.][0-9A-Za-z]*)[Pp][+-]?[0-9]+[FfLl]?\\b)"
- constant.number: "NULL"
- constant.number: "TRUE"
- constant.number: "FALSE"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- error: "..+"
- constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "/\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,70 @@
filetype: html
detect:
filename: "\\.htm[l]?$"
rules:
# Doctype is case-insensitive
- preproc: "<!(?i)(DOCTYPE html.*)>"
# Opening tag
- symbol.tag:
start: "<(a|abbr|acronym|address|applet|area|article|aside|audio|b|base|bdi|bdo|big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|dialog|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frame|frameset|h[1-6]|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|main|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|section|select|small|source|span|strike|strong|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|wbr)\\b"
end: ">"
rules:
- identifier: "\\b(placeholder|style|alt|bgcolor|height|href|id|(aria|data)\\-.+|label|longdesc|name|on(click|focus|load|mouseover)|size|span|src|target|type|value|width|class|charset|content|rel|integrity|crossorigin|for|onsubmit|lang|role)\\b"
- special: "\\b(required)\\b"
# Match double-quote strings
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string.url: "((ftp(s)?|http(s)?|git|chrome)://[^\\s]+)"
# Match single-quote strings
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string.url: "((ftp(s)?|http(s)?|git|chrome)://[^\\s]+)"
# Highlight the equals and any colon between words
- symbol: "\\b(=|:\\b)"
# Closing tag
- symbol.tag:
start: "</(a|abbr|acronym|address|applet|area|article|aside|audio|b|base|bdi|bdo|big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|dialog|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frame|frameset|h[1-6]|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|main|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|section|select|small|source|span|strike|strong|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|wbr)\\b"
end: ">"
rules:
# Anything in the closing tag is an error
- error: "."
# Reserved entities like a&#12; &nbsp; and &#x12A;
- special: "(([a-zA-Z]&#[0-9]+|&[a-zA-Z]+|&#[a-zA-Z0-9]+);)"
# TODO: Add `limit-rules` to both the `default` rules below once it's implemented into Micro
- default:
start: "<script.*?>"
end: "</script.*?>"
limit-group: symbol.tag
rules:
- include: "javascript"
- default:
start: "<style.*?>"
end: "</style.*?>"
limit-group: symbol.tag
rules:
- include: "css"
# This weird empty comment thing is technically valid
- comment: "<!>"
- comment.block:
start: "<!\\-\\-"
end: "\\-\\->"
rules:
- todo: "(FIXME|NOTE|TODO):?"
# While technically not a "true" error, these are recommended to not be used inside a comment
- error: "(\\-\\-|>)"

View File

@@ -0,0 +1,25 @@
filetype: html4
detect:
filename: "\\.htm[l]?4$"
header: "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN|http://www.w3.org/TR/html4/strict.dtd\">"
rules:
- error: "<[^!].*?>"
- symbol.tag: "(?i)<[/]?(a(bbr|cronym|ddress|pplet|rea|rticle|side|udio)?|b(ase(font)?|d(i|o)|ig|lockquote|r)?|ca(nvas|ption)|center|cite|co(de|l|lgroup)|d(ata(list)?|d|el|etails|fn|ialog|ir|l|t)|em(bed)?|fieldset|fig(caption|ure)|font|form|(i)?frame|frameset|h[1-6]|hr|i|img|in(put|s)|kbd|keygen|label|legend|li(nk)?|ma(in|p|rk)|menu(item)?|met(a|er)|nav|no(frames|script)|o(l|pt(group|ion)|utput)|p(aram|icture|re|rogress)?|q|r(p|t|uby)|s(trike)?|samp|se(ction|lect)|small|source|span|strong|su(b|p|mmary)|textarea|time|track|u(l)?|var|video|wbr)( .*|>)*?>"
- symbol.tag.extended: "(?i)<[/]?(body|div|html|head(er)?|footer|title|table|t(body|d|h(ead)?|r|foot))( .*)*?>"
- preproc: "(?i)<[/]?(script|style)( .*)*?>"
- special: "&[^;[[:space:]]]*;"
- symbol: "[:=]"
- identifier: "(alt|bgcolor|height|href|id|label|longdesc|name|on(click|focus|load|mouseover)|size|span|src|style|target|type|value|width)="
- constant.string: "\"[^\"]*\""
- constant.number: "(?i)#[0-9a-fA-F]{6,6}"
- default:
start: ">"
end: "<"
rules: []
- symbol.tag: "<|>"
- constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+"
- comment: "<!--.+?-->"
- preproc: "<!DOCTYPE.+?>"

View File

@@ -0,0 +1,25 @@
filetype: html5
detect:
filename: "\\.htm[l]?5$"
header: "<!DOCTYPE html5>"
rules:
- error: "<[^!].*?>"
- symbol.tag: "(?i)<[/]?(a|a(bbr|ddress|rea|rticle|side|udio)|b|b(ase|d(i|o)|lockquote|r|utton)|ca(nvas|ption)|center|cite|co(de|l|lgroup)|d(ata|atalist|d|el|etails|fn|ialog|l|t)|em|embed|fieldset|fig(caption|ure)|form|iframe|h[1-6]|hr|i|img|in(put|s)|kbd|keygen|label|legend|li|link|ma(in|p|rk)|menu|menuitem|met(a|er)|nav|noscript|o(bject|l|pt(group|ion)|utput)|p|param|picture|pre|progress|q|r(p|t|uby)|s|samp|se(ction|lect)|small|source|span|strong|su(b|p|mmary)|textarea|time|track|u|ul|var|video|wbr)( .*)*?>"
- symbol.tag.extended: "(?i)<[/]?(body|div|html|head(er)?|footer|title|table|t(body|d|h(ead)?|r|foot))( .*)*?>"
- preproc: "(?i)<[/]?(script|style)( .*)*?>"
- special: "&[^;[[:space:]]]*;"
- symbol: "[:=]"
- identifier: "(alt|bgcolor|height|href|id|label|longdesc|name|on(click|focus|load|mouseover)|size|span|src|style|target|type|value|width)="
- constant.string: "\"[^\"]*\""
- constant.number: "(?i)#[0-9a-fA-F]{6,6}"
- default:
start: ">"
end: "<"
rules: []
- symbol.tag: "<|>"
- constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+"
- comment: "<!--.+?-->"
- preproc: "<!DOCTYPE.+?>"

View File

@@ -0,0 +1,23 @@
filetype: ini
detect:
filename: "\\.(ini|desktop|lfl|override|tscn|tres)$|(mimeapps\\.list|pinforc|setup\\.cfg|project\\.godot)$|weechat/.+\\.conf$"
rules:
- constant.bool.true: "\\btrue\\b"
- constant.bool.false: "\\bfalse\\b"
- identifier: "^[[:space:]]*[^=]*="
- special: "^[[:space:]]*\\[.*\\]$"
- statement: "[=;]"
- constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'"
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: ";"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,14 @@
filetype: inputrc
detect:
filename: "inputrc$"
rules:
- constant.bool.false: "\\b(off|none)\\b"
- constant.bool.true: "\\bon\\b"
- preproc: "\\bset|\\$include\\b"
- constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'"
- constant.specialChar: "\\\\.?"
- comment: "(^|[[:space:]])#([^{].*)?$"
- indent-char.whitespace: "[[:space:]]+$"
- indent-char: " + +| + +"

View File

@@ -0,0 +1,37 @@
filetype: java
detect:
filename: "\\.java$"
rules:
- type: "\\b(boolean|byte|char|double|float|int|long|new|var|short|this|transient|void)\\b"
- statement: "\\b(break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\\b"
- type: "\\b(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\\b"
- constant: "\\b(true|false|null)\\b"
- constant.number: "\\b[0-9]+\\b"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- preproc: "..+"
- constant.specialChar: "\\\\."
- comment:
start: "//"
end: "$"
rules: []
- comment:
start: "/\\*"
end: "\\*/"
rules: []

View File

@@ -0,0 +1,76 @@
filetype: javascript
detect:
filename: "(\\.(m|c)?js$|\\.es[5678]?$)"
header: "^#!.*/(env +)?node( |$)"
rules:
- constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b"
- constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
- constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
#- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
# ^ this is not correct usage of the identifier color
- symbol.brackets: "[(){}]|\\[|\\]"
- symbol.operator: "([-+/*=<>!~%?:&|]|[.]{3})"
- statement: "\\b(async|await|break|case|catch|const|continue|debugger|default)\\b"
- statement: "\\b(delete|do|else|export|finally|for|function\\*?|class|extends)\\b"
- statement: "\\b(get|if|import|from|in|of|instanceof|let|new|reject|resolve|return)\\b"
- statement: "\\b(set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\\b"
# reserved but unassigned
- error: "\\b(enum|implements|interface|package|private|protected|public)\\b"
- constant: "\\b(globalThis|Infinity|null|undefined|NaN)\\b"
- constant: "\\b(null|undefined|NaN)\\b"
- constant: "\\b(true|false)\\b"
- type: "\\b(Array|Boolean|Date|Enumerator|Error|Function|Generator|Map|Math)\\b"
- type: "\\b(Number|Object|Promise|Proxy|Reflect|RegExp|Set|String|Symbol|WeakMap|WeakSet)\\b"
- type: "\\b(BigInt64Array|BigUint64Array|Float32Array|Float64Array|Int16Array)\\b"
# - constant: "/[^*]([^/]|(\\\\/))*[^\\\\]/[gim]*"
- constant: "\\\\[0-7][0-7]?[0-7]?|\\\\x[0-9a-fA-F]+|\\\\[bfnrt'\"\\?\\\\]"
- comment: "^#!.*/(env +)?node( |$)"
- identifier: "\\b(alert|decodeURI|decodeURIComponent|document|encodeURI|encodeURIComponent|escape|eval|isFinite|isNaN|parseFloat|parseInt|unescape|uneval|window)\\b"
- identifier: "\\b(Intl|WebAssembly)\\b"
- identifier: "\\b(Arguments)\\b"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "`"
end: "`"
rules:
- constant.specialChar: "\\\\."
- identifier: "\\x24\\{.*?\\}"
- constant.bool: "\\b(true|false)\\b"
- constant.bool.false: "\\b(false)\\b"
- constant.bool.true: "\\b(true)\\b"
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME)"
- comment:
start: "/\\*"
end: "\\*/"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
# function documentation
- identifier: "\\s\\*\\s.*"
- todo: "(TODO|XXX|FIXME)"

View File

@@ -0,0 +1,19 @@
filetype: jinja2
rules:
- include: "html"
- special: "({{|}}|{%-?|-?%})"
- default:
start: "({%-?|{{)"
end: "(-?%}|}})"
limit-group: special
rules:
- include: "python"
- statement: "\\b(ignore missing|with(out)? context|block|call|endblock|endcall|endfilter|endfor|endmacro|endraw|endset|extends|filter|for|include|macro|raw|recursive|scoped|set)\\b"
- identifier.builtinfunc: "\\b(attr|batch|capitalize|center|count|d|default|dictsort|e|escape|filesizeformat|first|forceescape|groupby|indent|join|last|length|lower|pprint|random|reject|rejectattr|replace|reverse|safe|select|selectattr|striptags|title|tojson|trim|truncate|unique|upper|urlencode|urlize|wordcount|wordwrap|xmlattr)\\b"
- identifier.builtintest: "\\b(callable|defined|divisibleby|eq|equalto|escaped|even|ge|gt|iterable|le|lower|lt|mapping|ne|none|number|odd|sameas|sequence|string|undefined|upper)\\b"
- identifier.defaultglobal: "\\b(lipsum|cycler|joiner|namespace)\\b"
- comment:
start: "{#"
end: "#}"
rules: []

View File

@@ -0,0 +1,39 @@
filetype: json
detect:
filename: "\\.json$"
header: "^\\{$"
rules:
- constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b"
- constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
- constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
- constant: "\\b(null)\\b"
- constant: "\\b(true|false)\\b"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- statement: "\\\"(\\\\\"|[^\"])*\\\"[[:space:]]*:\" \"'(\\'|[^'])*'[[:space:]]*:"
- constant: "\\\\u[0-9a-fA-F]{4}|\\\\[bfnrt'\"/\\\\]"
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "/\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,92 @@
filetype: jsonnet
detect:
filename: "\\.jsonnet$"
# Spec: https://jsonnet.org/ref/spec.html
rules:
# built-in objects
# FIXME: $ won't match
- constant: "\\b(self|\\$|super)\\b"
# boolean constants
- constant.bool: "\\b(null|true|false)\\b"
# the standard library
- identifier: "\\bstd\\.(extVar|thisFile|type|length|objectHas|objectFields|objectHasAll|objectFieldsAll|prune|mapWithKey|abs|sign|max|min|pow|exp|log|exponent|mantissa|floor|ceil|sqrt|sin|cos|tan|asin|acos|atan|mod|assertEqual|toString|codepoint|char|substr|findSubstr|startsWith|endsWith|split|splitLimit|strReplace|asciiUpper|asciiLower|stringChars|format|escapeStringDollars|escapeStringPython|parseInt|parseOctal|parseHex|parseJson|encodeUTF8|decodeUTF8|manifestIni|manifestPython|manifestPythonVars|manifestJsonEx|manifestYamlDoc|manifestYamlStream|manifestXmlJsonml|makeArray|count|find|map|mapWithIndex|filterMap|filter|foldl|foldr|range|join|lines|flattenArrays|sort|uniq|set|setInter|setUnion|setDiff|setMember|base64|base64DecodeBytes|base64Decode|md5|mergePatch|trace)\\b"
# unquoted object keys
- type: "[_a-zA-Z][_a-zA-Z0-9]*\\s*:"
# object key separator
- statement: ":"
# keywords
- statement: "\\b(assert|else|error|for|function|if|import|importstr|in|local|tailstrict|then)\\b"
# operators
- symbol.operator: "([.;,+*|=!\\%]|<|>|/|-|&)"
# parentheses
- symbol.brackets: "([(){}]|\\[|\\])"
# numbers
- constant.number: "\\b(0|([1-9][0-9]*))(\\.[0-9]+)?([eE][\\+-]?[0-9]+)?\\b"
# double-quoted string
- constant.string:
start: "\""
end: "\""
skip: "\\\\\""
rules:
- constant.specialChar: "\\\\u[0-9a-fA-F]{4}|\\\\[bfnrt'\"/\\\\]"
# single-quoted string
- constant.string:
start: "'"
end: "'"
skip: "\\\\'"
rules:
- constant.specialChar: "\\\\u[0-9a-fA-F]{4}|\\\\[bfnrt'\"/\\\\]"
# double-quoted verbatim string
- constant.string:
start: "@\""
end: "\""
skip: "\\\\\""
rules:
- constant.specialChar: "\\\\\""
# single-quoted verbatim string
- constant.string:
start: "@'"
end: "'"
skip: "\\\\'"
rules:
- constant.specialChar: "\\\\'"
# block string
- constant.string:
# FIXME:
# This isn't quite right.
# The spec says this:
# beginning with |||, followed by optional whitespace and a new-line.
# The next non-blank line must be prefixed with some non-zero length
# whitespace W. The block ends at the first subsequent line that does
# not begin with W, and it is an error if this line does not contain
# some optional whitespace followed by |||.
# We need to match ^(\s+) on the first non-blank line after |||
# Then we need to skip ^\1.*$
start: "\\|\\|\\| *$"
end: "^ *\\|\\|\\|"
rules: []
# multi-line comment
- comment:
start: "/\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"
# single-line comment
- comment:
start: "#|(//)"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,57 @@
filetype: julia
detect:
filename: "\\.jl$"
header: "^#!.*/(env +)?julia( |$)"
rules:
# built-in objects
- constant.bool: "\\b(true|false)\\b"
- constant: "\\b(nothing|missing)\\b"
# built-in attributes
- constant: "__[A-Za-z0-9_]+__"
# definitions
- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
# keywords
- statement: "\\b(baremodule|begin|break|catch|const|continue|do|else|elseif|end|export|finally|for|function|global|if|import|let|local|macro|module|public|quote|return|struct|try|using|while)\\b"
- statement: "\\b(abstract\\s+type|primitive\\s+type|mutable\\s+struct)\\b"
# decorators
- identifier.macro: "@[A-Za-z0-9_]+"
# operators
- symbol.operator: "[:+*|=!%~<>/\\-?&\\\\÷∈∉∘]|\\b(in|isa|where)\\b"
# for some reason having ^ in the same regex with the other operators broke things
- symbol.operator: "\\^"
# parentheses
- symbol.brackets: "([(){}]|\\[|\\])"
# numbers
- constant.number: "\\b([0-9]+(_[0-9]+)*|0x[0-9a-fA-F]+(_[0-9a-fA-F]+)*|0b[01]+(_[01]+)*|0o[0-7]+(_[0-7]+)*|Inf(16|32|64)?|NaN(16|32|64)?)\\b"
- constant.string:
start: "\"\"\""
end: "\"\"\""
rules: []
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{1,4}|U[0-9A-Fa-f]{1,8})"
# Lifted from Rust's syntax highlighting
- constant.string: "'(\\\\.|.)'"
- constant.string:
start: "'\""
end: "'"
rules: []
- comment:
start: "#="
end: "=#"
rules: []
- comment:
start: "#"
end: "$"
rules: []

View File

@@ -0,0 +1,40 @@
# For more information, see https://github.com/casey/just
filetype: 'justfile'
detect:
filename: "(^\\.?[Jj]ustfile|\\.just)$"
header: "^#!.*/(env +)?[bg]?just --justfile"
rules:
- preproc: "\\<(ifeq|ifdef|ifneq|ifndef|else|endif)\\>"
- statement: "^(export|include|override)\\>"
- symbol.operator: "^[^:= ]+:"
- symbol.operator: "([=,%]|\\+=|\\?=|:=|&&|\\|\\|)"
- statement: "\\$\\((abspath|addprefix|addsuffix|and|basename|call|dir)[[:space:]]"
- statement: "\\$\\((error|eval|filter|filter-out|findstring|firstword)[[:space:]]"
- statement: "\\$\\((flavor|foreach|if|info|join|lastword|notdir|or)[[:space:]]"
- statement: "\\$\\((origin|patsubst|realpath|shell|sort|strip|suffix)[[:space:]]"
- statement: "\\$\\((value|warning|wildcard|word|wordlist|words)[[:space:]]"
# default functions - probably shouldn't be overwritten by assignment
- statement: "\\b(arch|os|os_family|env_var|invocation_directory|justfile|justfile_directory|just_executable|lowercase|quote|replace|trim|trim_end|trim_end|trim_end_match|trim_end_matches|trim_start|trim_start_match|trim_start_matches|uppercase)\\b"
- identifier: "^.+:"
- identifier: "[()$]"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- identifier: "\\$+(\\{[^} ]+\\}|\\([^) ]+\\))"
- identifier: "\\$[@^<*?%|+]|\\$\\([@^<*?%+-][DF]\\)"
- identifier: "\\$\\$|\\\\.?"
- comment:
start: "#"
end: "$"
rules: []

View File

@@ -0,0 +1,27 @@
filetype: keymap
detect:
filename: "\\.(k|key)?map$|Xmodmap$"
rules:
- statement: "\\b(add|clear|compose|keycode|keymaps|keysym|remove|string)\\b"
- statement: "\\b(control|alt|shift)\\b"
- constant.number: "\\b[0-9]+\\b"
- special: "="
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "^!"
end: "$"
rules: []

View File

@@ -0,0 +1,16 @@
filetype: kickstart
detect:
filename: "\\.ks$|\\.kickstart$"
rules:
- special: "%[a-z]+"
- statement: "^[[:space:]]*(install|cdrom|text|graphical|volgroup|logvol|reboot|timezone|lang|keyboard|authconfig|firstboot|rootpw|user|firewall|selinux|repo|part|partition|clearpart|bootloader)"
- constant: "--(name|mirrorlist|baseurl|utc)(=|\\>)"
- statement: "\\$(releasever|basearch)\\>"
- brightblack: "^@[A-Za-z][A-Za-z-]*"
- brightred: "^-@[a-zA-Z0-9*-]+"
- red: "^-[a-zA-Z0-9*-]+"
- comment: "(^|[[:space:]])#([^{].*)?$"
- indent-char.whitespace: "[[:space:]]+$"
- indent-char: " + +| + +"

View File

@@ -0,0 +1,66 @@
filetype: kotlin
detect:
filename: "\\.kts?$"
rules:
# Operators
- symbol.operator: ([.:;,+*|=!?\\%]|<|>|/|-|&)
# Statements Keywords
- statement: \b(as|by|class|constructor|companion|const|fun|import|in|infix|interface|inline|is|out|operator|package|return|suspend|super|this|when|val|var)\b
- statement.properties: \b(get|set)\b
- statement.control: \b(break|continue|else|do|if|try|catch|finally|for|while)\b
- statement.class: \b(abstract|annotation|data|enum|final|open|sealed)\b
- statement.member: \b(override|lateinit|init)\b
- statement.access: \b(internal|private|protected|public)\b
- statement.parameter: \b(crossinline|noinline|reified|vararg)\b
# Expression and types
- type: \b(dynamic|object|throw|typealias)\b
# Meta
- statement.meta: \@(\bfile|delegate|field|get|property|receiver|set|setparam|param|)\b
# Constant
- constant: \b(true|false|null)
- constant.number: ([0-9]+)
# Storage Types
- type.storage: \b(Byte|UByte|Char|Double|Float|Int|UInt|Long|ULong|Short|UShort|Boolean|Unit|Nothing)\b
# Collections
- type.collections: \b(Array)\b
# String
- constant.string:
start: \"
end: \"
skip: \\.
rules:
- constant.specialChar: (\\0|\\\\|\\t|\\n|\\r|\\"|\\')
- constant.unicode: \\u\{[[:xdigit:]]+}
# Shebang Line
- comment.shebang: ^(#!).*
# Line Comment
- comment.line: "//.*"
# Block Comment
- comment.block:
start: "/\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"
# Doc Block Comment
- comment.block:
start: "/\\*\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"
# Todo
- todo: "(TODO|XXX|FIXME):?"

View File

@@ -0,0 +1,67 @@
filetype: "kvlang"
detect:
filename: "\\.kv$"
rules:
# layouts
- special: "\\b[a-z].+"
- identifier: "\\b(self|app|root)\\b"
- type: "\\b[A-Z].+"
- type: "\\b(AnchorLayout|BoxLayout|FloatLayout|RelativeLayout|GridLayout|PageLayout|StackLayout)\\b"
- type: "\\b(canvas)\\b"
# functions
- identifier.function: "[a-zA-Z_0-9]+\\("
# built-in functions
- type: "\\b(abs|all|any|ascii|bin|bool|breakpoint|bytearray|bytes)\\b"
- type: "\\b(callable|chr|classmethod|compile|copyright|credits|oct)\\b"
- type: "\\b(delattr|dict|dir|display|divmod|enumerate|eval|filter)\\b"
- type: "\\b(float|format|frozenset|get_ipython|getattr|globals|type)\\b"
- type: "\\b(hash|help|hex|id|input|int|isinstance|issubclass|iter|len)\\b"
- type: "\\b(license|list|locals|map|max|memoryview|min|next|object)\\b"
- type: "\\b(open|ord|pow|print|property|range|repr|reversed|round|set)\\b"
- type: "\\b(setattr|slice|sorted|staticmethod|hasattr|super|tuple|str)\\b"
- type: "\\b(vars|zip|exec|sum|complex)\\b"
# keywords
- statement.built_in: "\\b(and|as|assert|async|await|break|class|continue|def)\\b"
- statement.built_in: "\\b(del|elif|else|except|finally|for|from|global|if)\\b"
- statement.built_in: "\\b(import|in|is|lambda|nonlocal|not|or|pass|raise)\\b"
- statement.built_in: "\\b(return|try|while|with|yield|match|case)\\b"
# operators
- symbol.operator: "([~^.:;,+*|=!\\%]|<|>|/|-|&)"
# parentheses
- symbol.brackets: "([(){}]|\\[|\\])"
# numbers
- constant.number: "\\b[0-9](_?[0-9])*(\\.([0-9](_?[0-9])*)?)?(e[0-9](_?[0-9])*)?\\b" # decimal
- constant.number: "\\b0b(_?[01])+\\b" # bin
- constant.number: "\\b0o(_?[0-7])+\\b" # oct
- constant.number: "\\b0x(_?[0-9a-f])+\\b" # hex
- constant.bool.none: "\\b(None)\\b"
- constant.bool.true: "\\b(True)\\b"
- constant.bool.false: "\\b(False)\\b"
# strings
- constant.string:
start: "\""
end: "(\"|$)"
skip: "\\\\."
rules: []
- constant.string:
start: "'"
end: "('|$)"
skip: "\\\\."
rules: []
- comment:
start: "#"
end: "$"
rules: []

View File

@@ -0,0 +1,14 @@
filetype: ledger
detect:
filename: "(^|\\.|/)(ledger|ldgr|beancount|bnct)$"
rules:
- special: "^([0-9]{4}(/|-)[0-9]{2}(/|-)[0-9]{2}|[=~]) .*"
- constant: "^[0-9]{4}(/|-)[0-9]{2}(/|-)[0-9]{2}"
- statement: "^~ .*"
- identifier.var: "^= .*"
- identifier: "^[[:space:]]+(![[:space:]]+)?\\(?[A-Za-z ]+(:[A-Za-z ]+)*\\)?"
- identifier: "^[[:space:]]+(![[:space:]]+)?\\(?[A-Za-z_\\-]+(:[A-Za-z_\\-]+)*\\)?"
- symbol: "[*!]"
- comment: "^[[:space:]]*;.*"

View File

@@ -0,0 +1,17 @@
filetype: lfe
detect:
filename: "lfe$|\\.lfe$"
rules:
- symbol.brackets: "\\(|\\)"
- type: "defun|define-syntax|define|defmacro|defmodule|export"
- constant: "\\ [A-Za-z][A-Za-z0-9_-]+\\ "
- symbol.operator: "\\(([\\-+*/<>]|<=|>=)|'"
- constant.number: "\\b[0-9]+\\b"
- constant.string: "\\\"(\\\\.|[^\"])*\\\""
- special: "['|`][A-Za-z][A-Za-z0-9_\\-]+"
- constant.specialChar: "\\\\.?"
- comment: "(^|[[:space:]]);.*"
- indent-char.whitespace: "[[:space:]]+$"
- indent-char: " + +| + +"

View File

@@ -0,0 +1,26 @@
filetype: lilypond
detect:
filename: "\\.ly$|\\.ily$|\\.lly$"
rules:
- constant.number: "\\d+"
- identifier: "\\b(staff|spacing|signature|routine|notes|handler|corrected|beams|arpeggios|Volta_engraver|Voice|Vertical_align_engraver|Vaticana_ligature_engraver|VaticanaVoice|VaticanaStaff|Tweak_engraver|Tuplet_engraver|Trill_spanner_engraver|Timing_translator|Time_signature_performer|Time_signature_engraver|Tie_performer|Tie_engraver|Text_spanner_engraver|Text_engraver|Tempo_performer|Tab_tie_follow_engraver|Tab_staff_symbol_engraver|Tab_note_heads_engraver|TabVoice|TabStaff|System_start_delimiter_engraver|Stem_engraver|Stanza_number_engraver|Stanza_number_align_engraver|Staff_symbol_engraver|Staff_performer|Staff_collecting_engraver|StaffGroup|Staff|Spanner_break_forbid_engraver|Span_bar_stub_engraver|Span_bar_engraver|Span_arpeggio_engraver|Spacing_engraver|Slur_performer|Slur_engraver|Slash_repeat_engraver|Separating_line_group_engraver|Script_row_engraver|Script_engraver|Script_column_engraver|Score|Rhythmic_column_engraver|RhythmicStaff|Rest_engraver|Rest_collision_engraver|Repeat_tie_engraver|Repeat_acknowledge_engraver|Pure_from_neighbor_engraver|Pitched_trill_engraver|Pitch_squash_engraver|Piano_pedal_performer|Piano_pedal_engraver|Piano_pedal_align_engraver|PianoStaff|Phrasing_slur_engraver|PetrucciVoice|PetrucciStaff|Percent_repeat_engraver|Part_combine_engraver|Parenthesis_engraver|Paper_column_engraver|Output_property_engraver|Ottava_spanner_engraver|OneStaff|NullVoice|Note_spacing_engraver|Note_performer|Note_name_engraver|Note_heads_engraver|Note_head_line_engraver|NoteName\\|NoteHead|New_fingering_engraver|Multi_measure_rest_engraver|Midi_control_function_performer|Metronome_mark_engraver|Mensural_ligature_engraver|MensuralVoice|MensuralStaff|Mark_engraver|Lyrics|Lyric_performer|Lyric_engraver|Ligature_bracket_engraver|Ledger_line_engraver|Laissez_vibrer_engraver|Kievan_ligature_engraver|KievanVoice|KievanStaff|Key_performer|Key_engraver|Keep_alive_together_engraver|Instrument_switch_engraver|Instrument_name_engraver|Hyphen_engraver|Grob_pq_engraver|GregorianTranscriptionVoice|GregorianTranscriptionStaff|GrandStaff|Grace_spacing_engraver|Grace_engraver|Grace_beam_engraver|Grace_auto_beam_engraver|Global|Glissando_engraver|Fretboard_engraver|FretBoards|Forbid_line_break_engraver|Footnote_engraver|Font_size_engraver|Fingering_engraver|Fingering_column_engraver|Figured_bass_position_engraver|Figured_bass_engraver|FiguredBass|Extender_engraver|Episema_engraver|Dynamics|Dynamic_performer|Dynamic_engraver|Dynamic_align_engraver|Drum_notes_engraver|Drum_note_performer|DrumVoice|DrumStaff|Double_percent_repeat_engraver|Dots_engraver|Dot_column_engraver|Devnull|Default_bar_line_engraver|Custos_engraver|Cue_clef_engraver|CueVoice|Control_track_performer|Concurrent_hairpin_engraver|Collision_engraver|Cluster_spanner_engraver|Clef_engraver|Chord_tremolo_engraver|Chord_name_engraver|ChordNames|ChoirStaff|Breathing_sign_engraver|Break_align_engraver|Bend_engraver|Beam_performer|Beam_engraver|Beam_collision_engraver|Bar_number_engraver|Bar_engraver|Axis_group_engraver|Auto_beam_engraver|Arpeggio_engraver|Accidental_engraver|Score)\\b"
- statement: "[-_^]?\\\\[-A-Za-z_]+"
- preproc: "\\b(((gisis|gis|geses|ges|g|fisis|fis|feses|fes|f|eisis|eis|eeses|ees|e|disis|dis|deses|des|d|cisis|cis|ceses|ces|c|bisis|bis|beses|bes|b|aisis|ais|aeses|aes|a)[,']*[?!]?)|s|r|R|q)(128|64|32|16|8|4|2|1|\\\\breve|\\\\longa|\\\\maxima)?([^\\\\\\w]|_|\\b)"
- special: "[(){}<>]|\\[|\\]"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "%\\{"
end: "%\\}"
rules: []
- comment:
start: "%"
end: "$"
rules: []

View File

@@ -0,0 +1,17 @@
filetype: lisp
detect:
filename: "(emacs|zile)$|\\.(el|li?sp|scm|ss|rkt)$"
rules:
- default: "\\([a-z-]+"
- symbol: "\\(([\\-+*/<>]|<=|>=)|'"
- constant.number: "\\b[0-9]+b>"
- special: "\\bnil\\b"
- preproc: "\\b[tT]b>"
- constant.string: "\\\"(\\\\.|[^\"])*\\\""
- constant.specialChar: "'[A-Za-z][A-Za-z0-9_-]+"
- constant.specialChar: "\\\\.?"
- comment: "(^|[[:space:]]);.*"
- indent-char.whitespace: "[[:space:]]+$"
- indent-char: " + +| + +"

View File

@@ -0,0 +1,92 @@
filetype: log
detect:
filename: "(\\.log|log\\.txt)$"
rules:
- diff-modified: "\\b(WARN(ING)?|[Ww]arn(ing)?|w(r)?n|w|W/)\\b"
- diff-modified: "\\b(CRITICAL|[Cc]ritical)\\b"
- constant: "\\b(INFO(RMATION)?|[Ii]nfo(rmation)?|[Ii]n(f)?|i|I/)\\b"
- constant: "\\b(DEBUG|[Dd]ebug|dbug|dbg|de|d|D/)\\b"
- constant: "\\b(VERBOSE|[Vv]erbose|V/)\\b"
- constant: "\\b(ALERT|[Aa]lert)\\b"
- preproc: "\\b(TRACE|Trace|NOTICE|VERBOSE|verb|vrb|vb|v)\\b"
- gutter-error: "\\b(ERROR|[Ee]rr(or)?|[Ee]r(or)?|e|E\\x2F)\\b"
- gutter-error: "\\b(FATAL|[Ff]atal)\\b"
- gutter-error: "\\b(EMERGENCY|[Ee]mergency)\\b"
- gutter-error: "\\b(FAIL(URE)?|[Ff]ail(ure)?)\\b"
# constants
- constant.bool.true: "\\b(YES|yes|Y|y|ON|on|TRUE|True|true)\\b"
- constant.bool.false: "\\b(NO|no|N|n|OFF|off|FALSE|False|false)\\b"
- constant.bool.false: "\\b(None|null|nil)\\b"
# numbers
- constant.number: "\\b[0-9](_?[0-9])*(\\.([0-9](_?[0-9])*)?)?(e[0-9](_?[0-9])*)?\\b" # decimal
- constant.number: "\\b0b(_?[01])+\\b" # bin
- constant.number: "\\b0o(_?[0-7])+\\b" # oct
- constant.number: "\\b0x(_?[0-9a-f])+\\b" # hex
# operators
- symbol.operator: "([~^.:;,+*|=!\\%]|<|>|/|-|&)"
# parentheses
- symbol.brackets: "([(){}]|\\[|\\])"
# string
- constant.string:
start: "\""
end: "(\"|$)"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "('|$)"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
# file
- preproc: "\\b(FILE|File|file)\\b"
# time
- identifier: "\\b((([Mm]on|[Tt]ues|[Ww]ed(nes)?|[Tt]hur(s)?|[Ff]ri|[Ss]at(ur)?|[Ss]un)(day)?\\s)?([Jj]an(uary)?|[Ff]eb(ruary)?|[Mm]ar(ch)?|[Aa]pr(il)?|[Mm]ay|[Jj]un(e)?|[Jj]ul(y)?|[Aa]ug(ust)?|[Aa]go|[Ss]ep(tember)?|[Oo]ct(ober)?|[Nn]ov(ember)?|[Dd]ec(ember)?)\\s\\d{1,2},?(\\s\\d{4})?)\\b" # date
- identifier: "\\b(\\d{2,4}[-/\\.]?\\d{2,3}[-/\\.]?\\d{2,4})\\b" # date
- identifier: "\\b(\\d{2}:\\d{2}(:\\d{2})?([\\.,]?\\d{1,8}[\\.\\+,]?\\d{1,8}?)?([\\.\\+,]?\\d{1,8}[\\.\\+,]?\\d{1,8}?)?([\\.\\+,]?\\d{1,8}?)?(\\s-\\d{0,4})?)\\b" # time
- identifier: "^([0-2][0-9][0-2][0-9][-/]?[0-9][0-9][-/]?[0-9][0-9])"
# - identifier: "^([0-2][0-9][0-2][0-9][-/]?[0-9][0-9][-/]?[0-9][0-9]\\s[0-9][0-9]:[0-9][0-9](:[0-9][0-9])?(\\.?[0-9][0-9][0-9])?)"
- identifier: "^(\\d{4}[-/]?\\d{2}[-/]?\\d{2}\\s\\d{2}:\\d{2}(:\\d{2})?(\\.?\\d{2,8})?)"
- identifier: "^([0-2][0-9]|[0-2]-?[0-9][0-9]-?[0-9][0-9])\\-([0-1][0-9])\\-([0-3][0-9]) ([0-2][0-9])\\:([0-5][0-9])\\:([0-5][0-9]),([0-9][0-9][0-9])"
# Complete precision:
- identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z))"
# No milliseconds:
- identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))"
# No Seconds:
- identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))"
# Putting it all together:
- identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))"
# Complete precision:
- identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+)"
# No milliseconds
- identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d)"
# No Seconds
- identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d)"
# Putting it all together
- identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+)|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d)|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d)"
# link
- constant.string.url:
start: "https?://"
end: "\\s"
rules: []
# path
# - constant.string.url: "\\b(.+)/([^/]+)\\b" # linux
# - constant.string.url: "\\b(^[a-zA-Z]:)\\b" # windowns
- diff-modified: "([Cc]ommit:)\\s\\w+\\[\\w+]"

View File

@@ -0,0 +1,111 @@
filetype: lua
detect:
filename: "\\.lua$"
rules:
- statement: "\\b(do|end|while|break|repeat|until|if|elseif|then|else|for|in|function|local|return|goto)\\b"
- statement: "\\b(not|and|or)\\b"
- statement: "\\b(debug|string|math|table|io|coroutine|os|utf8|bit32)\\b\\."
- statement: "\\b(_ENV|_G|_VERSION|assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|load|loadfile|module|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\\s*\\("
- identifier: "io\\.\\b(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)\\b"
- identifier: "math\\.\\b(abs|acos|asin|atan2|atan|ceil|cosh|cos|deg|exp|floor|fmod|frexp|huge|ldexp|log10|log|max|maxinteger|min|mininteger|modf|pi|pow|rad|random|randomseed|sin|sqrt|tan|tointeger|type|ult)\\b"
- identifier: "os\\.\\b(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)\\b"
- identifier: "package\\.\\b(config|cpath|loaded|loadlib|path|preload|seeall|searchers|searchpath)\\b"
- identifier: "string\\.\\b(byte|char|dump|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper)\\b"
- identifier: "table\\.\\b(concat|insert|maxn|move|pack|remove|sort|unpack)\\b"
- identifier: "utf8\\.\\b(char|charpattern|codes|codepoint|len|offset)\\b"
- identifier: "coroutine\\.\\b(create|isyieldable|resume|running|status|wrap|yield)\\b"
- identifier: "debug\\.\\b(debug|getfenv|gethook|getinfo|getlocal|getmetatable|getregistry|getupvalue|getuservalue|setfenv|sethook|setlocal|setmetatable|setupvalue|setuservalue|traceback|upvalueid|upvaluejoin)\\b"
- identifier: "bit32\\.\\b(arshift|band|bnot|bor|btest|bxor|extract|replace|lrotate|lshift|rrotate|rshift)\\b"
- identifier: "\\:\\b(close|flush|lines|read|seek|setvbuf|write|byte|char|dump|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper)\\b"
- identifier: "\\b(self|arg)\\b"
- constant: "\\b(false|nil|true)\\b"
- statement: "(\\b(dofile|require|include)|%q|%!|%Q|%r|%x)\\b"
- symbol.brackets: "[(){}\\[\\]]"
- symbol: "(\\*|//|/|%|\\+|-|\\^|>|>=|<|<=|~=|=|[\\.]{2,3}|#)"
- constant.number: "\\b((0[xX](([0-9A-Fa-f]+\\.[0-9A-Fa-f]*)|(\\.?[0-9A-Fa-f]+))([pP][-+]?[0-9]+)?)|((([0-9]+\\.[0-9]*)|(\\.?[0-9]+))([eE][-+]?[0-9]+)?))"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([abfnrtvz\\'\"]|[0-9]{1,3}|x[0-9a-fA-F][0-9a-fA-F]|u\\{[0-9a-fA-F]+\\})"
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([abfnrtvz\\'\"]|[0-9]{1,3}|x[0-9a-fA-F][0-9a-fA-F]|u\\{[0-9a-fA-F]+\\})"
- constant.string:
start: "\\[\\["
end: "\\]\\]"
rules: []
# support first few lengths of "long brackets" explicitly
# brackets longer than that will give false positives
- constant.string:
start: "\\[=\\["
end: "\\]=\\]"
rules: []
- constant.string:
start: "\\[==\\["
end: "\\]==\\]"
rules: []
- constant.string:
start: "\\[===\\["
end: "\\]===\\]"
rules: []
- constant.string:
start: "\\[====+\\["
end: "\\]====+\\]"
rules: []
- comment.block:
start: "\\-\\-\\[\\["
end: "\\]\\]"
rules:
- todo: "(TODO|NOTE|FIXME):?"
# support long brackets, same as with multiline strings
- comment.block:
start: "\\-\\-\\[=\\["
end: "\\]=\\]"
rules:
- todo: "(TODO|NOTE|FIXME):?"
- comment.block:
start: "\\-\\-\\[==\\["
end: "\\]==\\]"
rules:
- todo: "(TODO|NOTE|FIXME):?"
- comment.block:
start: "\\-\\-\\[===\\["
end: "\\]===\\]"
rules:
- todo: "(TODO|NOTE|FIXME):?"
- comment.block:
start: "\\-\\-\\[====+\\["
end: "\\]====+\\]"
rules:
- todo: "(TODO|NOTE|FIXME):?"
# this has to go after block comment or block comment does not work
- comment:
start: "\\-\\-"
end: "$"
rules:
- todo: "(TODO|NOTE|FIXME):?"

View File

@@ -0,0 +1,25 @@
filetype: mail
detect:
filename: "(.*/mutt-.*|\\.eml)$"
header: "^From .* \\d+:\\d+:\\d+ \\d+"
rules:
- type: "^From .*"
- identifier: "^[^[:space:]]+:"
- preproc: "^List-(Id|Archive|Subscribe|Unsubscribe|Post|Help):"
- constant: "^(To|From):"
- constant.string:
start: "^Subject:.*"
end: "$"
rules:
- constant.specialChar: "\\\\."
- statement: "<?[^@[:space:]]+@[^[:space:]]+>?"
- default:
start: "^\\n\\n"
end: ".*"
rules: []
- comment:
start: "^>.*"
end: "$"
rules: []

View File

@@ -0,0 +1,80 @@
//go:build ignore
// +build ignore
package main
import (
"bytes"
"fmt"
"os"
"strings"
"time"
yaml "gopkg.in/yaml.v2"
)
type HeaderYaml struct {
FileType string `yaml:"filetype"`
Detect struct {
FNameRgx string `yaml:"filename"`
HeaderRgx string `yaml:"header"`
SignatureRgx string `yaml:"signature"`
} `yaml:"detect"`
}
type Header struct {
FileType string
FNameRgx string
HeaderRgx string
SignatureRgx string
}
func main() {
if len(os.Args) > 1 {
os.Chdir(os.Args[1])
}
files, _ := os.ReadDir(".")
for _, f := range files {
fname := f.Name()
if strings.HasSuffix(fname, ".yaml") {
convert(fname[:len(fname)-5])
}
}
}
func convert(name string) {
filename := name + ".yaml"
var hdr HeaderYaml
source, err := os.ReadFile(filename)
if err != nil {
panic(err)
}
err = yaml.Unmarshal(source, &hdr)
if err != nil {
panic(err)
}
encode(name, hdr)
}
func encode(name string, c HeaderYaml) {
f, _ := os.Create(name + ".hdr")
f.WriteString(c.FileType + "\n")
f.WriteString(c.Detect.FNameRgx + "\n")
f.WriteString(c.Detect.HeaderRgx + "\n")
f.WriteString(c.Detect.SignatureRgx + "\n")
f.Close()
}
func decode(name string) Header {
start := time.Now()
data, _ := os.ReadFile(name + ".hdr")
strs := bytes.Split(data, []byte{'\n'})
var hdr Header
hdr.FileType = string(strs[0])
hdr.FNameRgx = string(strs[1])
hdr.HeaderRgx = string(strs[2])
hdr.SignatureRgx = string(strs[3])
fmt.Printf("took %v\n", time.Since(start))
return hdr
}

View File

@@ -0,0 +1,38 @@
filetype: makefile
detect:
filename: "([Mm]akefile|\\.ma?k)$"
header: "^#!.*/(env +)?[bg]?make( |$)"
rules:
- preproc: "\\<(ifeq|ifdef|ifneq|ifndef|else|endif)\\>"
- statement: "^(export|include|override)\\>"
- symbol.operator: "^[^:= ]+:"
- symbol.operator: "([=,%]|\\+=|\\?=|:=|&&|\\|\\|)"
- statement: "\\$\\((abspath|addprefix|addsuffix|and|basename|call|dir)[[:space:]]"
- statement: "\\$\\((error|eval|filter|filter-out|findstring|firstword)[[:space:]]"
- statement: "\\$\\((flavor|foreach|if|info|join|lastword|notdir|or)[[:space:]]"
- statement: "\\$\\((origin|patsubst|realpath|shell|sort|strip|suffix)[[:space:]]"
- statement: "\\$\\((value|warning|wildcard|word|wordlist|words)[[:space:]]"
- identifier: "^.+:"
- identifier: "[()$]"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- identifier: "\\$+(\\{[^} ]+\\}|\\([^) ]+\\))"
- identifier: "\\$[@^<*?%|+]|\\$\\([@^<*?%+-][DF]\\)"
- identifier: "\\$\\$|\\\\.?"
- comment:
start: "#"
end: "$"
rules: []

View File

@@ -0,0 +1,12 @@
filetype: man
detect:
filename: "\\.[1-9]x?$"
rules:
- green: "\\.(S|T)H.*$"
- brightgreen: "\\.(S|T)H|\\.TP"
- brightred: "\\.(BR?|I[PR]?).*$"
- brightblue: "\\.(BR?|I[PR]?|PP)"
- brightwhite: "\\\\f[BIPR]"
- yellow: "\\.(br|DS|RS|RE|PD)"

View File

@@ -0,0 +1,49 @@
filetype: markdown
detect:
filename: "\\.(livemd|md|mkd|mkdn|markdown)$"
rules:
# Tables (Github extension)
- type: ".*[ :]\\|[ :].*"
# quotes
- statement: "^>.*"
# Emphasis
- type: "(^|[[:space:]])(_[^ ][^_]*_|\\*[^ ][^*]*\\*)"
# Strong emphasis
- type: "(^|[[:space:]])(__[^ ][^_]*__|\\*\\*[^ ][^*]*\\*\\*)"
# strike-through
- type: "(^|[[:space:]])~~[^ ][^~]*~~"
# horizontal rules
- special: "^(---+|===+|___+|\\*\\*\\*+)\\s*$"
# headlines
- special: "^#{1,6}.*"
# lists
- identifier: "^[[:space:]]*[\\*+-] |^[[:space:]]*[0-9]+\\. "
# misc
- preproc: "(\\(([CcRr]|[Tt][Mm])\\)|\\.{3}|(^|[[:space:]])\\-\\-($|[[:space:]]))"
# links
- constant: "\\[[^]]+\\]"
- constant: "\\[([^][]|\\[[^]]*\\])*\\]\\([^)]+\\)"
# images
- underlined: "!\\[[^][]*\\](\\([^)]+\\)|\\[[^]]+\\])"
# urls
- underlined: "https?://[^ )>]+"
- special: "^```$"
- special:
start: "`"
end: "`"
rules: []

View File

@@ -0,0 +1,23 @@
# sendmail config files
filetype: mc
detect:
filename: "\\.mc$"
rules:
- statement: "^(divert|VERSIONID|OSTYPE|DOMAIN|FEATURE|define)"
- statement: "^(DAEMON_OPTIONS|MAILER)"
- comment:
start: "#"
end: "$"
rules: []
- comment:
start: "dnl"
end: "$"
rules: []
- constant.string:
start: "`"
end: "'"
rules: []

51
config/micro/syntax/meson.yaml Executable file
View File

@@ -0,0 +1,51 @@
filetype: meson
detect:
filename: "(meson\\.build|meson_options\\.txt|meson\\.options)"
rules:
# refer to https://mesonbuild.com/Syntax.html
- statement: "\\b(elif|else|if|endif)\\b"
- statement: "\\b(foreach|endforeach)\\b"
- statement: "\\b(continue|break)\\b"
- statement: "\\b(and|not|or|in)\\b"
- symbol.operator: "[<>?:+*/-]|[+!<>=]?="
- symbol.brackets: "[(){}\\[\\]]"
- constant.number: "\\b(0|[1-9][0-9]*)\\b" # decimal
- constant.number: "\\b(0b[01]+)\\b" # bin
- constant.number: "\\b(0o[0-7]+)\\b" # oct
- constant.number: "\\b(0x[0-9a-fA-F]+)\\b" # hex
# meson builtins
- identifier: "\\b(add_global_arguments|add_global_link_arguments|add_languages|add_project_arguments|add_project_dependencies)\\b"
- identifier: "\\b(add_project_link_arguments|add_test_setup|alias_target|assert|benchmark|both_libraries|build_machine|build_target|configuration_data)\\b"
- identifier: "\\b(configure_file|custom_target|debug|declare_dependency|dependency|disabler|environment|error|executable|files)\\b"
- identifier: "\\b(find_program|generator|get_option|get_variable|host_machine|import|include_directories|install_data|install_emptydir)\\b"
- identifier: "\\b(install_headers|install_man|install_subdir|install_symlink|is_disabler|is_variable|jar|join_paths|library|meson)\\b"
- identifier: "\\b(message|option|project|range|run_command|run_target|set_variable|shared_library|shared_module|static_library)\\b"
- identifier: "\\b(structured_sources|subdir|subdir_done|subproject|summary|target_machine|test|unset_variable|vcs_tag|warning)\\b"
- constant.bool: "\\b(true|false)\\b"
- comment:
start: "#"
end: "$"
rules: []
# multiline strings do not support escape sequences
- constant.string:
start: "'''"
end: "'''"
rules: []
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\[abfnrtv\\\\']"
- constant.specialChar: "\\\\([0-7]{1,3}|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|N\\{[^\\}]+\\})"

View File

@@ -0,0 +1,34 @@
filetype: micro
detect:
filename: "\\.(micro)$"
rules:
- statement: "\\b(syntax|color(-link)?)\\b"
- statement: "\\b(start=|end=)\\b"
# Simple one-liners
- identifier: "\\b(default|number|statement|underlined|error|todo|statusline|indent-char|cursor\\-line|color\\-column|ignore|divider|tabbar)\\b"
# Separate identifiers to keep "complex" regex clean
- identifier: "\\b(special(Char)?)\\b"
- identifier: "\\b((current\\-)?line\\-number)\\b"
- identifier: "\\b(gutter\\-(info|error|warning){1})\\b"
- identifier: "\\b(comment(\\.bright)?)\\b"
- identifier: "\\b(symbol(\\.(brackets|operator|tag))?)\\b"
- identifier: "\\b(identifier(\\.(class|macro|var))?)\\b"
- identifier: "\\b(constant(\\.(bool(\\.(true|false){1})?|number|specialChar|string(\\.url)?){1})?)\\b"
- identifier: "\\b(preproc(\\.shebang)?)\\b"
- identifier: "\\b(type(\\.keyword)?)\\b"
- constant.number: "\\b(|h|A|0x)+[0-9]+(|h|A)+\\b"
- constant.number: "\\b0x[0-9 a-f A-F]+\\b"
- comment:
start: "#"
end: "$"
rules:
- todo: "(FIXME|TODO|NOTE):?"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.number: "#[0-9 A-F a-f]+"

View File

@@ -0,0 +1,13 @@
filetype: mpd
detect:
filename: "mpd\\.conf$"
rules:
- statement: "\\b(user|group|bind_to_address|host|port|plugin|name|type)\\b"
- statement: "\\b((music|playlist)_directory|(db|log|state|pid|sticker)_file)\\b"
- special: "^(input|audio_output|decoder)[[:space:]]*\\{|\\}"
- constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'"
- comment: "(^|[[:space:]])#([^{].*)?$"
- indent-char.whitespace: "[[:space:]]+$"
- indent-char: " + +| + +"

View File

@@ -0,0 +1,6 @@
filetype: msbuild
detect:
filename: "\\.(.*proj|props|targets|tasks)$"
rules:
- include: "xml"

View File

@@ -0,0 +1,16 @@
filetype: nanorc
detect:
filename: "\\.?nanorc$"
rules:
- default: "(?i)^[[:space:]]*((un)?set|include|syntax|i?color).*$"
- type: "(?i)^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|backupdir|backwards|boldtext|brackets|casesensitive|const|cut|fill|historylog|matchbrackets|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|operatingdir|preserve|punct)\\>|^[[:space:]]*(set|unset)[[:space:]]+(quickblank|quotestr|rebinddelete|rebindkeypad|regexp|smarthome|smooth|speller|suspend|tabsize|tabstospaces|tempfile|undo|view|whitespace|wordbounds)\\b"
- preproc: "(?i)^[[:space:]]*(set|unset|include|syntax|header)\\b"
- constant.bool.true: "(?i)(set)\\b"
- constant.bool.false: "(?i)(unset)\\b"
- identifier: "(?i)^[[:space:]]*(i)?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\\b"
- special: "(?i)^[[:space:]]*(i)?color\\b|\\b(start|end)="
- constant.string: "\"(\\\\.|[^\"])*\""
- comment: "^[[:space:]]*#.*$"
- comment.bright: "^[[:space:]]*##.*$"

View File

@@ -0,0 +1,30 @@
filetype: nftables
detect:
filename: "(nftables\\.(conf|rules)$|nftables(\\.rules)?\\.d/)"
header: "^(#!.*/(env +)?nft( |$)|flush +ruleset)"
rules:
- type: "\\b(chain|counter|map|rule|ruleset|set|table)\\b"
- type: "\\b(ether|inet|i(cm)?p(x|(v?(4|6))?)|tcp|udp|8021q)\\b"
- special: "\\b(element(s)?|hook|policy|priority|type|state)\\b"
- identifier: "\\b(ct|iif|iifname|meta|oif|oifname|th|dport|sport|saddr|daddr|l4proto)\\b"
- statement: "\\b(accept|drop|goto|jump|log|masquerade|reject|limit|queue)\\b"
- preproc: "\\b(add|define|flush|include|delete)\\b"
- symbol.operator: "[<>.&|^!=:;,@]|\\b(and|ge|gt|le|lt|or|xor)\\b"
- constant.string:
start: "\""
end: "\""
rules: []
# Integer Constants
- constant.number: "\\b([0-9]+)\\b"
- constant.number: "\\b(0x[0-9a-fA-F]+)\\b"
- identifier.var: "[$@][a-zA-Z_.][a-zA-Z0-9_/.-]*"
- comment: "(^|[[:space:]])#([^{].*)?$"
- indent-char.whitespace: "[[:space:]]+$"
- indent-char: " + +| + +"
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|FIXME):?"

View File

@@ -0,0 +1,22 @@
filetype: nginx
detect:
filename: "nginx.*\\.conf$|\\.nginx$|\\.sub(domain|folder)\\.conf$"
header: "^(server|upstream)[a-z ]*\\{$"
rules:
- preproc: "\\b(events|server|http|location|upstream)[[:space:]]*\\{"
- statement: "(^|[[:space:]{;])(access_log|add_after_body|add_before_body|add_header|addition_types|aio|alias|allow|ancient_browser|ancient_browser_value|auth_basic|auth_basic_user_file|autoindex|autoindex_exact_size|autoindex_localtime|break|charset|charset_map|charset_types|chunked_transfer_encoding|client_body_buffer_size|client_body_in_file_only|client_body_in_single_buffer|client_body_temp_path|client_body_timeout|client_header_buffer_size|client_header_timeout|client_max_body_size|connection_pool_size|create_full_put_path|daemon|dav_access|dav_methods|default_type|deny|directio|directio_alignment|disable_symlinks|empty_gif|env|error_log|error_page|expires|fastcgi_buffer_size|fastcgi_buffers|fastcgi_busy_buffers_size|fastcgi_cache|fastcgi_cache_bypass|fastcgi_cache_key|fastcgi_cache_lock|fastcgi_cache_lock_timeout|fastcgi_cache_min_uses|fastcgi_cache_path|fastcgi_cache_use_stale|fastcgi_cache_valid|fastcgi_connect_timeout|fastcgi_hide_header|fastcgi_ignore_client_abort|fastcgi_ignore_headers|fastcgi_index|fastcgi_intercept_errors|fastcgi_keep_conn|fastcgi_max_temp_file_size|fastcgi_next_upstream|fastcgi_no_cache|fastcgi_param|fastcgi_pass|fastcgi_pass_header|fastcgi_read_timeout|fastcgi_send_timeout|fastcgi_split_path_info|fastcgi_store|fastcgi_store_access|fastcgi_temp_file_write_size|fastcgi_temp_path|flv|geo|geoip_city|geoip_country|gzip|gzip_buffers|gzip_comp_level|gzip_disable|gzip_http_version|gzip_min_length|gzip_proxied|gzip_static|gzip_types|gzip_vary|if|if_modified_since|ignore_invalid_headers|image_filter|image_filter_buffer|image_filter_jpeg_quality|image_filter_sharpen|image_filter_transparency|include|index|internal|ip_hash|keepalive|keepalive_disable|keepalive_requests|keepalive_timeout|large_client_header_buffers|limit_conn|limit_conn_log_level|limit_conn_zone|limit_except|limit_rate|limit_rate_after|limit_req|limit_req_log_level|limit_req_zone|limit_zone|lingering_close|lingering_time|lingering_timeout|listen|location|log_format|log_not_found|log_subrequest|map|map_hash_bucket_size|map_hash_max_size|master_process|max_ranges|memcached_buffer_size|memcached_connect_timeout|memcached_next_upstream|memcached_pass|memcached_read_timeout|memcached_send_timeout|merge_slashes|min_delete_depth|modern_browser|modern_browser_value|mp4|mp4_buffer_size|mp4_max_buffer_size|msie_padding|msie_refresh|open_file_cache|open_file_cache_errors|open_file_cache_min_uses|open_file_cache_valid|open_log_file_cache|optimize_server_names|override_charset|pcre_jit|perl|perl_modules|perl_require|perl_set|pid|port_in_redirect|postpone_output|proxy_buffer_size|proxy_buffering|proxy_buffers|proxy_busy_buffers_size|proxy_cache|proxy_cache_bypass|proxy_cache_key|proxy_cache_lock|proxy_cache_lock_timeout|proxy_cache_min_uses|proxy_cache_path|proxy_cache_use_stale|proxy_cache_valid|proxy_connect_timeout|proxy_cookie_domain|proxy_cookie_path|proxy_hide_header|proxy_http_version|proxy_ignore_client_abort|proxy_ignore_headers|proxy_intercept_errors|proxy_max_temp_file_size|proxy_next_upstream|proxy_no_cache|proxy_pass|proxy_pass_header|proxy_read_timeout|proxy_redirect|proxy_send_timeout|proxy_set_header|proxy_ssl_session_reuse|proxy_store|proxy_store_access|proxy_temp_file_write_size|proxy_temp_path|random_index|read_ahead|real_ip_header|recursive_error_pages|request_pool_size|reset_timedout_connection|resolver|resolver_timeout|return|rewrite|root|satisfy|satisfy_any|secure_link_secret|send_lowat|send_timeout|sendfile|sendfile_max_chunk|server|server|server_name|server_name_in_redirect|server_names_hash_bucket_size|server_names_hash_max_size|server_tokens|set|set_real_ip_from|source_charset|split_clients|ssi|ssi_silent_errors|ssi_types|ssl|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_client_certificate|ssl_crl|ssl_dhparam|ssl_engine|ssl_prefer_server_ciphers|ssl_protocols|ssl_session_cache|ssl_session_timeout|ssl_verify_client|ssl_verify_depth|sub_filter|sub_filter_once|sub_filter_types|tcp_nodelay|tcp_nopush|timer_resolution|try_files|types|types_hash_bucket_size|types_hash_max_size|underscores_in_headers|uninitialized_variable_warn|upstream|user|userid|userid_domain|userid_expires|userid_name|userid_p3p|userid_path|userid_service|valid_referers|variables_hash_bucket_size|variables_hash_max_size|worker_priority|worker_processes|worker_rlimit_core|worker_rlimit_nofile|working_directory|xml_entities|xslt_stylesheet|xslt_types)([[:space:]]|$)"
- constant.bool.true: "\\b(on)\\b"
- constant.bool.false: "\\b(off)\\b"
- identifier: "\\$[A-Za-z][A-Za-z0-9_]*"
- symbol: "[*]"
- constant-string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'"
- constant.string:
start: "'$"
end: "';$"
rules: []
- comment: "(^|[[:space:]])#([^{].*)?$"
- indent-char.whitespace: "[[:space:]]+$"
- indent-char: " + +| + +"

View File

@@ -0,0 +1,27 @@
filetype: nim
detect:
filename: "\\.nims?$|nim.cfg"
rules:
- preproc: "[\\{\\|]\\b(atom|lit|sym|ident|call|lvalue|sideeffect|nosideeffect|param|genericparam|module|type|let|var|const|result|proc|method|iterator|converter|macro|template|field|enumfield|forvar|label|nk[a-zA-Z]+|alias|noalias)\\b[\\}\\|]"
- statement: "\\b(addr|and|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|div|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|in|include|interface|is|isnot|iterator|let|macro|method|mixin|mod|nil|not|notin|object|of|or|out|proc|ptr|raise|ref|return|shl|shr|static|template|try|tuple|type|using|var|when|while|with|without|xor|yield)\\b"
- statement: "\\b(deprecated|noSideEffect|constructor|destructor|override|procvar|compileTime|noReturn|acyclic|final|shallow|pure|asmNoStackFrame|error|fatal|warning|hint|line|linearScanEnd|computedGoto|unroll|immediate|checks|boundsChecks|overflowChecks|nilChecks|assertations|warnings|hints|optimization|patterns|callconv|push|pop|global|pragma|experimental|bitsize|volatile|noDecl|header|incompleteStruct|compile|link|passC|passL|emit|importc|importcpp|importobjc|codegenDecl|injectStmt|intdefine|strdefine|varargs|exportc|extern|bycopy|byref|union|packed|unchecked|dynlib|cdecl|thread|gcsafe|threadvar|guard|locks|compileTime)\\b"
- symbol.operator: "[=\\+\\-\\*/<>@\\$~&%\\|!\\?\\^\\.:\\\\]+"
- special: "\\{\\.|\\.\\}|\\[\\.|\\.\\]|\\(\\.|\\.\\)|;|,|`"
- statement: "\\.\\."
- type: "\\b(int|cint|int8|int16|int32|int64|uint|uint8|uint16|uint32|uint64|float|float32|float64|bool|char|enum|string|cstring|cstringArray|cdouble|csize_t|pointer|array|openarray|seq|varargs|tuple|object|set|void|auto|cshort|clong|range|nil|T|untyped|typedesc)\\b"
- type: "'[iI](8|16|32|64)?\\b|'[uU](8|16|32|64)?\\b|'[fF](32|64|128)?\\b|'[dD]\\b"
- constant.number: "\\b[0-9]+\\b"
- constant.number: "\\b0[xX][0-9A-Fa-f][0-9_A-Fa-f]+\\b"
- constant.number: "\\b0[ocC][0-7][0-7_]+\\b"
- constant.number: "\\b0[bB][01][01_]+\\b"
- constant.number: "\\b[0-9_]((\\.?)[0-9_]+)?[eE][+\\-][0-9][0-9_]+\\b"
- constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'"
- comment: "[[:space:]]*(?:[^\\\\]|^)#.*$"
- comment:
start: "\\#\\["
end: "\\]\\#"
rules: []
- todo: "(TODO|FIXME|XXX):?"

View File

@@ -0,0 +1,32 @@
filetype: nix
detect:
filename: "\\.nix$"
rules:
- special: "\\b(Ellipsis|null|self|super|true|false|abort)\\b"
- statement: "\\b(let|in|with|import|rec|inherit)\\b"
- symbol.operator: "([~^.:;,+*|=!\\%@]|<|>|/|-|&)"
- symbol.brackets: "([(){}]|\\[|\\])"
- constant.number: "\\b[0-9](_?[0-9])*(\\.([0-9](_?[0-9])*)?)?(e[0-9](_?[0-9])*)?\\b"
- constant.string:
start: "\""
end: "\""
rules: []
- constant.string:
start: "''"
end: "''"
rules: []
- comment:
start: "#"
end: "$"
rules: []
- comment:
start: "/\\*"
end: "\\*/"
rules: []

Some files were not shown because too many files have changed in this diff Show More