From b977bf5cca84f7dc762fe8d9967831502ee5cc87 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Tue, 21 Mar 2017 14:55:22 -0400 Subject: [PATCH] Add converted syntax files --- runtime/syntax/apacheconf.yaml | 48 ++++++++++ runtime/syntax/arduino.yaml | 117 +++++++------------------ runtime/syntax/asciidoc.yaml | 56 ++++++------ runtime/syntax/asm.yaml | 44 +--------- runtime/syntax/awk.yaml | 29 ++++++ runtime/syntax/c++.yaml | 28 ++++++ runtime/syntax/c.yaml | 51 ++++------- runtime/syntax/caddyfile.yaml | 16 ++-- runtime/syntax/clojure.yaml | 19 ++++ runtime/syntax/cmake.yaml | 22 +++++ runtime/syntax/coffeescript.yaml | 38 ++++---- runtime/syntax/colortest.yaml | 2 +- runtime/syntax/conf.yaml | 9 ++ runtime/syntax/conky.yaml | 12 +++ runtime/syntax/crystal.yaml | 25 ++++++ runtime/syntax/csharp.yaml | 29 ++++++ runtime/syntax/css.yaml | 43 ++++----- runtime/syntax/cython.yaml | 23 +++++ runtime/syntax/d.yaml | 93 ++++---------------- runtime/syntax/dart.yaml | 34 ++----- runtime/syntax/dockerfile.yaml | 35 ++------ runtime/syntax/dot.yaml | 16 ++++ runtime/syntax/erb.yaml | 42 +++++++++ runtime/syntax/fish.yaml | 48 +++------- runtime/syntax/fortran.yaml | 37 ++++++++ runtime/syntax/gdscript.yaml | 31 +++++++ runtime/syntax/gentoo-ebuild.yaml | 32 ++----- runtime/syntax/gentoo-etc-portage.yaml | 15 ++++ runtime/syntax/git-commit.yaml | 34 +++---- runtime/syntax/git-config.yaml | 14 ++- runtime/syntax/git-rebase-todo.yaml | 36 +++----- runtime/syntax/glsl.yaml | 33 ++++--- runtime/syntax/go.yaml | 61 +++++-------- runtime/syntax/golo.yaml | 50 +++++++++++ runtime/syntax/groff.yaml | 30 +++++++ runtime/syntax/haml.yaml | 16 ++++ runtime/syntax/haskell.yaml | 24 +++++ runtime/syntax/html.yaml | 34 ++++--- runtime/syntax/html4.yaml | 25 ++++++ runtime/syntax/html5.yaml | 25 ++++++ runtime/syntax/ini.yaml | 14 +++ runtime/syntax/inputrc.yaml | 14 +++ runtime/syntax/java.yaml | 33 +++---- runtime/syntax/javascript.yaml | 40 +++------ runtime/syntax/json.yaml | 26 +++--- runtime/syntax/keymap.yaml | 24 ++--- runtime/syntax/kickstart.yaml | 16 ++++ runtime/syntax/ledger.yaml | 14 +++ runtime/syntax/lfe.yaml | 17 ++++ runtime/syntax/lilypond.yaml | 24 ++--- runtime/syntax/lisp.yaml | 17 ++++ runtime/syntax/lua.yaml | 44 +++------- runtime/syntax/mail.yaml | 16 ++-- runtime/syntax/makefile.yaml | 27 ++---- runtime/syntax/man.yaml | 12 +++ runtime/syntax/markdown.yaml | 50 +++-------- runtime/syntax/micro.yaml | 23 ++--- runtime/syntax/mpdconf.yaml | 13 +++ runtime/syntax/nanorc.yaml | 16 ++++ runtime/syntax/nginx.yaml | 22 +++++ runtime/syntax/nim.yaml | 27 ++++++ runtime/syntax/objc.yaml | 51 +++-------- runtime/syntax/ocaml.yaml | 17 +--- runtime/syntax/pascal.yaml | 26 ++---- runtime/syntax/patch.yaml | 13 +++ runtime/syntax/peg.yaml | 16 ++++ runtime/syntax/perl.yaml | 27 ++++++ runtime/syntax/perl6.yaml | 27 ++++++ runtime/syntax/php.yaml | 49 +++++++++++ runtime/syntax/pkg-config.yaml | 12 +++ runtime/syntax/po.yaml | 12 +++ runtime/syntax/pony.yaml | 37 ++++++++ runtime/syntax/pov.yaml | 21 +++++ runtime/syntax/privoxy-action.yaml | 14 +++ runtime/syntax/privoxy-config.yaml | 10 +++ runtime/syntax/privoxy-filter.yaml | 12 +++ runtime/syntax/puppet.yaml | 22 +++++ runtime/syntax/python2.yaml | 50 +++-------- runtime/syntax/python3.yaml | 53 ++++------- runtime/syntax/r.yaml | 7 +- runtime/syntax/reST.yaml | 32 ++++--- runtime/syntax/rpmspec.yaml | 43 +++++++++ runtime/syntax/ruby.yaml | 26 ++++++ runtime/syntax/rust.yaml | 41 ++++----- runtime/syntax/scala.yaml | 20 ++--- runtime/syntax/sed.yaml | 13 +++ runtime/syntax/sh.yaml | 41 +++------ runtime/syntax/sls.yaml | 15 ++++ runtime/syntax/solidity.yaml | 31 ++----- runtime/syntax/sql.yaml | 35 ++++++++ runtime/syntax/swift.yaml | 50 +++-------- runtime/syntax/systemd.yaml | 16 ++++ runtime/syntax/tcl.yaml | 18 ++++ runtime/syntax/tex.yaml | 17 ++-- runtime/syntax/toml.yaml | 43 +++------ runtime/syntax/typescript.yaml | 38 +++----- runtime/syntax/vala.yaml | 26 ++++++ runtime/syntax/vhdl.yaml | 37 ++++++++ runtime/syntax/vi.yaml | 24 +---- runtime/syntax/xml.yaml | 12 ++- runtime/syntax/xresources.yaml | 14 +++ runtime/syntax/yaml.yaml | 35 +++----- runtime/syntax/yum.yaml | 12 +++ runtime/syntax/zsh.yaml | 60 ++++--------- 104 files changed, 1807 insertions(+), 1233 deletions(-) create mode 100644 runtime/syntax/apacheconf.yaml create mode 100644 runtime/syntax/awk.yaml create mode 100644 runtime/syntax/c++.yaml create mode 100644 runtime/syntax/clojure.yaml create mode 100644 runtime/syntax/cmake.yaml create mode 100644 runtime/syntax/conf.yaml create mode 100644 runtime/syntax/conky.yaml create mode 100644 runtime/syntax/crystal.yaml create mode 100644 runtime/syntax/csharp.yaml create mode 100644 runtime/syntax/cython.yaml create mode 100644 runtime/syntax/dot.yaml create mode 100644 runtime/syntax/erb.yaml create mode 100644 runtime/syntax/fortran.yaml create mode 100644 runtime/syntax/gdscript.yaml create mode 100644 runtime/syntax/gentoo-etc-portage.yaml create mode 100644 runtime/syntax/golo.yaml create mode 100644 runtime/syntax/groff.yaml create mode 100644 runtime/syntax/haml.yaml create mode 100644 runtime/syntax/haskell.yaml create mode 100644 runtime/syntax/html4.yaml create mode 100644 runtime/syntax/html5.yaml create mode 100644 runtime/syntax/ini.yaml create mode 100644 runtime/syntax/inputrc.yaml create mode 100644 runtime/syntax/kickstart.yaml create mode 100644 runtime/syntax/ledger.yaml create mode 100644 runtime/syntax/lfe.yaml create mode 100644 runtime/syntax/lisp.yaml create mode 100644 runtime/syntax/man.yaml create mode 100644 runtime/syntax/mpdconf.yaml create mode 100644 runtime/syntax/nanorc.yaml create mode 100644 runtime/syntax/nginx.yaml create mode 100644 runtime/syntax/nim.yaml create mode 100644 runtime/syntax/patch.yaml create mode 100644 runtime/syntax/peg.yaml create mode 100644 runtime/syntax/perl.yaml create mode 100644 runtime/syntax/perl6.yaml create mode 100644 runtime/syntax/php.yaml create mode 100644 runtime/syntax/pkg-config.yaml create mode 100644 runtime/syntax/po.yaml create mode 100644 runtime/syntax/pony.yaml create mode 100644 runtime/syntax/pov.yaml create mode 100644 runtime/syntax/privoxy-action.yaml create mode 100644 runtime/syntax/privoxy-config.yaml create mode 100644 runtime/syntax/privoxy-filter.yaml create mode 100644 runtime/syntax/puppet.yaml create mode 100644 runtime/syntax/rpmspec.yaml create mode 100644 runtime/syntax/ruby.yaml create mode 100644 runtime/syntax/sed.yaml create mode 100644 runtime/syntax/sls.yaml create mode 100644 runtime/syntax/sql.yaml create mode 100644 runtime/syntax/systemd.yaml create mode 100644 runtime/syntax/tcl.yaml create mode 100644 runtime/syntax/vala.yaml create mode 100644 runtime/syntax/vhdl.yaml create mode 100644 runtime/syntax/xresources.yaml create mode 100644 runtime/syntax/yum.yaml diff --git a/runtime/syntax/apacheconf.yaml b/runtime/syntax/apacheconf.yaml new file mode 100644 index 00000000..3d7ef1b3 --- /dev/null +++ b/runtime/syntax/apacheconf.yaml @@ -0,0 +1,48 @@ +filetype: apacheconf + +detect: + filename: "httpd\\.conf|mime\\.types|vhosts\\.d\\\\*|\\.htaccess" + +rules: + - special: ".+" + - 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: ")" + - constant.string: "\\\"(\\\\.|[^\\\"])*\\\"" + - comment: "#.*" diff --git a/runtime/syntax/arduino.yaml b/runtime/syntax/arduino.yaml index d5fc0b6c..e0a38dc2 100644 --- a/runtime/syntax/arduino.yaml +++ b/runtime/syntax/arduino.yaml @@ -1,98 +1,43 @@ filetype: ino -detect: +detect: filename: "\\.?ino$" rules: - - identifier: "\\b[A-Z_][0-9A-Z_]+\\b" - - ## + - identifier.macro: "\\b[A-Z_][0-9A-Z_]+\\b" - 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 + - constant: "\\b(HIGH|LOW|INPUT|OUTPUT)\\b" + - identifier.macro: "\\b(DEC|BIN|HEX|OCT|BYTE)\\b" + - constant: "\\b(PI|HALF_PI|TWO_PI)\\b" + - constant: "\\b(LSBFIRST|MSBFIRST)\\b" + - constant: "\\b(CHANGE|FALLING|RISING)\\b" + - constant: "\\b(DEFAULT|EXTERNAL|INTERNAL|INTERNAL1V1|INTERNAL2V56)\\b" - 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)__)" - + - 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" + - special: "\\b(goto|continue|break|return)\\b" + - statement: "\\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" + - statement: "\\b(bitRead|bitWrite|bitSet|bitClear|bit|highByte|lowByte)\\b" + - statement: "\\b(analogReference|analogRead|analogWrite)\\b" + - statement: "\\b(attachInterrupt|detachInterrupt)\\b" + - statement: "\\b(delay|delayMicroseconds|millis|micros)\\b" + - statement: "\\b(pinMode|digitalWrite|digitalRead)\\b" + - statement: "\\b(interrupts|noInterrupts)\\b" + - statement: "\\b(noTone|pulseIn|shiftIn|shiftOut|tone)\\b" + - special: "\\b(Serial|Serial1|Serial2|Serial3|begin|end|peek|read|print|println|available|flush)\\b" + - statement: "\\b(setup|loop)\\b" + - preproc: "^[[:space:]]*#[[:space:]]*(define|include(_next)?|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)" + - constant.specialChar: "'([^']|(\\\\[\"'abfnrtv\\\\]))'|'\\\\(([0-3]?[0-7]{1,2}))'|'\\\\x[0-9A-Fa-f]{1,2}'" + - preproc: "__attribute__[[:space:]]*\\(\\([^)]*\\)\\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" + - constant.string: "<[^= ]*>|\"(\\\\.|[^\"])*\"" - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: - - preproc: "..+" - - constant.specialChar: "\\\\." - - - comment: - start: "//" - end: "$" - rules: - - todo: "(TODO|XXX|FIXME):?" + start: "\"(\\\\.|[^\"])*\\\\[[:space:]]*$" + end: "^(\\\\.|[^\"])*\"" + rules: [] + - comment: "//.*" - comment: start: "/\\*" end: "\\*/" - rules: - - todo: "(TODO|XXX|FIXME):?" + rules: [] + + - indent-char.whitespace: "[[:space:]]+$" diff --git a/runtime/syntax/asciidoc.yaml b/runtime/syntax/asciidoc.yaml index ce72a8d2..f78276dc 100644 --- a/runtime/syntax/asciidoc.yaml +++ b/runtime/syntax/asciidoc.yaml @@ -1,33 +1,33 @@ filetype: asciidoc -detect: +detect: filename: "\\.(asc|asciidoc|adoc)$" rules: - - red: "^====+$" - - red: "^==[[:space:]].*$" - - red: "^----+$" - - magenta: "^===[[:space:]].*$" - - magenta: "^~~~~+$" - - green: "^====[[:space:]].*$" - - green: "^\\^\\^\\^\\^+$" - - brightblue: "^=====[[:space:]].*$" - - brightblue: "^\\+\\+\\+\\++$" - - brightgreen: ":.*:" - - brightred: "\\{[a-z0-9]*\\}" - - red: "\\\\\\{[a-z0-9]*\\}" - - red: "\\+\\+\\+\\{[a-z0-9]*\\}\\+\\+\\+" - - yellow: "^\\..*$" - - magenta: "^\\[(source,.+|NOTE|TIP|IMPORTANT|WARNING|CAUTION)\\]" - - yellow: ".*[[:space:]]\\+$" - - yellow: "_[^_]+_" - - yellow: "\\*[^\\*]+\\*" - - yellow: "\\+[^\\+]+\\+" - - yellow: "`[^`]+`" - - yellow: "\\^[^\\^]+\\^" - - yellow: "~[^~]+~" - - yellow: "'[^']+'" - - cyan: "`{1,2}[^']+'{1,2}" - - brightmagenta: "^[[:space:]]*[\\*\\.-]{1,5}[[:space:]]" - - brightwhite: "\\[\\[.*\\]\\]" - - brightwhite: "<<.*>>" + - preproc: "^====+$" + - statement: "^==[[:space:]].*$" + - statement: "^----+$" + - symbol: "^===[[:space:]].*$" + - symbol: "^~~~~+$" + - type: "^====[[:space:]].*$" + - type: "^\\^\\^\\^\\^+$" + - constant: "^=====[[:space:]].*$" + - constant: "^\\+\\+\\+\\++$" + - type.keyword: ":.*:" + - identifier.macro: "\\{[a-z0-9]*\\}" + - identifier: "\\\\\\{[a-z0-9]*\\}" + - identifier: "\\+\\+\\+\\{[a-z0-9]*\\}\\+\\+\\+" + - statement: "^\\..*$" + - identifier: "^\\[(source,.+|NOTE|TIP|IMPORTANT|WARNING|CAUTION)\\]" + - constant.string: ".*[[:space:]]\\+$" + - constant.string: "_[^_]+_" + - constant.string: "\\*[^\\*]+\\*" + - constant.string: "\\+[^\\+]+\\+" + - constant.string: "`[^`]+`" + - constant.string: "\\^[^\\^]+\\^" + - constant.string: "~[^~]+~" + - constant.string: "'[^']+'" + - constant: "`{1,2}[^']+'{1,2}" + - symbol: "^[[:space:]]*[\\*\\.-]{1,5}[[:space:]]" + - bold default: "\\[\\[.*\\]\\]" + - bold default: "<<.*>>" diff --git a/runtime/syntax/asm.yaml b/runtime/syntax/asm.yaml index 2752b6f3..c19db151 100644 --- a/runtime/syntax/asm.yaml +++ b/runtime/syntax/asm.yaml @@ -1,13 +1,9 @@ filetype: asm -detect: +detect: filename: "\\.(S|s|asm)$" rules: - # This file is made 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" @@ -25,8 +21,6 @@ rules: - 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" @@ -35,8 +29,6 @@ rules: - 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" @@ -56,15 +48,9 @@ rules: - 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" @@ -73,35 +59,13 @@ rules: - 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: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." - - - comment: - start: ";" - end: "$" - rules: - - todo: "(TODO|XXX|FIXME):?" + - constant.string: "\"(\\\\.|[^\"])*\"" + - constant.string: "'(\\\\.|[^'])*'" + - comment: ";.*" diff --git a/runtime/syntax/awk.yaml b/runtime/syntax/awk.yaml new file mode 100644 index 00000000..5f96531f --- /dev/null +++ b/runtime/syntax/awk.yaml @@ -0,0 +1,29 @@ +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: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - constant.specialChar: "\\\\." + - comment: "(^|[[:space:]])#([^{].*)?$" + - todo: "TODO:?" + - indent-char.: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/c++.yaml b/runtime/syntax/c++.yaml new file mode 100644 index 00000000..f0ec8f68 --- /dev/null +++ b/runtime/syntax/c++.yaml @@ -0,0 +1,28 @@ +filetype: c++ + +detect: + filename: "\\.c(c|pp|xx)$|\\.h(h|pp|xx)$|\\.ii?$|\\.(def)$" + +rules: + - identifier: "\\b[A-Z_][0-9A-Z_]+\\b" + - type: "\\b(auto|float|double|bool|char|int|short|long|sizeof|enum|void|static|const|constexpr|struct|union|typedef|extern|(un)?signed|inline)\\b" + - type: "\\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\\b" + - statement: "\\b(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\\b" + - statement: "\\b(for|if|while|do|else|case|default|switch)\\b" + - statement: "\\b(try|throw|catch|operator|new|delete)\\b" + - special: "\\b(goto|continue|break|return)\\b" + - preproc: "^[[:space:]]*#[[:space:]]*(define|pragma|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)" + - constant: "'([^'\\\\]|(\\\\[\"'abfnrtv\\\\]))'|'\\\\(([0-3]?[0-7]{1,2}))'|'\\\\x[0-9A-Fa-f]{1,2}'" + - statement: "__attribute__[[:space:]]*\\(\\([^)]*\\)\\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" + - symbol.operator: "[.:;,+*|=!\\%]|<|>|/|-|&" + - symbol.brackets: "[(){}]|\\[|\\]" + - constant.number: "\\b[0-9]+\\b|\\b0x[0-9A-Fa-f]+\\b" + - constant.bool: "\\b(true|false)\\b|NULL" + - constant.string: "\"(\\\\.|[^\"])*\"" + - comment: "//.*" + - comment: + start: "/\\*" + end: "\\*/" + rules: [] + + - indent-char.whitespace: "[[:space:]]+$" diff --git a/runtime/syntax/c.yaml b/runtime/syntax/c.yaml index a3974483..dcb48995 100644 --- a/runtime/syntax/c.yaml +++ b/runtime/syntax/c.yaml @@ -1,49 +1,30 @@ filetype: c -detect: - filename: "(\\.(c|C)$|\\.(h|H)$|\\.ii?$|\\.(def)$)" +detect: + filename: "\\.(c|C)$|\\.(h|H)$|\\.ii?$|\\.(def)$" rules: - - identifier: "\\b[A-Z_][0-9A-Z_]+\\b" + - identifier: "\\b[A-Z_][0-9A-Z_]+\\b" - type: "\\b(float|double|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\\b" - type: "\\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\\b" + - type.extended: "\\b(bool)\\b" - statement: "\\b(typename|mutable|volatile|register|explicit)\\b" - statement: "\\b(for|if|while|do|else|case|default|switch)\\b" - statement: "\\b(try|throw|catch|operator|new|delete)\\b" - - statement: "\\b(goto|continue|break|return)\\b" + - special: "\\b(goto|continue|break|return)\\b" - preproc: "^[[:space:]]*#[[:space:]]*(define|pragma|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)" - - constant: "'([^'\\\\]|(\\\\[\"'abfnrtv\\\\]))'" - - constant: "'\\\\(([0-3]?[0-7]{1,2}))'" - - constant: "'\\\\x[0-9A-Fa-f]{1,2}'" - # GCC builtins - - statement: "__attribute__[[:space:]]*\\(\\([^)]*\\)\\)" - - statement: "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" - # Operator Color - - statement: "([.:;,+*|=!\\%]|<|>|/|-|&)" - - constant.number: "(\\b[0-9]+\\b|\\b0x[0-9A-Fa-f]+\\b)" + - constant: "'([^'\\\\]|(\\\\[\"'abfnrtv\\\\]))'|'\\\\(([0-3]?[0-7]{1,2}))'|'\\\\x[0-9A-Fa-f]{1,2}'" + - statement: "__attribute__[[:space:]]*\\(\\([^)]*\\)\\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" + - constant.string: "<.+?>" + - symbol.operator: "[.:;,+*|=!\\%]|<|>|/|-|&" + - symbol.brackets: "[(){}]|\\[|\\]" + - constant.number: "\\b[0-9]+\\b|\\b0x[0-9A-Fa-f]+\\b" - constant.number: "NULL" - - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: - - preproc: "..+" - - constant.specialChar: "\\\\." - - - comment: - start: "//" - end: "$" - rules: - - todo: "(TODO|XXX|FIXME):?" - + - constant.string: "\"(\\\\.|[^\"])*\"" + - comment: "//.*" - comment: start: "/\\*" end: "\\*/" - rules: - - todo: "(TODO|XXX|FIXME):?" + rules: [] + + - indent-char.whitespace: "[[:space:]]+$" diff --git a/runtime/syntax/caddyfile.yaml b/runtime/syntax/caddyfile.yaml index 7c386f18..fc11c8b1 100644 --- a/runtime/syntax/caddyfile.yaml +++ b/runtime/syntax/caddyfile.yaml @@ -1,6 +1,6 @@ filetype: caddyfile -detect: +detect: filename: "Caddyfile" rules: @@ -9,13 +9,11 @@ rules: - constant.specialChar: "\\s{$" - constant.specialChar: "^\\s*}$" - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." + start: "\\\"" + end: "\\\"" + rules: [] - preproc: "\\{(\\w+|\\$\\w+|%\\w+%)\\}" - - comment: - start: "#" - end: "$" - rules: [] + - comment: "#.*" + - indent-char: "([[:space:]]{2,}|\\t){$" + - indent-char: "[[:space:]]+$" diff --git a/runtime/syntax/clojure.yaml b/runtime/syntax/clojure.yaml new file mode 100644 index 00000000..b18ff48e --- /dev/null +++ b/runtime/syntax/clojure.yaml @@ -0,0 +1,19 @@ +filetype: clojure + +detect: + filename: "\\.(clj)$" + +rules: + - constant: "" + - constant.bool: "\\b(true|false)\\b" + - constant.macro: "\\b(nil)\\b" + - 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" + - error: "[\\-]?([4-9][0-9]|3[7-9]|1|0)r[0-9A-Z]+?\\b" + - symbol.operator: "[=>+\\-*/'?]" + - type: "\\b(byte|short|(big)?int(eger)?|long|float|num|bigdec|rationalize)\\b" + - special: "" + - constant.string: "" + - constant.specialChar: "(\\\\u[0-9A-fa-f]{4,4}|\\\\newline|\\\\space|\\\\tab|\\\\formfeed|\\\\backspace|\\\\return|\\\\.)" + - comment: ";.*$" diff --git a/runtime/syntax/cmake.yaml b/runtime/syntax/cmake.yaml new file mode 100644 index 00000000..7238a4f5 --- /dev/null +++ b/runtime/syntax/cmake.yaml @@ -0,0 +1,22 @@ +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: "['][^']*[^\\\\][']|[']{3}.*[^\\\\][']{3}" + - constant.string: "[\"][^\"]*[^\\\\][\"]|[\"]{3}.*[^\\\\][\"]{3}" + - preproc: + start: "\\$(\\{|ENV\\{)" + end: "\\}" + rules: [] + + - identifier.macro: "\\b(APPLE|UNIX|WIN32|CYGWIN|BORLAND|MINGW|MSVC(_IDE|60|71|80|90)?)\\b" + - comment: "^([[:space:]]*)?#.*" + - comment: "[[:space:]]#.*" diff --git a/runtime/syntax/coffeescript.yaml b/runtime/syntax/coffeescript.yaml index 30ae1dc1..497de389 100644 --- a/runtime/syntax/coffeescript.yaml +++ b/runtime/syntax/coffeescript.yaml @@ -1,27 +1,21 @@ filetype: coffeescript -detect: +detect: filename: "\\.coffee$" + header: "^#!.*/(env +)?coffee" rules: - - statement: "[!&|=/*+-<>]|\\b(and|or|is|isnt|not)\\b" - - identifier: "([A-Za-z_][A-Za-z0-9_]*:[[:space:]]*(->|\\()|->)" - - statement: "[()]" - - statement: "\\b(for|of|continue|break|isnt|null|unless|this|else|if|return)\\b" - - statement: "\\b(try|catch|finally|throw|new|delete|typeof|in|instanceof)\\b" - - statement: "\\b(debugger|switch|while|do|class|extends|super)\\b" - - statement: "\\b(undefined|then|unless|until|loop|of|by|when)\\b" - - constant: "\\b(true|false|yes|no|on|off)\\b" - - preproc: "@[A-Za-z0-9_]*" - - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - comment: - start: "#" - end: "$" - rules: - - todo: "(TODO|XXX|FIXME):?" + - symbol.operator: "[!&|=/*+\\-<>]|\\b(and|or|is|isnt|not)\\b" + - identifier.class: "[A-Za-z_][A-Za-z0-9_]*:[[:space:]]*(->|\\()|->" + - symbol.brackets: "[()]" + - statement: "\\b(for|of|continue|break|isnt|null|unless|this|else|if|return)\\b" + - statement: "\\b(try|catch|finally|throw|new|delete|typeof|in|instanceof)\\b" + - statement: "\\b(debugger|switch|while|do|class|extends|super)\\b" + - statement: "\\b(undefined|then|unless|until|loop|of|by|when)\\b" + - constant.bool: "\\b(true|false|yes|no|on|off)\\b" + - identifier: "@[A-Za-z0-9_]*" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - comment: "(^|[[:space:]])#([^{].*)?$" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" + - preproc.shebang: "#!.+$" diff --git a/runtime/syntax/colortest.yaml b/runtime/syntax/colortest.yaml index c08dc472..b97993f0 100644 --- a/runtime/syntax/colortest.yaml +++ b/runtime/syntax/colortest.yaml @@ -1,6 +1,6 @@ filetype: colortest -detect: +detect: filename: "ColorTest$" rules: diff --git a/runtime/syntax/conf.yaml b/runtime/syntax/conf.yaml new file mode 100644 index 00000000..3e4fc6ed --- /dev/null +++ b/runtime/syntax/conf.yaml @@ -0,0 +1,9 @@ +filetype: conf + +detect: + filename: "\\.c[o]?nf$" + +rules: + - constant.string: "\"(\\\\.|[^\"])*\"" + - comment: "^[[:space:]]*#.*$" + - comment: "^[[:space:]]*##.*$" diff --git a/runtime/syntax/conky.yaml b/runtime/syntax/conky.yaml new file mode 100644 index 00000000..197cf711 --- /dev/null +++ b/runtime/syntax/conky.yaml @@ -0,0 +1,12 @@ +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" + - 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" + - 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$" diff --git a/runtime/syntax/crystal.yaml b/runtime/syntax/crystal.yaml new file mode 100644 index 00000000..a4351641 --- /dev/null +++ b/runtime/syntax/crystal.yaml @@ -0,0 +1,25 @@ +filetype: crystal + +detect: + filename: "\\.cr$|Gemfile|config.ru|Rakefile|Capfile|Vagrantfile" + header: "^#!.*/(env +)?crystal( |$)" + +rules: + - statement: "\\b(BEGIN|END|abstract|alias|and|begin|break|case|class|def|defined\\?|do|else|elsif|end|ensure|enum|false|for|fun|if|in|include|lib|loop|macro|module|next|nil|not|of|or|pointerof|private|protected|raise|redo|require|rescue|retry|return|self|sizeof|spawn|struct|super|then|true|type|undef|union|uninitialized|unless|until|when|while|yield)\\b" + - constant: "(\\$|@|@@)?\\b[A-Z]+[0-9A-Z_a-z]*" + - constant.number: "\\b[0-9]+\\b" + - constant: "([ ]|^):[0-9A-Z_]+\\b" + - constant: "\\b(__FILE__|__LINE__)\\b" + - constant: "/([^/]|(\\\\/))*/[iomx]*|%r\\{([^}]|(\\\\}))*\\}[iomx]*" + - constant.string: "`[^`]*`|%x\\{[^}]*\\}" + - constant.string: "\"([^\"]|(\\\\\"))*\"|%[QW]?\\{[^}]*\\}|%[QW]?\\([^)]*\\)|%[QW]?<[^>]*>|%[QW]?\\[[^]]*\\]|%[QW]?\\$[^$]*\\$|%[QW]?\\^[^^]*\\^|%[QW]?![^!]*!" + - special: "#\\{[^}]*\\}" + - constant.string.char: "'([^']|(\\\\'))*'|%[qw]\\{[^}]*\\}|%[qw]\\([^)]*\\)|%[qw]<[^>]*>|%[qw]\\[[^]]*\\]|%[qw]\\$[^$]*\\$|%[qw]\\^[^^]*\\^|%[qw]![^!]*!" + - comment: "#[^{].*$|#$" + - comment.bright: "##[^{].*$|##$" + - constant: + start: "<<-?'?EOT'?" + end: "^EOT" + rules: [] + + - todo: "(XXX|TODO|FIXME|\\?\\?\\?)" diff --git a/runtime/syntax/csharp.yaml b/runtime/syntax/csharp.yaml new file mode 100644 index 00000000..e027e0ca --- /dev/null +++ b/runtime/syntax/csharp.yaml @@ -0,0 +1,29 @@ +filetype: c# + +detect: + filename: "\\.cs$" + +rules: + - identifier.class: "class +[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?" + - identifier.var: "@[A-Za-z]+" + - identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[()]" + - type: "\\b(bool|byte|sbyte|char|decimal|double|float|IntPtr|int|uint|long|ulong|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|while)\\b" + - statement: "\\b(abstract|async|class|const|delegate|enum|event|explicit|extern|get|implicit|in|internal|interface|namespace|operator|out|override|params|partial|private|protected|public|readonly|ref|sealed|set|sizeof|stackalloc|static|struct|typeof|unsafe|using|value|virtual|volatile|yield)\\b" + - 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: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - constant.specialChar: "\\\\([btnfr]|'|\\\"|\\\\)" + - constant.specialChar: "\\\\u[A-Fa-f0-9]{4}" + - comment: "(^|[[:space:]])//.*" + - comment: + start: "/\\*" + end: "\\*/" + rules: [] + + - todo: "TODO:?" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/css.yaml b/runtime/syntax/css.yaml index eb2c4842..975dc0be 100644 --- a/runtime/syntax/css.yaml +++ b/runtime/syntax/css.yaml @@ -1,42 +1,35 @@ filetype: css -detect: +detect: filename: "\\.(css|scss)$" rules: - # Classes and IDs - - statement: "(?i)." - - normal: + - statement: "." + - default: start: "\\{" end: "\\}" rules: [] - # css commands + + - symbol.brackets: "\\{|\\}" - type: "(align-content|align-items|alignment-baseline|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|appearance|azimuth|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|baseline-shift|bookmark-label|bookmark-level|bookmark-state|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-boundary|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-decoration-break|box-shadow|box-sizing|box-snap|box-suppress|break-after|break-before|break-inside|caption-side|caret|caret-animation|caret-color|caret-shape|chains|clear|clip|clip-path|clip-rule|color|color-interpolation-filters|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|columns|column-span|column-width|content|continue|counter-increment|counter-reset|counter-set|cue|cue-after|cue-before|cursor|direction|display|dominant-baseline|elevation|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|float-defer|float-offset|float-reference|flood-color|flood-opacity|flow|flow-from|flow-into|font|font-family|font-feature-settings|font-kerning|font-language-override|font-size|font-size-adjust|font-stretch|font-style|font-synthesis|font-variant|font-variant-alternates|font-variant-caps|font-variant-east-asian|font-variant-ligatures|font-variant-numeric|font-variant-position|font-weight|footnote-display|footnote-policy|glyph-orientation-vertical|grid|grid-area|grid-auto-columns|grid-auto-flow|grid-auto-rows|grid-column|grid-column-end|grid-column-gap|grid-column-start|grid-gap|grid-row|grid-row-end|grid-row-gap|grid-row-start|grid-template|grid-template-areas|grid-template-columns|grid-template-rows|hanging-punctuation|height|hyphenate-character|hyphenate-limit-chars|hyphenate-limit-last|hyphenate-limit-lines|hyphenate-limit-zone|hyphens|image-orientation|image-rendering|image-resolution|initial-letter|initial-letter-align|initial-letter-wrap|isolation|justify-content|justify-items|justify-self|left|letter-spacing|lighting-color|line-break|line-grid|line-height|line-snap|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|marker|marker-end|marker-knockout-left|marker-knockout-right|marker-mid|marker-pattern|marker-segment|marker-side|marker-start|marquee-direction|marquee-loop|marquee-speed|marquee-style|mask|mask-border|mask-border-mode|mask-border-outset|mask-border-repeat|mask-border-slice|mask-border-source|mask-border-width|mask-clip|mask-composite|mask-image|mask-mode|mask-origin|mask-position|mask-repeat|mask-size|mask-type|max-height|max-lines|max-width|min-height|min-width|mix-blend-mode|motion|motion-offset|motion-path|motion-rotation|nav-down|nav-left|nav-right|nav-up|object-fit|object-position|offset-after|offset-before|offset-end|offset-start|opacity|order|orphans|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-style|overflow-wrap|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page|page-break-after|page-break-before|page-break-inside|pause|pause-after|pause-before|perspective|perspective-origin|pitch|pitch-range|play-during|polar-anchor|polar-angle|polar-distance|polar-origin|position|presentation-level|quotes|region-fragment|resize|rest|rest-after|rest-before|richness|right|rotation|rotation-point|ruby-align|ruby-merge|ruby-position|running|scroll-behavior|scroll-snap-align|scroll-snap-margin|scroll-snap-margin-block|scroll-snap-margin-block-end|scroll-snap-margin-block-start|scroll-snap-margin-bottom|scroll-snap-margin-inline|scroll-snap-margin-inline-end|scroll-snap-margin-inline-start|scroll-snap-margin-left|scroll-snap-margin-right|scroll-snap-margin-top|scroll-snap-padding|scroll-snap-padding-block|scroll-snap-padding-block-end|scroll-snap-padding-block-start|scroll-snap-padding-bottom|scroll-snap-padding-inline|scroll-snap-padding-inline-end|scroll-snap-padding-inline-start|scroll-snap-padding-left|scroll-snap-padding-right|scroll-snap-padding-top|scroll-snap-type|shape-image-threshold|shape-inside|shape-margin|shape-outside|size|speak|speak-as|speak-header|speak-numeral|speak-punctuation|speech-rate|stress|string-set|stroke|stroke-alignment|stroke-dashadjust|stroke-dasharray|stroke-dashcorner|stroke-dashoffset|stroke-linecap|stroke-linejoin|stroke-miterlimit|stroke-opacity|stroke-width|table-layout|tab-size|text-align|text-align-all|text-align-last|text-combine-upright|text-decoration|text-decoration-color|text-decoration-line|text-decoration-skip|text-decoration-style|text-emphasis|text-emphasis-color|text-emphasis-position|text-emphasis-style|text-indent|text-justify|text-orientation|text-overflow|text-shadow|text-space-collapse|text-space-trim|text-spacing|text-transform|text-underline-position|text-wrap|top|transform|transform-box|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch|voice-range|voice-rate|voice-stress|voice-volume|volume|white-space|widows|width|will-change|word-break|word-spacing|word-wrap|wrap-after|wrap-before|wrap-flow|wrap-inside|wrap-through|writing-mode|z-index):" - - normal: + - default: start: ":" end: "[;^\\{]" rules: [] + - special: "!important" - identifier: ":active|:focus|:hover|:link|:visited|:link|:after|:before|$" - - special: "(\\{|\\}|\\(|\\)|\\;|:|\\]|~|<|>|,)" - # SCSS Varaibles - - statement: "@import|@mixin|@extend" - # Strings - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." - - special: "\"|'" - # Comments & TODOs + - symbol: "(\\{|\\}|\\(|\\)|\\;|:|\\]|~|<|>|,)" + - identifier: "(?i)\\$\\{?[0-9A-Z_!@#$*?-]+\\}?" + - preproc: "@import|@mixin|@extend" + - constant.number: "(?i)#[0-9A-F]{6,6}" + - constant.string: "\"(\\\\.|[^\"])*\"" + - constant.string: "'(\\\\.|[^'])*'" + - special: "\"" + - special: "'" - comment: start: "\\/\\*" end: "\\*\\/" - rules: - - todo: "(TODO|XXX|FIXME):?" - + rules: [] + + - todo: "(TODO|XXX|FIXME):?" diff --git a/runtime/syntax/cython.yaml b/runtime/syntax/cython.yaml new file mode 100644 index 00000000..3c31cfd9 --- /dev/null +++ b/runtime/syntax/cython.yaml @@ -0,0 +1,23 @@ +filetype: cython + +detect: + filename: "\\.pyx$|\\.pxd$|\\.pyi$" + +rules: + - preproc: "def [ 0-9A-Z_]+" + - preproc: "cpdef [0-9A-Z_]+\\(.*\\):" + - preproc: "cdef cppclass [ 0-9A-Z_]+\\(.*\\):" + - 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" + - identifier.macro: "\\b(cdef|cimport|cpdef|cppclass|ctypedef|extern|include|namespace|property|struct)\\b" + - type: "\\b(bint|char|double|int|public|void|unsigned)\\b" + - symbol: "[.:;,+*|=!\\%]|<|>|/|-|&" + - symbol.brackets: "[(){}]|\\[|\\]" + - constant.string: "['][^']*[^\\\\][']|[']{3}.*[^\\\\][']{3}" + - constant.string: "[\"][^\"]*[^\\\\][\"]|[\"]{3}.*[^\\\\][\"]{3}" + - constant.string: + start: "\"\"\"[^\"]\" end=\"\"\"\"\" start=\"'''[^']" + end: "'''" + rules: [] + + - comment: "#.*$" diff --git a/runtime/syntax/d.yaml b/runtime/syntax/d.yaml index 6f1b0f67..d3c1a8de 100644 --- a/runtime/syntax/d.yaml +++ b/runtime/syntax/d.yaml @@ -1,118 +1,57 @@ filetype: d -detect: +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?)?" - # 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: "'" - rules: - - constant.specialChar: "\\\\." - # Keywords - # a-e + - constant.string: "'([^\\']|\\\\(['\"?\\abfnrtv]|x[[:xdigit:]]{2}|[0-7]{1,3}|u[[:xdigit:]]{4}|U[[:xdigit:]]{8}|&.*;))'" - 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: "\"" - rules: - - constant.specialChar: "\\\\." - # WysiwygString + - constant.string: "\"(\\\\.|[^\"])*\"" - 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: "\\\\." + rules: [] + + - constant.string: "`[^`]*`" + - constant.string: "x\"([[:space:]]*[[:xdigit:]][[:space:]]*[[:xdigit:]])*[[:space:]]*\"" + - constant.string: "q\"\\(.*\\)\"" + - constant.string: "q\"\\{.*\\}\"" + - constant.string: "q\"\\[.*\\]\"" + - constant.string: "q\"<.*>\"" - constant.string: start: "q\"[^({[<\"][^\"]*$" end: "^[^\"]+\"" - rules: - - constant.specialChar: "\\\\." - - constant.string: - start: "q\"([^({[<\"])" - end: "\"" - rules: - - constant.specialChar: "\\\\." - # Comments - - comment: - start: "//" - end: "$" rules: [] + + - constant.string: "q\"([^({[<\"]).*\"" + - comment: "//.*" - comment: start: "/\\*" end: "\\*/" rules: [] + - comment: start: "/\\+" end: "\\+/" rules: [] + diff --git a/runtime/syntax/dart.yaml b/runtime/syntax/dart.yaml index c1def238..87663a92 100644 --- a/runtime/syntax/dart.yaml +++ b/runtime/syntax/dart.yaml @@ -1,6 +1,6 @@ filetype: dart -detect: +detect: filename: "\\.dart$" rules: @@ -11,33 +11,13 @@ rules: - 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" + - constant.bool: "\\b(true|false|null)\\b" - type: "\\b(List|String)\\b" - type: "\\b(int|num|double|bool)\\b" - - statement: "[-+/*=<>!~%?:&|]" + - symbol.operator: "[-+/*=<>!~%?:&|]" - 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: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." + - comment: "(^|[[:space:]])//.*" + - comment: "/\\*.+\\*/" + - todo: "TODO:?" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" diff --git a/runtime/syntax/dockerfile.yaml b/runtime/syntax/dockerfile.yaml index 3481dc9a..3aa7edce 100644 --- a/runtime/syntax/dockerfile.yaml +++ b/runtime/syntax/dockerfile.yaml @@ -1,33 +1,12 @@ filetype: dockerfile -detect: - filename: "(Dockerfile[^/]*$|\\.dockerfile$)" +detect: + filename: "Dockerfile[^/]*$|\\.dockerfile$" rules: - ## Keywords - - 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 + - statement: "^(FROM|MAINTAINER|RUN|CMD|LABEL|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ONBUILD|ARG|HEALTHCHECK|STOPSIGNAL|SHELL)[[:space:]]" + - symbol.brackets: "(\\(|\\)|\\[|\\])" - special: "&&" - - ## Comments - - comment: - start: "#" - end: "$" - rules: - - todo: "(TODO|XXX|FIXME):?" - - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." + - comment: "^[[:space:]]*#.*$" + - constant.string: "'([^']|(\\\\'))*'|%[qw]\\{[^}]*\\}|%[qw]\\([^)]*\\)|%[qw]<[^>]*>|%[qw]\\[[^]]*\\]|%[qw]\\$[^$]*\\$|%[qw]\\^[^^]*\\^|%[qw]![^!]*!" + - constant.string: "\"([^\"]|(\\\\\"))*\"|%[QW]?\\{[^}]*\\}|%[QW]?\\([^)]*\\)|%[QW]?<[^>]*>|%[QW]?\\[[^]]*\\]|%[QW]?\\$[^$]*\\$|%[QW]?\\^[^^]*\\^|%[QW]?![^!]*!" diff --git a/runtime/syntax/dot.yaml b/runtime/syntax/dot.yaml new file mode 100644 index 00000000..4f6e501f --- /dev/null +++ b/runtime/syntax/dot.yaml @@ -0,0 +1,16 @@ +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: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - comment: "(^|[[:space:]])//.*" + - comment: + start: "/\\*" + end: "\\*/" + rules: [] + diff --git a/runtime/syntax/erb.yaml b/runtime/syntax/erb.yaml new file mode 100644 index 00000000..d58e9b2d --- /dev/null +++ b/runtime/syntax/erb.yaml @@ -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-F]{6,6}" + - constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" + - comment: "" + - preproc: "" + - 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|\\?\\?\\?)" diff --git a/runtime/syntax/fish.yaml b/runtime/syntax/fish.yaml index 690f795f..1052118a 100644 --- a/runtime/syntax/fish.yaml +++ b/runtime/syntax/fish.yaml @@ -1,45 +1,25 @@ filetype: fish -detect: +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 + - constant.number: "\\b[0-9]+\\b" + - statement: "\\b(and|begin|case|else|end|for|function|if|in|not|or|select|shift|switch|while)\\b" + - special: "\\b(break|continue|return)\\b" + - symbol: "(\\;|`|\\\\|\\$|<|>|^|!|=|&|\\|)" + - symbol.brackets: "\\{|\\}|\\(|\\)|\\[|\\]" - 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: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: [] - - - comment: - start: "#" - end: "$" - rules: - - todo: "(TODO|XXX|FIXME):?" + - constant.string: "\"(\\\\.|[^\"])*\"" + - constant.string: "'(\\\\.|[^'])*'" + - constant.specialChar: "\"" + - constant.specialChar: "'" + - identifier: "\\$\\{?[0-9A-Za-z_!@#$*?-]+\\}?" + - comment: "(^|[[:space:]])#.*$" + - todo: "(TODO|XXX|FIXME):?" + - preproc.shebang: "^#!.+?( |$)" diff --git a/runtime/syntax/fortran.yaml b/runtime/syntax/fortran.yaml new file mode 100644 index 00000000..c78db9dd --- /dev/null +++ b/runtime/syntax/fortran.yaml @@ -0,0 +1,37 @@ +filetype: fortran + +detect: + filename: "\\.([Ff]|[Ff]90|[Ff]95|[Ff][Oo][Rr])$" + +rules: + - constant.number: "\\b[0-9]+\\b" + - type: "(?i)\\b(action|advance|all|allocatable|allocated|any|apostrophe)\\b" + - type: "(?i)\\b(append|asis|assign|assignment|associated|character|common)\\b" + - type: "(?i)\\b(complex|data|default|delim|dimension|double precision)\\b" + - type: "(?i)\\b(elemental|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)\\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|function|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)\\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.|repeat|select case|then|where|while)\\b" + - special: "(?i)\\b(continue|cycle|exit|go?to|result|return)\\b" + - symbol.operator: "[.:;,+*|=!\\%]|\\b|\\b|/|-|&" + - symbol.bracket: "[(){}]|\\[|\\]" + - preproc: "^[[:space:]]*#[[:space:]]*(define|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)" + - constant.string: "\\b[^= ]*\\b|\"(\\\\.|[^\"])*\"" + - constant.string: "\\b[^= ]*\\b|'(\\\\.|[^\"])*'" + - comment: "!.*$|(^[Cc]| [Cc]) .*$" diff --git a/runtime/syntax/gdscript.yaml b/runtime/syntax/gdscript.yaml new file mode 100644 index 00000000..e9df1795 --- /dev/null +++ b/runtime/syntax/gdscript.yaml @@ -0,0 +1,31 @@ +filetype: gdscript + +detect: + filename: "\\.gd$" + +rules: + - constant: "\\b(null|self|true|false)\\b" + - 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" + - identifier: "\\b(AnimationPlayer|AnimationTreePlayer|Button|Control|HTTPClient|HTTPRequest|Input|InputEvent|MainLoop|Node|Node2D|SceneTree|Spatial|SteamPeer|PacketPeer|PacketPeerUDP|Timer|Tween)\\b" + - type: "\\b(Vector2|Vector3)\\b" + - identifier: "func [a-zA-Z_0-9]+" + - statement: "\\b(and|as|assert|break|breakpoint|class|const|continue|elif|else|export|extends|for|func|if|in|map|not|onready|or|pass|return|signal|var|while|yield)\\b" + - special: "@.*[(]" + - statement: "[.:;,+*|=!\\%@]|<|>|/|-|&" + - statement: "[(){}]|\\[|\\]" + - constant: "\\b[0-9]+\\b" + - constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b|'.'" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - 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: "`[^`]*`" + - comment: "#.*$" + - comment: + start: "\"\"\"([^\"]|$)" + end: "\"\"\"" + rules: [] + + - comment: + start: "'''([^']|$)" + end: "'''" + rules: [] + diff --git a/runtime/syntax/gentoo-ebuild.yaml b/runtime/syntax/gentoo-ebuild.yaml index abe744e1..05866b34 100644 --- a/runtime/syntax/gentoo-ebuild.yaml +++ b/runtime/syntax/gentoo-ebuild.yaml @@ -1,44 +1,24 @@ filetype: ebuild -detect: +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 + - statement: "-(eq|ne|gt|lt|ge|le|s|n|z)\\b" - 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(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: "\\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" - # Highlight comments (doesnt work that well) - - comment: - start: "#" - end: "$" - rules: [] - # Highlight strings (doesnt work that well) - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." - \ No newline at end of file + - comment: "#.*$" + - constant.string: "\"(\\\\.|[^\\\"])*\"|'(\\\\.|[^'])*'" diff --git a/runtime/syntax/gentoo-etc-portage.yaml b/runtime/syntax/gentoo-etc-portage.yaml new file mode 100644 index 00000000..4856fc27 --- /dev/null +++ b/runtime/syntax/gentoo-etc-portage.yaml @@ -0,0 +1,15 @@ +filetype: etc-portage + +detect: + filename: "\\.(keywords|mask|unmask|use)$" + +rules: + - default: "^.+$" + - constant.bool.false: "[[:space:]]+\\+?[a-zA-Z0-9_-]+" + - constant.bool.true: "[[:space:]]+-[a-zA-Z0-9_-]+" + - special: "-[[:digit:]].*([[:space:]]|$)" + - identifier.class: "[~-]?\\b(alpha|amd64|arm|hppa|ia64|mips|ppc|ppc64|s390|sh|sparc|x86|x86-fbsd)\\b" + - identifier.class: "[[:space:]][~-]?\\*" + - statement: "^[[:space:]]*.*/" + - symbol: "^[[:space:]]*(=|~|<|<=|=<|>|>=|=>)" + - comment: "#.*$" diff --git a/runtime/syntax/git-commit.yaml b/runtime/syntax/git-commit.yaml index 40b46acd..dffec546 100644 --- a/runtime/syntax/git-commit.yaml +++ b/runtime/syntax/git-commit.yaml @@ -1,30 +1,20 @@ filetype: git-commit -detect: +detect: filename: "COMMIT_EDITMSG|TAG_EDITMSG" rules: - # Commit message - ignore: ".*" - # Comments - - comment: - start: "#" - end: "$" - rules: [] - # File changes - - keyword: "#[[:space:]](deleted|modified|new file|renamed):[[:space:]].*" - - keyword: "#[[:space:]]deleted:" - - keyword: "#[[:space:]]modified:" - - keyword: "#[[:space:]]new file:" - - keyword: "#[[:space:]]renamed:" - # Untracked filenames + - comment: "^#.*" + - statement: "#[[:space:]](deleted|modified|new file|renamed):[[:space:]].*" + - statement: "#[[:space:]]deleted:" + - statement: "#[[:space:]]modified:" + - statement: "#[[:space:]]new file:" + - statement: "#[[:space:]]renamed:" - error: "^# [^/?*:;{}\\\\]+\\.[^/?*:;{}\\\\]+$" - - keyword: "^#[[:space:]]Changes.*[:]" - - keyword: "^#[[:space:]]Your branch and '[^']+" - - keyword: "^#[[:space:]]Your branch and '" - - keyword: "^#[[:space:]]On branch [^ ]+" - - keyword: "^#[[:space:]]On branch" - # Recolor hash symbols + - statement: "^#[[:space:]]Changes.*[:]" + - statement: "^#[[:space:]]Your branch and '[^']+" + - statement: "^#[[:space:]]Your branch and '" + - statement: "^#[[:space:]]On branch [^ ]+" + - statement: "^#[[:space:]]On branch" - special: "#" - # Trailing spaces (+LINT is not ok, git uses tabs) - - error: "[[:space:]]+$" diff --git a/runtime/syntax/git-config.yaml b/runtime/syntax/git-config.yaml index bfd52e82..bfffd1e4 100644 --- a/runtime/syntax/git-config.yaml +++ b/runtime/syntax/git-config.yaml @@ -1,14 +1,12 @@ filetype: git-config -detect: +detect: filename: "git(config|modules)$|\\.git/config$" rules: - - constant: "\\<(true|false)\\>" - - keyword: "^[[:space:]]*[^=]*=" + - constant.bool.true: "\\btrue\\b" + - constant.bool.false: "\\bfalse\\b" + - statement: "^[[:space:]]*[^=]*=" - constant: "^[[:space:]]*\\[.*\\]$" - - constant: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" - - comment: - start: "#" - end: "$" - rules: [] + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - comment: "(^|[[:space:]])#([^{].*)?$" diff --git a/runtime/syntax/git-rebase-todo.yaml b/runtime/syntax/git-rebase-todo.yaml index 8866c975..ac533b6c 100644 --- a/runtime/syntax/git-rebase-todo.yaml +++ b/runtime/syntax/git-rebase-todo.yaml @@ -1,30 +1,22 @@ filetype: git-rebase-todo -detect: +detect: filename: "git-rebase-todo" rules: - # Default - ignore: ".*" - # Comments - - comment: - start: "#" - end: "$" - rules: [] - # Rebase commands - - keyword: "^(e|edit) [0-9a-f]{7,40}" - - keyword: "^# (e, edit)" - - keyword: "^(f|fixup) [0-9a-f]{7,40}" - - keyword: "^# (f, fixup)" - - keyword: "^(p|pick) [0-9a-f]{7,40}" - - keyword: "^# (p, pick)" - - keyword: "^(r|reword) [0-9a-f]{7,40}" - - keyword: "^# (r, reword)" - - keyword: "^(s|squash) [0-9a-f]{7,40}" - - keyword: "^# (s, squash)" - - keyword: "^(x|exec) [^ ]+ [0-9a-f]{7,40}" - - keyword: "^# (x, exec)" - # Recolor hash symbols + - comment: "^#.*" + - statement: "^(e|edit) [0-9a-f]{7,40}" + - statement: "^# (e, edit)" + - statement: "^(f|fixup) [0-9a-f]{7,40}" + - statement: "^# (f, fixup)" + - statement: "^(p|pick) [0-9a-f]{7,40}" + - statement: "^# (p, pick)" + - statement: "^(r|reword) [0-9a-f]{7,40}" + - statement: "^# (r, reword)" + - statement: "^(s|squash) [0-9a-f]{7,40}" + - statement: "^# (s, squash)" + - statement: "^(x|exec) [^ ]+ [0-9a-f]{7,40}" + - statement: "^# (x, exec)" - special: "#" - # Commit IDs - identifier: "[0-9a-f]{7,40}" diff --git a/runtime/syntax/glsl.yaml b/runtime/syntax/glsl.yaml index faf30d57..f1da0237 100644 --- a/runtime/syntax/glsl.yaml +++ b/runtime/syntax/glsl.yaml @@ -1,26 +1,23 @@ filetype: glsl -detect: +detect: filename: "\\.(frag|vert|fp|vp|glsl)$" rules: - - identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[()]" - - type: "\\<(void|bool|bvec2|bvec3|bvec4|int|ivec2|ivec3|ivec4|float|vec2|vec3|vec4|mat2|mat3|mat4|struct|sampler1D|sampler2D|sampler3D|samplerCUBE|sampler1DShadow|sampler2DShadow)\\>" - - statement: "\\" - - statement: "\\<(const|attribute|varying|uniform|in|out|inout|if|else|return|discard|while|for|do)\\>" - - statement: "\\<(break|continue)\\>" - - constant: "\\<(true|false)\\>" - - statement: "[-+/*=<>?:!~%&|^]" - - constant.number: "\\<([0-9]+|0x[0-9a-fA-F]*)\\>" - - - comment: - start: "//" - end: "$" - rules: - - todo: "TODO:?" - + - identifier.class: "[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|discard|while|for|do)\\b" + - special: "\\b(break|continue|return)\\b" + - constant.bool: "\\b(true|false)\\b" + - symbol.operator: "[\\-+/*=<>?:!~%&|^]" + - constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b" + - comment: "(^|[[:space:]])//.*" - comment: start: "/\\*" end: "\\*/" - rules: - - todo: "TODO:?" + rules: [] + + - todo: "TODO:?" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/go.yaml b/runtime/syntax/go.yaml index 4cb34bd7..fe98124b 100644 --- a/runtime/syntax/go.yaml +++ b/runtime/syntax/go.yaml @@ -1,52 +1,31 @@ filetype: go -detect: +detect: filename: "\\.go$" rules: - - statement: "\\b(break|case|continue|default|else|for|go|goto|if|range|return|switch)\\b" - - statement: "\\b(package|import|const|var|type|struct|func|go|defer|iota)\\b" - - statement: "[-+/*=<>!~%&|^]|:=" - - identifier: "[a-zA-Z0-9]*\\(" + - special: "\\b(break|case|continue|default|go|goto|range|return)\\b" + - statement: "\\b(else|for|if|switch)\\b" + - preproc: "\\b(package|import|const|var|type|struct|func|go|defer|iota)\\b" + - symbol.operator: "[-+/*=<>!~%&|^]|:=" + - special: "[a-zA-Z0-9]*\\(" + - 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" - - constant: "\\b(true|false|nil)\\b" - - statement: "(\\{|\\})" - - statement: "(\\(|\\))" - - statement: "(\\[|\\])" - - statement: "!" - - statement: "," - - constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b" - - 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):?" - + - type.keyword: "\\b(struct)\\b" + - constant.bool: "\\b(true|false|nil)\\b" + - symbol.brackets: "(\\{|\\})" + - symbol.brackets: "(\\(|\\))" + - symbol.brackets: "(\\[|\\])" + - constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b|'.'" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - 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: "`[^`]*`" + - comment: "(^|[[:space:]])//.*" - comment: start: "/\\*" end: "\\*/" - rules: - - todo: "(TODO|XXX|FIXME):?" - - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - constant.specialChar: "%." - - - constant.string: - start: "'" - end: "'" - rules: - - preproc: "..+" - - constant.specialChar: "%." - - constant.specialChar: "\\\\." - - - constant.string: - start: "`" - end: "`" rules: [] + + - todo: "(TODO|XXX|FIXME):?" diff --git a/runtime/syntax/golo.yaml b/runtime/syntax/golo.yaml new file mode 100644 index 00000000..e53ec51e --- /dev/null +++ b/runtime/syntax/golo.yaml @@ -0,0 +1,50 @@ +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: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - comment: "#.*$" + - comment: + start: "----" + end: "----" + rules: [] + + - todo: "TODO:?" diff --git a/runtime/syntax/groff.yaml b/runtime/syntax/groff.yaml new file mode 100644 index 00000000..39663ea1 --- /dev/null +++ b/runtime/syntax/groff.yaml @@ -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]" diff --git a/runtime/syntax/haml.yaml b/runtime/syntax/haml.yaml new file mode 100644 index 00000000..7f94cd2f --- /dev/null +++ b/runtime/syntax/haml.yaml @@ -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: "#[^{].*$|#$" diff --git a/runtime/syntax/haskell.yaml b/runtime/syntax/haskell.yaml new file mode 100644 index 00000000..d69e46f0 --- /dev/null +++ b/runtime/syntax/haskell.yaml @@ -0,0 +1,24 @@ +filetype: haskell + +detect: + filename: "\\.hs$" + +rules: + - statement: "[ ](as|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)[ ]" + - statement: "(^data|^foreign|^import|^infix|^infixl|^infixr|^instance|^module|^newtype|^type)[ ]" + - statement: "[ ](as$|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$)" + - symbol: "(\\||@|!|:|_|~|=|\\\\|;|\\(\\)|,|\\[|\\]|\\{|\\})" + - symbol.operator: "(==|/=|&&|\\|\\||<|>|<=|>=)" + - special: "(->|<-)" + - symbol: "\\.|\\$" + - constant.bool: "\\b(True|False)\\b" + - constant: "(Nothing|Just|Left|Right|LT|EQ|GT)" + - identifier.class: "[ ](Read|Show|Enum|Eq|Ord|Data|Bounded|Typeable|Num|Real|Fractional|Integral|RealFrac|Floating|RealFloat|Monad|MonadPlus|Functor)" + - constant.string: "\"[^\\\"]*\"" + - comment: "--.*" + - comment: + start: "\\{-" + end: "-\\}" + rules: [] + + - identifier.micro: "undefined" diff --git a/runtime/syntax/html.yaml b/runtime/syntax/html.yaml index 3987ac38..d623a680 100644 --- a/runtime/syntax/html.yaml +++ b/runtime/syntax/html.yaml @@ -1,26 +1,24 @@ filetype: html -detect: +detect: filename: "\\.htm[l]?$" rules: - - identifier: "<.*?>" + - 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:]]]*;" - - statement: "(alt|bgcolor|height|href|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)=" - - - constant.string: - start: "\"" - end: "\"" + - 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-F]{6,6}" + - default: + start: ">" + end: "<" rules: [] - - default: - start: "" - end: "" - rules: - - include: "javascript" - - - default: - start: "" - end: "" - rules: - - include: "css" + - symbol.tag: "<|>" + - constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" + - comment: "" + - preproc: "" diff --git a/runtime/syntax/html4.yaml b/runtime/syntax/html4.yaml new file mode 100644 index 00000000..cd66276e --- /dev/null +++ b/runtime/syntax/html4.yaml @@ -0,0 +1,25 @@ +filetype: html4 + +detect: + filename: "\\.htm[l]?$" + header: "" + +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-F]{6,6}" + - default: + start: ">" + end: "<" + rules: [] + + - symbol.tag: "<|>" + - constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" + - comment: "" + - preproc: "" diff --git a/runtime/syntax/html5.yaml b/runtime/syntax/html5.yaml new file mode 100644 index 00000000..82323270 --- /dev/null +++ b/runtime/syntax/html5.yaml @@ -0,0 +1,25 @@ +filetype: html5 + +detect: + filename: "\\.htm[l]?$" + header: "" + +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-F]{6,6}" + - default: + start: ">" + end: "<" + rules: [] + + - symbol.tag: "<|>" + - constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" + - comment: "" + - preproc: "" diff --git a/runtime/syntax/ini.yaml b/runtime/syntax/ini.yaml new file mode 100644 index 00000000..a6ab79ab --- /dev/null +++ b/runtime/syntax/ini.yaml @@ -0,0 +1,14 @@ +filetype: ini + +detect: + filename: "\\.(ini|desktop|lfl|override)$|(mimeapps\\.list|pinforc|setup\\.cfg)$|weechat/.+\\.conf$" + header: "^\\[[A-Za-z]+\\]$" + +rules: + - constant.bool.true: "\\btrue\\b" + - constant.bool.false: "\\bfalse\\b" + - identifier: "^[[:space:]]*[^=]*=" + - special: "^[[:space:]]*\\[.*\\]$" + - statement: "[=;]" + - comment: "(^|[[:space:]])#([^{].*)?$" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" diff --git a/runtime/syntax/inputrc.yaml b/runtime/syntax/inputrc.yaml new file mode 100644 index 00000000..9df431eb --- /dev/null +++ b/runtime/syntax/inputrc.yaml @@ -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: " + +| + +" diff --git a/runtime/syntax/java.yaml b/runtime/syntax/java.yaml index 23798d96..e606de69 100644 --- a/runtime/syntax/java.yaml +++ b/runtime/syntax/java.yaml @@ -1,34 +1,23 @@ filetype: java -detect: +detect: filename: "\\.java$" rules: - type: "\\b(boolean|byte|char|double|float|int|long|new|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" + - type.keyword: "\\b(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\\b" + - constant.string: "\"[^\"]*\"" + - constant.bool: "\\b(true|false|null)\\b" - constant.number: "\\b[0-9]+\\b" - - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: - - preproc: "..+" - - constant.specialChar: "\\\\." - - - comment: - start: "//" - end: "$" - rules: [] - + - comment: "//.*" - comment: start: "/\\*" end: "\\*/" rules: [] + + - comment: + start: "/\\*\\*" + end: "\\*/" + rules: [] + diff --git a/runtime/syntax/javascript.yaml b/runtime/syntax/javascript.yaml index bb41762d..0e862e5a 100644 --- a/runtime/syntax/javascript.yaml +++ b/runtime/syntax/javascript.yaml @@ -1,42 +1,24 @@ filetype: javascript -detect: +detect: filename: "\\.js$" 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.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|delete|do|else|finally)\\b" - statement: "\\b(for|function|get|if|in|instanceof|new|return|set|switch)\\b" - statement: "\\b(switch|this|throw|try|typeof|var|void|while|with)\\b" - - constant: "\\b(null|undefined|NaN)\\b" - - constant: "\\b(true|false)\\b" + - constant.bool: "\\b(null|undefined|NaN)\\b" + - constant.bool: "\\b(true|false)\\b" - type: "\\b(Array|Boolean|Date|Enumerator|Error|Function|Math)\\b" - type: "\\b(Number|Object|RegExp|String)\\b" - - statement: "[-+/*=<>!~%?:&|]" + - symbol.operator: "[\\-+/*=<>!~%?:&|]" - constant: "/[^*]([^/]|(\\\\/))*[^\\\\]/[gim]*" - constant: "\\\\[0-7][0-7]?[0-7]?|\\\\x[0-9a-fA-F]+|\\\\[bfnrt'\"\\?\\\\]" - - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." - - - comment: - start: "//" - end: "$" - rules: [] - - - comment: - start: "/\\*" - end: "\\*/" - rules: [] + - comment: "(^|[[:space:]])//.*" + - comment: "/\\*.+\\*/" + - todo: "TODO:?" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" diff --git a/runtime/syntax/json.yaml b/runtime/syntax/json.yaml index e10f7f5b..bc8d55b3 100644 --- a/runtime/syntax/json.yaml +++ b/runtime/syntax/json.yaml @@ -1,24 +1,18 @@ filetype: json -detect: +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: "\"" - rules: - - constant.specialChar: "\\\\." - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." + - 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.bool: "\\b(null)\\b" + - constant.bool.true: "\\b(true)\\b" + - constant.bool.false: "\\b(false)\\b" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" - statement: "\\\"(\\\\\"|[^\"])*\\\"[[:space:]]*:\" \"'(\\'|[^'])*'[[:space:]]*:" - constant: "\\\\u[0-9a-fA-F]{4}|\\\\[bfnrt'\"/\\\\]" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/keymap.yaml b/runtime/syntax/keymap.yaml index bf28c2f7..c5282a3a 100644 --- a/runtime/syntax/keymap.yaml +++ b/runtime/syntax/keymap.yaml @@ -1,24 +1,14 @@ filetype: keymap -detect: +detect: filename: "\\.(k|key)?map$|Xmodmap$" rules: - statement: "\\b(add|clear|compose|keycode|keymaps|keysym|remove|string)\\b" - - statement: "\\b(control|alt|shift)\\b" + - identifier: "\\b(control|alt|shift)\\b" - constant.number: "\\b[0-9]+\\b" - - special: "=" - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." - - comment: - start: "^!" - end: "$" - rules: [] + - symbol: "=" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - comment: "^!.*$" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/kickstart.yaml b/runtime/syntax/kickstart.yaml new file mode 100644 index 00000000..b12d4f26 --- /dev/null +++ b/runtime/syntax/kickstart.yaml @@ -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: " + +| + +" diff --git a/runtime/syntax/ledger.yaml b/runtime/syntax/ledger.yaml new file mode 100644 index 00000000..cb05c8a9 --- /dev/null +++ b/runtime/syntax/ledger.yaml @@ -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:]]*;.*" diff --git a/runtime/syntax/lfe.yaml b/runtime/syntax/lfe.yaml new file mode 100644 index 00000000..c51ffbd3 --- /dev/null +++ b/runtime/syntax/lfe.yaml @@ -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: " + +| + +" diff --git a/runtime/syntax/lilypond.yaml b/runtime/syntax/lilypond.yaml index eda0b9ac..2ff49b31 100644 --- a/runtime/syntax/lilypond.yaml +++ b/runtime/syntax/lilypond.yaml @@ -1,24 +1,18 @@ filetype: lilypond -detect: +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_]+" + - identifier: "[[:space:]](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)[[:space:]]" + - 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: "\"" - rules: - - constant.specialChar: "\\\\." + - symbol.brackets: "[(){}<>]|\\[|\\]" + - constant.string: "\\\".*\\\"" - comment: - start: "%\\{" - end: "%\\}" - rules: [] - - comment: - start: "%" - end: "$" + start: "%{" + end: "%}" rules: [] + + - comment: "%.*$" diff --git a/runtime/syntax/lisp.yaml b/runtime/syntax/lisp.yaml new file mode 100644 index 00000000..ac75ab94 --- /dev/null +++ b/runtime/syntax/lisp.yaml @@ -0,0 +1,17 @@ +filetype: lisp + +detect: + filename: "(emacs|zile)$|\\.(el|li?sp|scm|ss)$" + +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: " + +| + +" diff --git a/runtime/syntax/lua.yaml b/runtime/syntax/lua.yaml index 0b485d5b..88b4622f 100644 --- a/runtime/syntax/lua.yaml +++ b/runtime/syntax/lua.yaml @@ -1,7 +1,7 @@ filetype: lua -detect: - filename: "\\.lua$" +detect: + filename: ".*\\.lua$" rules: - statement: "\\b(do|end|while|repeat|until|if|elseif|then|else|for|in|function|local|return)\\b" @@ -19,42 +19,20 @@ rules: - 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)\\b" - - constant: "\\b(false|nil|true)\\b" - - statement: "(\\b(dofile|require|include)|%q|%!|%Q|%r|%x)\\b" + - constant.bool: "\\b(false|nil|true)\\b" + - preproc: "(\\b(dofile|require|include)|%q|%!|%Q|%r|%x)\\b" - constant.number: "\\b([0-9]+)\\b" - symbol: "(\\(|\\)|\\[|\\]|\\{|\\}|\\*\\*|\\*|/|%|\\+|-|\\^|>|>=|<|<=|~=|=|\\.\\.)" - - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "\\[\\[" + - constant.string: "\\\"(\\\\.|[^\\\\\\\"])*\\\"|'(\\\\.|[^\\\\'])*'" + - constant: + start: "\\s*\\[\\[" end: "\\]\\]" - rules: - - constant.specialChar: "\\\\." + rules: [] - special: "\\\\[0-7][0-7][0-7]|\\\\x[0-9a-fA-F][0-9a-fA-F]|\\\\[abefnrs]|(\\\\c|\\\\C-|\\\\M-|\\\\M-\\\\C-)." - + - comment: "\\-\\-.*$" - comment: - start: "#" - end: "$" - rules: [] - - - comment: - start: "\\-\\-" - end: "$" - rules: [] - - - comment: - start: "\\-\\-\\[\\[" + start: "\\s*\\-\\-\\s*\\[\\[" end: "\\]\\]" rules: [] + diff --git a/runtime/syntax/mail.yaml b/runtime/syntax/mail.yaml index 57aa0344..0dc1473b 100644 --- a/runtime/syntax/mail.yaml +++ b/runtime/syntax/mail.yaml @@ -1,25 +1,19 @@ filetype: mail -detect: +detect: filename: "(.*/mutt-.*|\\.eml)$" header: "^From .* \\d+:\\d+:\\d+ \\d+" rules: - - type: "^From .*" + - constant: "^From .*" - identifier: "^[^[:space:]]+:" - preproc: "^List-(Id|Archive|Subscribe|Unsubscribe|Post|Help):" - constant: "^(To|From):" - - constant.string: - start: "^Subject:.*" - end: "$" - rules: - - constant.specialChar: "\\\\." + - constant.string: "^Subject:.*" - statement: "?" - default: start: "^\\n\\n" end: ".*" rules: [] - - comment: - start: "^>.*" - end: "$" - rules: [] + + - comment: "^>.*$" diff --git a/runtime/syntax/makefile.yaml b/runtime/syntax/makefile.yaml index da390ea3..a729dee4 100644 --- a/runtime/syntax/makefile.yaml +++ b/runtime/syntax/makefile.yaml @@ -1,14 +1,14 @@ filetype: makefile -detect: +detect: filename: "([Mm]akefile|\\.ma?k)$" header: "^#!.*/(env +)?[bg]?make( |$)" rules: - - preproc: "\\<(ifeq|ifdef|ifneq|ifndef|else|endif)\\>" - - statement: "^(export|include|override)\\>" - - operator: "^[^:= ]+:" - - operator: "([=,%]|\\+=|\\?=|:=|&&|\\|\\|)" + - preproc: "\\b(ifeq|ifdef|ifneq|ifndef|else|endif)\\b" + - preproc: "^(export|include|override)\\b" + - 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:]]" @@ -16,20 +16,9 @@ rules: - statement: "\\$\\((value|warning|wildcard|word|wordlist|words)[[:space:]]" - identifier: "^.+:" - identifier: "[()$]" - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" - identifier: "\\$+(\\{[^} ]+\\}|\\([^) ]+\\))" - identifier: "\\$[@^<*?%|+]|\\$\\([@^<*?%+-][DF]\\)" - identifier: "\\$\\$|\\\\.?" - - comment: - start: "#" - end: "$" - rules: [] + - comment: "(^|[[:space:]])#([^{].*)?$" + - comment: "^ @#.*" diff --git a/runtime/syntax/man.yaml b/runtime/syntax/man.yaml new file mode 100644 index 00000000..0760048a --- /dev/null +++ b/runtime/syntax/man.yaml @@ -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)" diff --git a/runtime/syntax/markdown.yaml b/runtime/syntax/markdown.yaml index bcf629d7..c4549bc6 100644 --- a/runtime/syntax/markdown.yaml +++ b/runtime/syntax/markdown.yaml @@ -1,49 +1,21 @@ filetype: markdown -detect: +detect: filename: "\\.(md|mkd|mkdn|markdown)$" rules: - # Tables (Github extension) - - type: ".*[ :]\\|[ :].*" - - # quotes - - statement: "^>.*" - - # Emphasis + - preproc: ".*[ :]\\|[ :].*" + - constant.string: "^>.*" - type: "(^|[[:space:]])(_[^ ][^_]*_|\\*[^ ][^*]*\\*)" - - # Strong emphasis - - type: "(^|[[:space:]])(__[^ ][^_]*__|\\*\\*[^ ][^*]*\\*\\*)" - - # strike-through + - type.keyword: "(^|[[:space:]])(__[^ ][^_]*__|\\*\\*[^ ][^*]*\\*\\*)" - 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 + - symbol: "^(---+|\\+---+|===+|\\+===+|___+|\\*\\*\\*+|\\+\\*\\*\\*+)\\s*$" + - statement: "^#{1,6}.*" + - identifier: "^[[:space:]]*[\\*+\\-] |^[[:space:]]*[0-9]+\\. " + - preproc: "\\b([CcRr]|[Tt][Mm])\\b|\\.{3}|(^|[[:space:]])\\-\\-($|[[:space:]])" - constant: "\\[[^]]+\\]" - constant: "\\[([^][]|\\[[^]]*\\])*\\]\\([^)]+\\)" - - # images - underlined: "!\\[[^][]*\\](\\([^)]+\\)|\\[[^]]+\\])" - - # urls - - underlined: "https?://[^ )>]+" - - - special: "^```$" - - - special: - start: "`" - end: "`" - rules: [] + - underlined.url: "https?://[^ )>]+" + - special: "`.*?`|^ {4}[^\\-+*].*" + - symbol: "^```$" diff --git a/runtime/syntax/micro.yaml b/runtime/syntax/micro.yaml index 588efb86..22f5d4f1 100644 --- a/runtime/syntax/micro.yaml +++ b/runtime/syntax/micro.yaml @@ -1,22 +1,17 @@ filetype: micro -detect: +detect: filename: "\\.(micro)$" rules: - statement: "\\b(syntax|color(-link)?)\\b" - - statement: "\\b(start=|end=)\\b" - - identifier: "\\b(default|comment|symbol|identifier|constant(.string(.char)?|.number)?|statement|preproc|type|special|underlined|error|todo|statusline|indent-char|(current-)?line-number|gutter-error|gutter-warning|cursor-line|color-column)\\b" + - type.keyword: "\\b(start=|end=)\\b" + - identifier: "\\b(default|comment|symbol(.brackets|.tag)?|identifier|constant(.string(.char)?|.bool|.specialChar|.number)?|statement|preproc|type|special|underlined|error|todo|statusline|indent-char|(current-)?line-number|gutter-error|gutter-warning|cursor-line|color-column|tabbar)\\b" + - preproc: "\\b(syntax|header)\\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: [] - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - constant.number: "#[0-9 A-F a-f]+" - \ No newline at end of file + - comment: "#.*$" + - comment.bright: "##.*$" + - constant.string: "\"(\\\\.|[^\"])*\"" + - constant.number: "#[0-9 A-F a-f]{1,6}" + - comment: "^#.*$" diff --git a/runtime/syntax/mpdconf.yaml b/runtime/syntax/mpdconf.yaml new file mode 100644 index 00000000..783c85e3 --- /dev/null +++ b/runtime/syntax/mpdconf.yaml @@ -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: " + +| + +" diff --git a/runtime/syntax/nanorc.yaml b/runtime/syntax/nanorc.yaml new file mode 100644 index 00000000..704501c7 --- /dev/null +++ b/runtime/syntax/nanorc.yaml @@ -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:]]*##.*$" diff --git a/runtime/syntax/nginx.yaml b/runtime/syntax/nginx.yaml new file mode 100644 index 00000000..c2223b5a --- /dev/null +++ b/runtime/syntax/nginx.yaml @@ -0,0 +1,22 @@ +filetype: nginx + +detect: + filename: "nginx.*\\.conf$|\\.nginx$" + 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: " + +| + +" diff --git a/runtime/syntax/nim.yaml b/runtime/syntax/nim.yaml new file mode 100644 index 00000000..e766cad9 --- /dev/null +++ b/runtime/syntax/nim.yaml @@ -0,0 +1,27 @@ +filetype: nim + +detect: + filename: "\\.nim$" + +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|array|openarray|seq|varargs|tuple|object|set|void|auto|cshort|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):?" diff --git a/runtime/syntax/objc.yaml b/runtime/syntax/objc.yaml index 22d82af5..8f99f574 100644 --- a/runtime/syntax/objc.yaml +++ b/runtime/syntax/objc.yaml @@ -1,6 +1,6 @@ -filetype: objective-c +filetype: Objective-C -detect: +detect: filename: "\\.(m|mm|h)$" rules: @@ -9,49 +9,26 @@ rules: - type: "\\b[A-Z][A-Z][[:alnum:]]*\\b" - type: "\\b[A-Za-z0-9_]*_t\\b" - type: "\\bdispatch_[a-zA-Z0-9_]*_t\\b" - - - statement: "(__attribute__[[:space:]]*\\(\\([^)]*\\)\\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__|__unused|_Nonnull|_Nullable|__block|__builtin.*)" + - statement: "__attribute__[[:space:]]*\\(\\([^)]*\\)\\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__|__unused|_Nonnull|_Nullable|__block|__builtin.*" - statement: "\\b(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\\b" - statement: "\\b(for|if|while|do|else|case|default|switch)\\b" - statement: "\\b(try|throw|catch|operator|new|delete)\\b" - - statement: "\\b(goto|continue|break|return)\\b" + - special: "\\b(goto|continue|break|return)\\b" - statement: "\\b(nonatomic|atomic|readonly|readwrite|strong|weak|assign)\\b" - statement: "@(encode|end|interface|implementation|class|selector|protocol|synchronized|try|catch|finally|property|optional|required|import|autoreleasepool)" - - preproc: "^[[:space:]]*#[[:space:]]*(define|include|import|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma).*$" - preproc: "__[A-Z0-9_]*__" - - - special: "^[[:space:]]*[#|@][[:space:]]*(import|include)[[:space:]]*[\"|<].*\\/?[>|\"][[:space:]]*$" - - - statement: "([.:;,+*|=!\\%\\[\\]]|<|>|/|-|&)" - - - constant.number: "(\\b(-?)?[0-9]+\\b|\\b\\[0-9]+\\.[0-9]+\\b|\\b0x[0-9A-F]+\\b)" - - constant: "(@\\[(\\\\.|[^\\]])*\\]|@\\{(\\\\.|[^\\}])*\\}|@\\((\\\\.|[^\\)])*\\))" - - constant: "\\b<(\\\\.[^\\>])*\\>\\b" - - constant: "\\b(nil|NULL|YES|NO|TRUE|true|FALSE|false|self)\\b" + - special: "^[[:space:]]*[#|@][[:space:]]*(import|include)[[:space:]]*[\\\"|<].*\\/?[>|\\\"][[:space:]]*$" + - symbol.operator: "[.:;,+*|=!\\%\\[\\]]|<|>|/|-|&" + - constant.number: "\\b(-?)?[0-9]+\\b|\\b\\[0-9]+\\.[0-9]+\\b|\\b0x[0-9A-F]+\\b" + - constant: "@\\[(\\\\.|[^\\]])*\\]|@\\{(\\\\.|[^\\}])*\\}|@\\((\\\\.|[^\\)])*\\)" + - constant.bool: "\\b(nil|NULL|YES|NO|TRUE|true|FALSE|false)\\b" + - special: "\\b(self)\\b" - constant: "\\bk[[:alnum]]*\\b" - - constant.string: "'.'" - - - constant.string: - start: "@\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - comment: - start: "//" - end: "$" - rules: - - todo: "(TODO|XXX|FIXME):?" - + - constant.string: "\\\"(\\\\.|[^\\\"])*\\\"|@\\\"(\\\\.|[^\\\"])*\\\"|'.'" + - comment: "//.*" - comment: start: "/\\*" end: "\\*/" - rules: - - todo: "(TODO|XXX|FIXME):?" + rules: [] + diff --git a/runtime/syntax/ocaml.yaml b/runtime/syntax/ocaml.yaml index 9fc0418d..b829293a 100644 --- a/runtime/syntax/ocaml.yaml +++ b/runtime/syntax/ocaml.yaml @@ -1,26 +1,17 @@ filetype: ocaml -detect: +detect: filename: "\\.mli?$" rules: - # Numbers - ## Integers - ### Binary - constant.number: "-?0[bB][01][01_]*" - ### Octal - constant.number: "-?0[oO][0-7][0-7_]*" - ### Decimal - constant.number: "-?\\d[\\d_]*" - ### Hexadecimal - constant.number: "-?0[xX][0-9a-fA-F][0-9a-fA-F_]*" - ## Real - ### Decimal - constant.number: "-?\\d[\\d_]*.\\d[\\d_]*([eE][+-]\\d[\\d_]*.\\d[\\d_]*)?" - ### Hexadecimal - - constant.number: "-?0[xX][0-9a-fA-F][0-9a-fA-F_]*.[0-9a-fA-F][0-9a-fA-F_]*([pP][+-][0-9a-fA-F][0-9a-fA-F_]*.[0-9a-fA-F][0-9a-fA-F_]*)?" - # Comments + - constant.number: "-?0[xX][0-9a-fA-F][0-9a-fA-F_]*.[0-9a-fA-F][0-9a-fA-F_]*([pP][+\\-][0-9a-fA-F][0-9a-fA-F_]*.[0-9a-fA-F][0-9a-fA-F_]*)?" - comment: start: "\\(\\*" end: "\\*\\)" - rules: [] \ No newline at end of file + rules: [] + diff --git a/runtime/syntax/pascal.yaml b/runtime/syntax/pascal.yaml index 70a3715e..ff762ba1 100644 --- a/runtime/syntax/pascal.yaml +++ b/runtime/syntax/pascal.yaml @@ -1,6 +1,6 @@ filetype: pascal -detect: +detect: filename: "\\.pas$" rules: @@ -13,31 +13,23 @@ rules: start: "asm" end: "end" rules: [] - - constant.number: "\\$[0-9A-Fa-f]+" - - constant.number: "\\b[+-]?[0-9]+([.]?[0-9]+)?(?i:e[+-]?[0-9]+)?" - - constant.string: - start: "#[0-9]{1,}" - end: "$" - rules: - - constant.specialChar: "\\\\." - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." + + - constant.number: "\\$[0-9A-Fa-f]+|\\b[+\\-]?[0-9]+([.]?[0-9]+)?(?i:e[+\\-]?[0-9]+)?" + - constant.string: "#[0-9]{1,}" + - constant.string: "'(?:[^']+|'')*'" - preproc: start: "{\\$" end: "}" rules: [] - - comment: - start: "//" - end: "$" - rules: [] + + - comment: "//.*" - comment: start: "\\(\\*" end: "\\*\\)" rules: [] + - comment: start: "({)(?:[^$])" end: "}" rules: [] + diff --git a/runtime/syntax/patch.yaml b/runtime/syntax/patch.yaml new file mode 100644 index 00000000..452dd31c --- /dev/null +++ b/runtime/syntax/patch.yaml @@ -0,0 +1,13 @@ +filetype: patch + +detect: + filename: "\\.(patch|diff)$" + +rules: + - brightgreen: "^\\+.*" + - green: "^\\+\\+\\+.*" + - brightblue: "^ .*" + - brightred: "^-.*" + - red: "^---.*" + - brightyellow: "^@@.*" + - magenta: "^diff.*" diff --git a/runtime/syntax/peg.yaml b/runtime/syntax/peg.yaml new file mode 100644 index 00000000..a023b860 --- /dev/null +++ b/runtime/syntax/peg.yaml @@ -0,0 +1,16 @@ +filetype: peg + +detect: + filename: "\\.l?peg$" + +rules: + - identifier: "^[[:space:]]*[A-Za-z][A-Za-z0-9_]*[[:space:]]*<-" + - constant.number: "\\^[+-]?[0-9]+" + - symbol.operator: "[-+*?^/!&]|->|<-|=>" + - identifier.var: "%[A-Za-z][A-Za-z0-9_]*" + - special: "\\[[^]]*\\]" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - comment: "(^|[[:space:]])\\-\\-.*$" + - todo: "TODO:?" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/perl.yaml b/runtime/syntax/perl.yaml new file mode 100644 index 00000000..15193e0a --- /dev/null +++ b/runtime/syntax/perl.yaml @@ -0,0 +1,27 @@ +filetype: perl + +detect: + filename: "\\.p[lm]$" + header: "^#!.*/(env +)?perl( |$)" + +rules: + - type: "\\b(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\\b|\\b(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\\b|\\b(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\\b|\\b(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\\b|\\b(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\\b" + - statement: "\\b(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne|lt|gt|le|ge|cmp|x|my|sub|use|package|can|isa)\\b" + - identifier: + start: "[$@%]" + end: "((?i) |[^0-9A-Z_]|-)" + rules: [] + + - constant.string: "\".*\"|qq\\|.*\\|" + - default: "[sm]/.*/" + - preproc: + start: "(^use| = new)" + end: ";" + rules: [] + + - comment: "#.*" + - identifier.macro: + start: "<< 'STOP'" + end: "STOP" + rules: [] + diff --git a/runtime/syntax/perl6.yaml b/runtime/syntax/perl6.yaml new file mode 100644 index 00000000..4b4d7dfc --- /dev/null +++ b/runtime/syntax/perl6.yaml @@ -0,0 +1,27 @@ +filetype: perl6 + +detect: + filename: "\\.p6$" + +rules: + - type: "\\b(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork)|get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join|keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek|seekdir|se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr|y|truncate|umask|un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\\b" + - statement: "\\b(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne|lt|gt|le|ge|cmp|x|my|sub|use|package|can|isa)\\b" + - special: "\\b(has|is|class|role|given|when|BUILD|multi|returns|method|submethod|slurp|say|sub)\\b" + - identifier: + start: "[$@%]" + end: "( |\\\\W|-)" + rules: [] + + - constant.string: "\".*\"|qq\\|.*\\|" + - default: "[sm]/.*/" + - preproc: + start: "(^use| = new)" + end: ";" + rules: [] + + - comment: "#.*" + - identifier.macro: + start: "<" + - 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|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)=" + - constant.string: "\"[^\"]*\"" + - constant.number: "(?i)#[0-9A-F]{6,6}" + - constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" + - comment: "" + - default: "<\\?(php|=)\" end=\"\\?>" + - identifier.class: "([a-zA-Z0-9_-]+)\\(" + - preproc: "(require|include|require_once|include_once)" + - type: "\\b(var|class|extends|function|echo|case|default|exit|switch|extends|as|define|do|declare|in|trait|interface|[E|e]xception|array|int|string|bool|iterable|void)\\b" + - identifier.class: "[a-zA-Z\\\\]+::" + - identifier: "([A-Z][a-zA-Z0-9_]+)\\s" + - identifier: "([A-Z0-9_]+)[;|\\s|\\)|,]" + - type.keyword: "(global|public|private|protected|static|const)" + - statement: "(implements|abstract|instanceof|if|else(if)?|endif|namespace|use|as|new|throw|catch|try|while|print|(end)?(foreach)?)\\b" + - identifier: "new\\s([a-zA-Z0-9\\\\]+)" + - special: "(break|continue|goto|return)" + - constant.bool: "(true|false|null|TRUE|FALSE|NULL)" + - constant: "[\\s|=|\\s|\\(|/|+|-|\\*|\\[]" + - constant.number: "[0-9]" + - identifier: "(\\$this|parent|self|\\$this->)" + - symbol.operator: "(=>|===|!==|==|!=|&&|\\|\\||::|=|->|\\!)" + - identifier.var: "(\\$[a-zA-Z0-9\\-_]+)" + - symbol.operator: "[\\(|\\)|/|+|\\-|\\*|\\[|.|,|;]" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]" + - symbol.brackets: "(\\[|\\]|\\{|\\}|[()])" + - comment: "(^|[[:space:]])//.*" + - comment: "(^|[[:space:]])#.*" + - comment: + start: "/\\*" + end: "\\*/" + rules: [] + + - preproc: "<\\?(php|=)?" + - preproc: "\\?>" + - preproc: "" diff --git a/runtime/syntax/pkg-config.yaml b/runtime/syntax/pkg-config.yaml new file mode 100644 index 00000000..3a7651ed --- /dev/null +++ b/runtime/syntax/pkg-config.yaml @@ -0,0 +1,12 @@ +filetype: pc + +detect: + filename: "\\.pc$" + +rules: + - preproc: "^(Name|Description|URL|Version|Conflicts|Cflags):" + - preproc: "^(Requires|Libs)(\\.private)?:" + - symbol.operator: "=" + - identifier.var: "\\$\\{[A-Za-z_][A-Za-z0-9_]*\\}" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/po.yaml b/runtime/syntax/po.yaml new file mode 100644 index 00000000..26fbc05c --- /dev/null +++ b/runtime/syntax/po.yaml @@ -0,0 +1,12 @@ +filetype: po + +detect: + filename: "\\.pot?$" + +rules: + - preproc: "\\b(msgid|msgstr)\\b" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - special: "\\\\.?" + - comment: "(^|[[:space:]])#([^{].*)?$" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/pony.yaml b/runtime/syntax/pony.yaml new file mode 100644 index 00000000..68729c66 --- /dev/null +++ b/runtime/syntax/pony.yaml @@ -0,0 +1,37 @@ +filetype: pony + +detect: + filename: "\\.pony$" + +rules: + - statement: "\\b(type|interface|trait|primitive|class|struct|actor)\\b" + - statement: "\\b(compiler_intrinsic)\\b" + - statement: "\\b(use)\\b" + - statement: "\\b(var|let|embed)\\b" + - statement: "\\b(new|be|fun)\\b" + - statement: "\\b(iso|trn|ref|val|box|tag|consume)\\b" + - statement: "\\b(break|continue|return|error)\\b" + - statement: "\\b(if|then|elseif|else|end|match|where|try|with|as|recover|object|lambda|as|digestof|ifdef)\\b" + - statement: "\\b(while|do|repeat|until|for|in)\\b" + - statement: "(\\?|=>)" + - statement: "(\\||\\&|\\,|\\^)" + - symbol.operator: "(\\-|\\+|\\*|/|\\!|%|<<|>>)" + - symbol.operator: "(==|!=|<=|>=|<|>)" + - statement: "\\b(is|isnt|not|and|or|xor)\\b" + - type: "\\b(_*[A-Z][_a-zA-Z0-9\\']*)\\b" + - constant: "\\b(this)\\b" + - constant.bool: "\\b(true|false)\\b" + - constant.number: "\\b((0b[0-1_]*)|(0o[0-7_]*)|(0x[0-9a-fA-F_]*)|([0-9_]+(\\.[0-9_]+)?((e|E)(\\\\+|-)?[0-9_]+)?))\\b" + - constant.string: "\"(\\\\.|[^\"])*\"" + - comment: + start: "\"\"\"[^\"]*" + end: "\"\"\"" + rules: [] + + - comment: "(^|[[:space:]])//.*" + - comment: + start: "/\\*" + end: "\\*/" + rules: [] + + - todo: "TODO:?" diff --git a/runtime/syntax/pov.yaml b/runtime/syntax/pov.yaml new file mode 100644 index 00000000..01f42706 --- /dev/null +++ b/runtime/syntax/pov.yaml @@ -0,0 +1,21 @@ +filetype: pov + +detect: + filename: "\\.(pov|POV|povray|POVRAY)$" + +rules: + - preproc: "^[[:space:]]*#[[:space:]]*(declare)" + - statement: "\\b(sphere|cylinder|translate|matrix|rotate|scale)\\b" + - statement: "\\b(orthographic|location|up|right|direction|clipped_by)\\b" + - statement: "\\b(fog_type|fog_offset|fog_alt|rgb|distance|transform)\\b" + - identifier: "^\\b(texture)\\b" + - identifier: "\\b(light_source|background)\\b" + - identifier: "\\b(fog|object|camera)\\b" + - symbol.operator: "(\\{|\\}|\\(|\\)|\\;|\\]|\\[|`|\\\\|\\$|<|>|!|=|&|\\|)" + - special: "\\b(union|group|subgroup)\\b" + - comment: "//.*" + - comment: + start: "/\\*" + end: "\\*/" + rules: [] + diff --git a/runtime/syntax/privoxy-action.yaml b/runtime/syntax/privoxy-action.yaml new file mode 100644 index 00000000..33e15ad2 --- /dev/null +++ b/runtime/syntax/privoxy-action.yaml @@ -0,0 +1,14 @@ +filetype: privoxy-action + +detect: + filename: "\\.action$" + +rules: + - constant.bool.false: "[{[:space:]]\\-block([[:space:]{}]|$)" + - constant.bool.true: "[{[:space:]]\\+block([[:space:]{}]|$)" + - constant.bool.false: "-(add-header|change-x-forwarded-for|client-header-filter|client-header-tagger|content-type-overwrite|crunch-client-header|crunch-if-none-match|crunch-incoming-cookies|crunch-outgoing-cookies|crunch-server-header|deanimate-gifs|downgrade-http-version|fast-redirects|filter|force-text-mode|forward-override|handle-as-empty-document|handle-as-image|hide-accept-language|hide-content-disposition|hide-from-header|hide-if-modified-since|hide-referrer|hide-user-agent|limit-connect|overwrite-last-modified|prevent-compression|redirect|server-header-filter|server-header-tagger|session-cookies-only|set-image-blocker)" + - constant.bool.true: "\\+(add-header|change-x-forwarded-for|client-header-filter|client-header-tagger|content-type-overwrite|crunch-client-header|crunch-if-none-match|crunch-incoming-cookies|crunch-outgoing-cookies|crunch-server-header|deanimate-gifs|downgrade-http-version|fast-redirects|filter|force-text-mode|forward-override|handle-as-empty-document|handle-as-image|hide-accept-language|hide-content-disposition|hide-from-header|hide-if-modified-since|hide-referrer|hide-user-agent|limit-connect|overwrite-last-modified|prevent-compression|redirect|server-header-filter|server-header-tagger|session-cookies-only|set-image-blocker)" + - constant.specialChar: "\\\\.?" + - comment: "(^|[[:space:]])#([^{].*)?$" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/privoxy-config.yaml b/runtime/syntax/privoxy-config.yaml new file mode 100644 index 00000000..bdce3f6e --- /dev/null +++ b/runtime/syntax/privoxy-config.yaml @@ -0,0 +1,10 @@ +filetype: privoxy-config + +detect: + filename: "privoxy/config$" + +rules: + - statement: "(accept-intercepted-requests|actionsfile|admin-address|allow-cgi-request-crunching|buffer-limit|compression-level|confdir|connection-sharing|debug|default-server-timeout|deny-access|enable-compression|enable-edit-actions|enable-remote-http-toggle|enable-remote-toggle|enforce-blocks|filterfile|forward|forwarded-connect-retries|forward-socks4|forward-socks4a|forward-socks5|handle-as-empty-doc-returns-ok|hostname|keep-alive-timeout|listen-address|logdir|logfile|max-client-connections|permit-access|proxy-info-url|single-threaded|socket-timeout|split-large-forms|templdir|toggle|tolerate-pipelining|trustfile|trust-info-url|user-manual)[[:space:]]" + - comment: "(^|[[:space:]])#([^{].*)?$" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/privoxy-filter.yaml b/runtime/syntax/privoxy-filter.yaml new file mode 100644 index 00000000..7be93511 --- /dev/null +++ b/runtime/syntax/privoxy-filter.yaml @@ -0,0 +1,12 @@ +filetype: privoxy-filter + +detect: + filename: "\\.filter$" + +rules: + - statement: "^(FILTER|CLIENT-HEADER-FILTER|CLIENT-HEADER-TAGGER|SERVER-HEADER-FILTER|SERVER-HEADER-TAGGER): [a-z-]+" + - identifier: "^(FILTER|CLIENT-HEADER-FILTER|CLIENT-HEADER-TAGGER|SERVER-HEADER-FILTER|SERVER-HEADER-TAGGER):" + - constant.specialChar: "\\\\.?" + - comment: "(^|[[:space:]])#([^{].*)?$" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/puppet.yaml b/runtime/syntax/puppet.yaml new file mode 100644 index 00000000..7fd1b54d --- /dev/null +++ b/runtime/syntax/puppet.yaml @@ -0,0 +1,22 @@ +filetype: puppet + +detect: + filename: "\\.pp$" + +rules: + - default: "^[[:space:]]([a-z][a-z0-9_]+)" + - identifier.var: "\\$[a-z:][a-z0-9_:]+" + - type: "\\b(augeas|computer|cron|exec|file|filebucket|group|host|interface|k5login|macauthorization|mailalias|maillist|mcx|mount|nagios_command|nagios_contact|nagios_contactgroup|nagios_host|nagios_hostdependency|nagios_hostescalation|nagios_hostextinfo|nagios_hostgroup|nagios_service|nagios_servicedependency|nagios_serviceescalation|nagios_serviceextinfo|nagios_servicegroup|nagios_timeperiod|notify|package|resources|router|schedule|scheduled_task|selboolean|selmodule|service|ssh_authorized_key|sshkey|stage|tidy|user|vlan|yumrepo|zfs|zone|zpool|anchor)\\b" + - statement: "\\b(class|define|if|else|undef|inherits)\\b" + - symbol: "(=|-|~|>)" + - identifier.var: "(\\$|@|@@)?\\b[A-Z]+[0-9A-Z_a-z]*" + - symbol: "([ ]|^):[0-9A-Z_]+\\b" + - constant: "/([^/]|(\\\\/))*/[iomx]*|%r\\{([^}]|(\\\\}))*\\}[iomx]*" + - constant.string: "`[^`]*`|%x\\{[^}]*\\}" + - constant.string: "\"([^\"]|(\\\\\"))*\"|%[QW]?\\{[^}]*\\}|%[QW]?\\([^)]*\\)|%[QW]?<[^>]*>|%[QW]?\\[[^]]*\\]|%[QW]?\\$[^$]*\\$|%[QW]?\\^[^^]*\\^|%[QW]?![^!]*!" + - special: "\\$\\{[^}]*\\}" + - constant.string: "'([^']|(\\\\'))*'|%[qw]\\{[^}]*\\}|%[qw]\\([^)]*\\)|%[qw]<[^>]*>|%[qw]\\[[^]]*\\]|%[qw]\\$[^$]*\\$|%[qw]\\^[^^]*\\^|%[qw]![^!]*!" + - comment: "#[^{].*$|#$" + - comment.bright: "##[^{].*$|##$" + - todo: "(XXX|TODO|FIXME|\\?\\?\\?)" + - indent-char.whitespace: "[[:space:]]+$" diff --git a/runtime/syntax/python2.yaml b/runtime/syntax/python2.yaml index bddf66dc..c28a17a3 100644 --- a/runtime/syntax/python2.yaml +++ b/runtime/syntax/python2.yaml @@ -1,57 +1,33 @@ filetype: python -detect: +detect: filename: "\\.py$" header: "^#!.*/(env +)?python( |$)" rules: - - # built-in objects - constant: "\\b(None|self|True|False)\\b" - # built-in attributes - constant: "\\b(__bases__|__builtin__|__class__|__debug__|__dict__|__doc__|__file__|__members__|__methods__|__name__|__self__)\\b" - # built-in functions - identifier: "\\b(abs|apply|callable|chr|cmp|compile|delattr|dir|divmod|eval|exec|execfile|filter|format|getattr|globals|hasattr|hash|help|hex|id|input|intern|isinstance|issubclass|len|locals|max|min|next|oct|open|ord|pow|range|raw_input|reduce|reload|repr|round|setattr|unichr|vars|zip|__import__)\\b" - # special method names - identifier: "\\b(__abs__|__add__|__and__|__call__|__cmp__|__coerce__|__complex__|__concat__|__contains__|__del__|__delattr__|__delitem__|__dict__|__delslice__|__div__|__divmod__|__float__|__getattr__|__getitem__|__getslice__|__hash__|__hex__|__init__|__int__|__inv__|__invert__|__len__|__long__|__lshift__|__mod__|__mul__|__neg__|__nonzero__|__oct__|__or__|__pos__|__pow__|__radd__|__rand__|__rcmp__|__rdiv__|__rdivmod__|__repeat__|__repr__|__rlshift__|__rmod__|__rmul__|__ror__|__rpow__|__rrshift__|__rshift__|__rsub__|__rxor__|__setattr__|__setitem__|__setslice__|__str__|__sub__|__xor__)\\b" - # types - type: "\\b(basestring|bool|buffer|bytearray|bytes|classmethod|complex|dict|enumerate|file|float|frozenset|int|list|long|map|memoryview|object|property|reversed|set|slice|staticmethod|str|super|tuple|type|unicode|xrange)\\b" - # definitions - identifier: "def [a-zA-Z_0-9]+" - # keywords - - statement: "\\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield)\\b" - # decorators - - brightgreen: "@.*[(]" - # operators - - statement: "([.:;,+*|=!\\%@]|<|>|/|-|&)" - # parentheses - - statement: "([(){}]|\\[|\\])" - # numbers + - preproc: "\\b(import)\\b" + - statement: "\\b(and|as|assert|class|def|del|elif|else|except|finally|for|from|global|if|in|is|lambda|not|or|pass|print|raise|try|while|with|yield)\\b" + - special: "\\b(break|continue|return)\\b" + - special: "@.*[(]" + - symbol.operator: "[.:;,+*|=!\\%@]|<|>|/|-|&" + - symbol.brackets: "[(){}]|\\[|\\]" - constant.number: "\\b[0-9]+\\b" - - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." - + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - comment: "#.*$" - comment: - start: "#" - end: "$" - rules: [] - - - comment: - start: "\"\"\"" + start: "\"\"\"([^\"]|$)" end: "\"\"\"" rules: [] - comment: - start: "'''" + start: "'''([^']|$)" end: "'''" rules: [] + + - preproc.shebang: "^#!.+?( |$)" diff --git a/runtime/syntax/python3.yaml b/runtime/syntax/python3.yaml index 864089ab..92288463 100644 --- a/runtime/syntax/python3.yaml +++ b/runtime/syntax/python3.yaml @@ -1,56 +1,33 @@ -filename: python3 +filetype: python3 -detect: +detect: filename: "\\.py3$" header: "^#!.*/(env +)?python3$" rules: - # built-in objects - constant: "\\b(None|self|True|False)\\b" - # built-in attributes - constant: "\\b(__bases__|__builtin__|__class__|__debug__|__dict__|__doc__|__file__|__members__|__methods__|__name__|__self__)\\b" - # built-in functions - identifier: "\\b(abs|all|any|ascii|bin|callable|chr|compile|delattr|dir|divmod|eval|exec|format|getattr|globals|hasattr|hash|help|hex|id|input|isinstance|issubclass|iter|len|locals|max|min|next|oct|open|ord|pow|print|repr|round|setattr|sorted|sum|vars|__import__)\\b" - # special method names - identifier: "\\b(__abs__|__add__|__and__|__call__|__cmp__|__coerce__|__complex__|__concat__|__contains__|__del__|__delattr__|__delitem__|__delslice__|__div__|__divmod__|__float__|__getattr__|__getitem__|__getslice__|__hash__|__hex__|__init__|__int__|__inv__|__invert__|__len__|__dict__|__long__|__lshift__|__mod__|__mul__|__neg__|__next__|__nonzero__|__oct__|__or__|__pos__|__pow__|__radd__|__rand__|__rcmp__|__rdiv__|__rdivmod__|__repeat__|__repr__|__rlshift__|__rmod__|__rmul__|__ror__|__rpow__|__rrshift__|__rshift__|__rsub__|__rxor__|__setattr__|__setitem__|__setslice__|__str__|__sub__|__xor__)\\b" - # types - type: "\\b(bool|bytearray|bytes|classmethod|complex|dict|enumerate|filter|float|frozenset|int|list|map|memoryview|object|property|range|reversed|set|slice|staticmethod|str|super|tuple|type|zip)\\b" - # definitions - - identifier: "def [a-zA-Z_0-9]+" - # keywords - - statement: "\\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\\b" - # decorators - - brightgreen: "@.*[(]" - # operators - - statement: "([.:;,+*|=!\\%@]|<|>|/|-|&)" - # parentheses - - statement: "([(){}]|\\[|\\])" - # numbers + - identifier: "def [a-zA-Z_0-9]+" + - preproc: "\\b(import)\\b" + - statement: "\\b(and|as|assert|class|def|del|elif|else|except|finally|for|from|global|if|in|is|lambda|nonlocal|not|or|pass|raise|try|while|with|yield)\\b" + - special: "\\b(break|continue|return)\\b" + - special: "@.*[(]" + - symbol.operator: "[.:;,+*|=!\\%@]|<|>|/|-|&" + - symbol.brackets: "[(){}]|\\[|\\]" - constant.number: "\\b[0-9]+\\b" - - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." - + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - comment: "#.*$" - comment: - start: "#" - end: "$" - rules: [] - - - comment: - start: "\"\"\"" + start: "\"\"\"([^\"]|$)" end: "\"\"\"" rules: [] - comment: - start: "'''" + start: "'''([^']|$)" end: "'''" rules: [] + + - preproc.shebang: "^#!.+?( |$)" diff --git a/runtime/syntax/r.yaml b/runtime/syntax/r.yaml index f883002d..d7c4ee52 100644 --- a/runtime/syntax/r.yaml +++ b/runtime/syntax/r.yaml @@ -1,12 +1,9 @@ filetype: r -detect: +detect: filename: "\\.(r|R)$" rules: - statement: "\\b(break|else|for|function|if|in|next|repeat|return|while)\\b" - constant: "\\b(TRUE|FALSE|NULL|Inf|NaN|NA|NA_integer_|NA_real_|NA_complex_|NA_character_)\\b" - - comment: - start: "#" - end: "$" - rules: [] + - comment: "#.*$" diff --git a/runtime/syntax/reST.yaml b/runtime/syntax/reST.yaml index 6a25b809..db5d4b27 100644 --- a/runtime/syntax/reST.yaml +++ b/runtime/syntax/reST.yaml @@ -1,18 +1,24 @@ filetype: rst -detect: +detect: filename: "\\.rest$|\\.rst$" rules: - - statement: "\\*\\*[^*]+\\*\\*" - - preproc: "::" - - constant.string: "`[^`]+`_{1,2}" - - constant.string: "``[^`]+``" - - identifier: "^\\.\\. .*$" - - identifier: "^__ .*$" - - type: "^###+$" - - type: "^\\*\\*\\*+$" - - special: "^===+$" - - special: "^---+$" - - special: "^\\^\\^\\^+$" - - special: "^\"\"\"+$" + - identifier: "^[\\*+\\-] " + - identifier: "^[0-9]+?\\. " + - type: "\\*[^*]+?\\*" + - type.keyword: "\\*\\*[^\\*]+\\*\\*" + - symbol: "::" + - underlined.url: "`[^`]+`_{1,2}" + - special: "``[^`]+``" + - comment: "^\\.\\. .*$" + - underlined: "^__ .*$" + - statement: "^###+$" + - statement: "^\\*\\*\\*+$" + - preproc: "^===+$" + - identifier: "^---+$" + - type.keyword: "^\\^\\^\\^+$" + - constant: "^\"\"\"+$" + - underlined.url: "http(s)?://[^ )>]+" + - preproc: "\\+[\\-=+]+\\+" + - preproc: "\\|" diff --git a/runtime/syntax/rpmspec.yaml b/runtime/syntax/rpmspec.yaml new file mode 100644 index 00000000..7c238fa4 --- /dev/null +++ b/runtime/syntax/rpmspec.yaml @@ -0,0 +1,43 @@ +filetype: rpmspec + +detect: + filename: "\\.spec$|\\.rpmspec$" + +rules: + - preproc: "\\b(Icon|ExclusiveOs|ExcludeOs):" + - preproc: "\\b(BuildArch|BuildArchitectures|ExclusiveArch|ExcludeArch):" + - preproc: "\\b(Conflicts|Obsoletes|Provides|Requires|Requires\\(.*\\)|Enhances|Suggests|BuildConflicts|BuildRequires|Recommends|PreReq|Supplements):" + - preproc: "\\b(Epoch|Serial|Nosource|Nopatch):" + - preproc: "\\b(AutoReq|AutoProv|AutoReqProv):" + - preproc: "\\b(Copyright|License|Summary|Summary\\(.*\\)|Distribution|Vendor|Packager|Group|Source[0-9]*|Patch[0-9]*|BuildRoot|Prefix):" + - preproc: "\\b(Name|Version|Release|Url|URL):" + - preproc: + start: "^(Source|Patch)" + end: ":" + rules: [] + + - preproc: "(i386|i486|i586|i686|athlon|ia64|alpha|alphaev5|alphaev56|alphapca56|alphaev6|alphaev67|sparc|sparcv9|sparc64armv3l|armv4b|armv4lm|ips|mipsel|ppc|ppc|iseries|ppcpseries|ppc64|m68k|m68kmint|Sgi|rs6000|i370|s390x|s390|noarch)" + - preproc: "(ifarch|ifnarch|ifos|ifnos)" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - statement: "%(if|else|endif|define|global|undefine)" + - statement: "%_?([A-Z_a-z_0-9_]*)" + - statement: + start: "%\\{" + end: "\\}" + rules: [] + + - statement: + start: "%\\{__" + end: "\\}" + rules: [] + + - statement: "\\$(RPM_BUILD_ROOT)\\>" + - special: "^%(build$|changelog|check$|clean$|description)" + - special: "^%(files|install$|package|prep$)" + - special: "^%(pre|preun|pretrans|post|postun|posttrans)" + - special: "^%(trigger|triggerin|triggerpostun|triggerun|verifyscript)" + - comment: "(^|[[:space:]])#([^{].*)?$" + - constant: "^\\*.*$" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" + - todo: "TODO:?" diff --git a/runtime/syntax/ruby.yaml b/runtime/syntax/ruby.yaml new file mode 100644 index 00000000..b0b1816e --- /dev/null +++ b/runtime/syntax/ruby.yaml @@ -0,0 +1,26 @@ +filetype: ruby + +detect: + filename: "\\.rb$|\\.gemspec$|Gemfile|config.ru|Rakefile|Capfile|Vagrantfile" + header: "^#!.*/(env +)?ruby( |$)" + +rules: + - 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" + - constant: "(\\$|@|@@)?\\b[A-Z]+[0-9A-Z_a-z]*" + - constant.number: "\\b[0-9]+\\b" + - constant: "(i?)([ ]|^):[0-9A-Z_]+\\b" + - constant: "\\b(__FILE__|__LINE__)\\b" + - constant: "/([^/]|(\\\\/))*/[iomx]*|%r\\{([^}]|(\\\\}))*\\}[iomx]*" + - constant.string: "`[^`]*`|%x\\{[^}]*\\}" + - constant.string: "\"([^\"]|(\\\\\"))*\"|%[QW]?\\{[^}]*\\}|%[QW]?\\([^)]*\\)|%[QW]?<[^>]*>|%[QW]?\\[[^]]*\\]|%[QW]?\\$[^$]*\\$|%[QW]?\\^[^^]*\\^|%[QW]?![^!]*!" + - special: "#\\{[^}]*\\}" + - constant.string: "'([^']|(\\\\'))*'|%[qw]\\{[^}]*\\}|%[qw]\\([^)]*\\)|%[qw]<[^>]*>|%[qw]\\[[^]]*\\]|%[qw]\\$[^$]*\\$|%[qw]\\^[^^]*\\^|%[qw]![^!]*!" + - comment: "#[^{].*$|#$" + - comment.bright: "##[^{].*$|##$" + - constant.macro: + start: "<<-?'?EOT'?" + end: "^EOT" + rules: [] + + - todo: "(XXX|TODO|FIXME|\\?\\?\\?)" + - preproc.shebang: "^#!.+?( |$)" diff --git a/runtime/syntax/rust.yaml b/runtime/syntax/rust.yaml index dc6d1019..53e97d12 100644 --- a/runtime/syntax/rust.yaml +++ b/runtime/syntax/rust.yaml @@ -1,46 +1,35 @@ filetype: rust -detect: - filename: "\\.rs$" +detect: + filename: "\\.rs" rules: - # function definition - - identifier: "fn [a-z0-9_]+" - # Reserved words + - identifier.class: "fn [a-z0-9_]+" - statement: "\\b(abstract|alignof|as|become|box|break|const|continue|crate|do|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|offsetof|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|true|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\\b" - # macros - - special: "[a-z_]+!" - # Constants + - identifier.macro: "[a-z_]+!" - constant: "[A-Z][A-Z_]+" - # Numbers - constant.number: "\\b[0-9]+\\b" - # Traits/Enums/Structs/Types/etc. - type: "[A-Z][a-z]+" - + - constant.string: "\\\".*\\\"" - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "r#+\"" - end: "\"#+" + start: "\\\".*\\\\$" + end: ".*\\\"" rules: [] - - comment: - start: "//" - end: "$" - rules: - - todo: "(TODO|XXX|FIXME):?" + - special: + start: "r#+\\\"" + end: "\\\"#+" + rules: [] + - comment: "//.*" - comment: start: "/\\*" end: "\\*/" - rules: - - todo: "(TODO|XXX|FIXME):?" + rules: [] - special: start: "#!\\[" end: "\\]" rules: [] + + - todo: "(XXX|TODO|FIXME|\\?\\?\\?)" diff --git a/runtime/syntax/scala.yaml b/runtime/syntax/scala.yaml index 558d5b42..e1feaa5c 100644 --- a/runtime/syntax/scala.yaml +++ b/runtime/syntax/scala.yaml @@ -1,27 +1,23 @@ filetype: scala -detect: +detect: filename: "\\.scala$" rules: - type: "\\b(boolean|byte|char|double|float|int|long|new|short|this|transient|void)\\b" - statement: "\\b(match|val|var|break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\\b" - statement: "\\b(def|object|case|trait|lazy|implicit|abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile|sealed)\\b" - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - constant: "\\b(true|false|null)\\b" - - comment: - start: "//" - end: "$" - rules: [] + - constant.string: "\"[^\"]*\"" + - constant.bool: "\\b(true|false|null)\\b" + - comment: "//.*" - comment: start: "/\\*" end: "\\*/" rules: [] - - comment: + + - comment.bright: start: "/\\*\\*" end: "\\*/" rules: [] + + - indent-char.whitespace: "[[:space:]]+$" diff --git a/runtime/syntax/sed.yaml b/runtime/syntax/sed.yaml new file mode 100644 index 00000000..dc5f7adc --- /dev/null +++ b/runtime/syntax/sed.yaml @@ -0,0 +1,13 @@ +filetype: sed + +detect: + filename: "\\.sed$" + header: "^#!.*bin/(env +)?sed( |$)" + +rules: + - symbol.operator: "[|^$.*+]" + - constant.number: "\\{[0-9]+,?[0-9]*\\}" + - constant.specialChar: "\\\\." + - comment: "(^|[[:space:]])#([^{].*)?$" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/sh.yaml b/runtime/syntax/sh.yaml index aa0263bb..e2d793b3 100644 --- a/runtime/syntax/sh.yaml +++ b/runtime/syntax/sh.yaml @@ -1,41 +1,24 @@ filetype: shell -detect: - filename: "(\\.sh$|\\.bash|\\.bashrc|bashrc|\\.bash_aliases|bash_aliases|\\.bash_functions|bash_functions|\\.bash_profile|bash_profile|Pkgfile|pkgmk.conf|profile|rc.conf|PKGBUILD|.ebuild\\$|APKBUILD)" +detect: + filename: "\\.sh$|\\.bash|\\.bashrc|bashrc|\\.bash_aliases|bash_aliases|\\.bash_functions|bash_functions|\\.bash_profile|bash_profile|Pkgfile|pkgmk.conf|profile|rc.conf|PKGBUILD|.ebuild\\$|APKBUILD" header: "^#!.*/(env +)?(ba)?sh( |$)" rules: - # Numbers - constant.number: "\\b[0-9]+\\b" - # Conditionals and control flow - statement: "\\b(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\\b" - - special: "(\\{|\\}|\\(|\\)|\\;|\\]|\\[|`|\\\\|\\$|<|>|!|=|&|\\|)" - # Shell commands + - symbol.operator: "(\\{|\\}|\\(|\\)|\\;|\\]|\\[|`|\\\\|\\$|<|>|!|=|&|\\|)" - type: "\\b(cd|echo|export|let|set|umask|unset)\\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: "\\$\\{?[0-9A-Z_!@#$*?-]+\\}?" - - identifier: "\\$\\{?[0-9A-Z_!@#$*?-]+\\}?" - - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: [] - - - comment: - start: "#" - end: "$" - rules: - - todo: "(TODO|XXX|FIXME):?" + - constant.string: "\"(\\\\.|[^\"])*\"" + - constant.string: "'(\\\\.|[^'])*'" + - constant.specialChar: "\"" + - constant.specialChar: "'" + - identifier.var: "\\$\\{?[0-9A-Za-z_!@#$*?-]+\\}?" + - identifier.var: "\\$\\{?[0-9A-Za-z_!@#$*?-]+\\}?" + - comment: "(^|[[:space:]])#.*$" + - todo: "(TODO|XXX|FIXME):?" + - preproc.shebang: "^#!.+?( |$)" diff --git a/runtime/syntax/sls.yaml b/runtime/syntax/sls.yaml new file mode 100644 index 00000000..74d9ecee --- /dev/null +++ b/runtime/syntax/sls.yaml @@ -0,0 +1,15 @@ +filetype: salt + +detect: + filename: "\\.sls$" + +rules: + - identifier.var: "^[^ -].*:$" + - identifier.var: ".*:" + - default: "salt:" + - constant.number: "/*[0-9]/*" + - constant.bool: "\\b(True|False)\\b" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - special: "\\b(grain|grains|compound|pcre|grain_pcre|list|pillar)\\b" + - comment: "^#.*" + - statement: "\\b(if|elif|else|or|not|and|endif|end)\\b" diff --git a/runtime/syntax/solidity.yaml b/runtime/syntax/solidity.yaml index 0675fb72..04e6536c 100644 --- a/runtime/syntax/solidity.yaml +++ b/runtime/syntax/solidity.yaml @@ -1,6 +1,6 @@ filetype: solidity -detect: +detect: filename: "\\.sol$" rules: @@ -8,31 +8,16 @@ rules: - constant.number: "\\b[-]?([0-9]+|0x[0-9a-fA-F]+)\\b" - identifier: "[a-zA-Z][_a-zA-Z0-9]*[[:space:]]*" - statement: "\\b(assembly|break|continue|do|for|function|if|else|new|return|returns|while)\\b" - - special: "\\b(\\.send|throw)\\b" # make sure they are very visible - - keyword: "\\b(anonymous|constant|indexed|payable|public|private|external|internal)\\b" + - special: "\\b(\\.send|throw)\\b" + - type.keyword: "\\b(anonymous|constant|indexed|payable|public|private|external|internal)\\b" - constant: "\\b(block(\\.(blockhash|coinbase|difficulty|gaslimit|number|timestamp))?|msg(\\.(data|gas|sender|value))?|now|tx(\\.(gasprice|origin))?)\\b" - constant: "\\b(keccak256|sha3|sha256|ripemd160|ecrecover|addmod|mulmod|this|super|selfdestruct|\\.balance)\\b" - - constant: "\\b(true|false)\\b" + - constant.bool: "\\b(true|false)\\b" - constant: "\\b(wei|szabo|finney|ether|seconds|minutes|hours|days|weeks|years)\\b" - type: "\\b(address|bool|mapping|string|var|int(\\d*)|uint(\\d*)|byte(\\d*)|fixed(\\d*)|ufixed(\\d*))\\b" - error: "\\b(abstract|after|case|catch|default|final|in|inline|interface|let|match|null|of|pure|relocatable|static|switch|try|type|typeof|view)\\b" - - operator: "[-+/*=<>!~%?:&|]" - - comment: - start: "//" - end: "$" - rules: [] - - comment: - start: "/\\*" - end: "\\*/" - rules: [] + - symbol.operator: "[-+/*=<>!~%?:&|]" + - comment: "(^|[[:space:]])//.*" + - comment: "/\\*.+\\*/" - todo: "TODO:?" - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" diff --git a/runtime/syntax/sql.yaml b/runtime/syntax/sql.yaml new file mode 100644 index 00000000..b4a038ff --- /dev/null +++ b/runtime/syntax/sql.yaml @@ -0,0 +1,35 @@ +filetype: sql + +detect: + filename: "\\.sql$|sqliterc$" + +rules: + - statement: "(?i)\\b(ALL|ASC|AS|ALTER|AND|ADD|AUTO_INCREMENT)\\b" + - statement: "(?i)\\b(BETWEEN|BINARY|BOTH|BY|BOOLEAN)\\b" + - statement: "(?i)\\b(CHANGE|CHECK|COLUMNS|COLUMN|CROSS|CREATE)\\b" + - statement: "(?i)\\b(DATABASES|DATABASE|DATA|DELAYED|DESCRIBE|DESC|DISTINCT|DELETE|DROP|DEFAULT)\\b" + - statement: "(?i)\\b(ENCLOSED|ESCAPED|EXISTS|EXPLAIN)\\b" + - statement: "(?i)\\b(FIELDS|FIELD|FLUSH|FOR|FOREIGN|FUNCTION|FROM)\\b" + - statement: "(?i)\\b(GROUP|GRANT|HAVING)\\b" + - statement: "(?i)\\b(IGNORE|INDEX|INFILE|INSERT|INNER|INTO|IDENTIFIED|IN|IS|IF)\\b" + - statement: "(?i)\\b(JOIN|KEYS|KILL|KEY)\\b" + - statement: "(?i)\\b(LEADING|LIKE|LIMIT|LINES|LOAD|LOCAL|LOCK|LOW_PRIORITY|LEFT|LANGUAGE)\\b" + - statement: "(?i)\\b(MODIFY|NATURAL|NOT|NULL|NEXTVAL)\\b" + - statement: "(?i)\\b(OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUTFILE|OR|OUTER|ON)\\b" + - statement: "(?i)\\b(PROCEDURE|PROCEDURAL|PRIMARY)\\b" + - statement: "(?i)\\b(READ|REFERENCES|REGEXP|RENAME|REPLACE|RETURN|REVOKE|RLIKE|RIGHT)\\b" + - statement: "(?i)\\b(SHOW|SONAME|STATUS|STRAIGHT_JOIN|SELECT|SETVAL|SET)\\b" + - statement: "(?i)\\b(TABLES|TERMINATED|TO|TRAILING|TRUNCATE|TABLE|TEMPORARY|TRIGGER|TRUSTED)\\b" + - statement: "(?i)\\b(UNIQUE|UNLOCK|USE|USING|UPDATE|VALUES|VARIABLES|VIEW)\\b" + - statement: "(?i)\\b(WITH|WRITE|WHERE|ZEROFILL|TYPE|XOR)\\b" + - type: "(?i)\\b(VARCHAR|TINYINT|TEXT|DATE|SMALLINT|MEDIUMINT|INT|INTEGER|BIGINT|FLOAT|DOUBLE|DECIMAL|DATETIME|TIMESTAMP|TIME|YEAR|UNSIGNED|CHAR|TINYBLOB|TINYTEXT|BLOB|MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|ENUM|BOOL|BINARY|VARBINARY)\\b" + - preproc: "(?i)\\.\\b(databases|dump|echo|exit|explain|header(s)?|help)\\b" + - preproc: "(?i)\\.\\b(import|indices|mode|nullvalue|output|prompt|quit|read)\\b" + - preproc: "(?i)\\.\\b(schema|separator|show|tables|timeout|width)\\b" + - constant.bool: "\\b(ON|OFF)\\b" + - constant.number: "\\b([0-9]+)\\b" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - constant.string: "`(\\\\.|[^\\\\`])*`" + - comment: "\\-\\-.*$" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/swift.yaml b/runtime/syntax/swift.yaml index 2a13a07b..2e63c4fd 100644 --- a/runtime/syntax/swift.yaml +++ b/runtime/syntax/swift.yaml @@ -1,49 +1,25 @@ filetype: swift -detect: +detect: filename: "\\.swift$" rules: - # Operators - - statement: "([.:;,+*|=!?\\%]|<|>|/|-|&)" - - # Statements - - statement: "(class|import|let|var|struct|enum|func|if|else|switch|case|default|for|in|internal|external|unowned|private|public|throws)\\ " - - statement: "(prefix|postfix|operator|extension|lazy|get|set|self|willSet|didSet|override|super|convenience|weak|strong|mutating|return|guard)\\ " - - # Keywords - - statement: "(print)" - - statement: "(init)" - - # Numbers + - symbol.operator: "[.:;,+*|=!?\\%]|<|>|/|-|&" + - statement: "(class|import|let|var|struct|enum|func|if|else|switch|case|default|for|in|internal|external|unowned|private|public|throws)\\ " + - statement: "(prefix|postfix|operator|extension|lazy|get|set|self|willSet|didSet|override|super|convenience|weak|strong|mutating|return|guard)\\ " + - preproc: "(print)" + - preproc: "(init)" - constant.number: "([0-9]+)" - - # Standard Types - type: "\\ ((U)?Int(8|16|32|64))" - - constant: "(true|false|nil)" + - constant.bool: "(true|false|nil)" - type: "\\ (Double|String|Float|Boolean|Dictionary|Array|Int)" - type: "\\ (AnyObject)" - - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - comment: - start: "//" - end: "$" - rules: - - todo: "(TODO|XXX|FIXME):?" - - - comment: - start: "///" - end: "$" - rules: - - todo: "(TODO|XXX|FIXME):?" - + - constant.string: "\"[^\"]*\"" + - comment: "//.*" + - comment: "///.*" - comment: start: "/\\*\\*" end: "\\*/" - rules: - - todo: "(TODO|XXX|FIXME):?" + rules: [] + + - comment: "[/**]" diff --git a/runtime/syntax/systemd.yaml b/runtime/syntax/systemd.yaml new file mode 100644 index 00000000..35abc646 --- /dev/null +++ b/runtime/syntax/systemd.yaml @@ -0,0 +1,16 @@ +filetype: systemd + +detect: + filename: "\\.(service|socket)$" + header: "^\\[Unit\\]$" + +rules: + - statement: "^(Accept|After|Alias|AllowIsolate|Also|ANSI_COLOR|_AUDIT_LOGINUID|_AUDIT_SESSION|Backlog|Before|BindIPv6Only|BindsTo|BindToDevice|BlockIOReadBandwidth|BlockIOWeight|BlockIOWriteBandwidth|_BOOT_ID|Broadcast|BUG_REPORT_URL|BusName|Capabilities|CapabilityBoundingSet|CHASSIS|cipher|class|_CMDLINE|CODE_FILE|CODE_FUNC|CODE_LINE|_COMM|Compress|ConditionACPower|ConditionCapability|ConditionDirectoryNotEmpty|ConditionFileIsExecutable|ConditionFileNotEmpty|ConditionHost|ConditionKernelCommandLine|ConditionNull|ConditionPathExists|ConditionPathExistsGlob|ConditionPathIsDirectory|ConditionPathIsMountPoint|ConditionPathIsReadWrite|ConditionPathIsSymbolicLink|ConditionSecurity|ConditionVirtualization|Conflicts|ControlGroup|ControlGroupAttribute|ControlGroupModify|ControlGroupPersistent|controllers|Controllers|CPE_NAME|CPUAffinity|CPUSchedulingPolicy|CPUSchedulingPriority|CPUSchedulingResetOnFork|CPUShares|CrashChVT|CrashShell|__CURSOR|debug|DefaultControllers|DefaultDependencies|DefaultLimitAS|DefaultLimitCORE|DefaultLimitCPU|DefaultLimitDATA|DefaultLimitFSIZE|DefaultLimitLOCKS|DefaultLimitMEMLOCK|DefaultLimitMSGQUEUE|DefaultLimitNICE|DefaultLimitNOFILE|DefaultLimitNPROC|DefaultLimitRSS|DefaultLimitRTPRIO|DefaultLimitRTTIME|DefaultLimitSIGPENDING|DefaultLimitSTACK|DefaultStandardError|DefaultStandardOutput|Description|DeviceAllow|DeviceDeny|DirectoryMode|DirectoryNotEmpty|Documentation|DumpCore|entropy|Environment|EnvironmentFile|ERRNO|event_timeout|_EXE|ExecReload|ExecStart|ExecStartPost|ExecStartPre|ExecStop|ExecStopPost|ExecStopPre|filter|FONT|FONT_MAP|FONT_UNIMAP|ForwardToConsole|ForwardToKMsg|ForwardToSyslog|FreeBind|freq|FsckPassNo|fstab|_GID|Group|GuessMainPID|HandleHibernateKey|HandleLidSwitch|HandlePowerKey|HandleSuspendKey|hash|HibernateKeyIgnoreInhibited|HOME_URL|_HOSTNAME|ICON_NAME|ID|IdleAction|IdleActionSec|ID_LIKE|ID_MODEL|ID_MODEL_FROM_DATABASE|IgnoreOnIsolate|IgnoreOnSnapshot|IgnoreSIGPIPE|InaccessibleDirectories|InhibitDelayMaxSec|init|IOSchedulingClass|IOSchedulingPriority|IPTOS|IPTTL|JobTimeoutSec|JoinControllers|KeepAlive|KEYMAP|KEYMAP_TOGGLE|KillExcludeUsers|KillMode|KillOnlyUsers|KillSignal|KillUserProcesses|LidSwitchIgnoreInhibited|LimitAS|LimitCORE|LimitCPU|LimitDATA|LimitFSIZE|LimitLOCKS|LimitMEMLOCK|LimitMSGQUEUE|LimitNICE|LimitNOFILE|LimitNPROC|LimitRSS|LimitRTPRIO|LimitRTTIME|LimitSIGPENDING|LimitSTACK|link_priority|valueListenDatagram|ListenFIFO|ListenMessageQueue|ListenNetlink|ListenSequentialPacket|ListenSpecial|ListenStream|LogColor|LogLevel|LogLocation|LogTarget|luks|_MACHINE_ID|MakeDirectory|Mark|MaxConnections|MaxFileSec|MaxLevelConsole|MaxLevelKMsg|MaxLevelStore|MaxLevelSyslog|MaxRetentionSec|MemoryLimit|MemorySoftLimit|MESSAGE|MESSAGE_ID|MessageQueueMaxMessages|MessageQueueMessageSize|__MONOTONIC_TIMESTAMP|MountFlags|NAME|NAutoVTs|Nice|NonBlocking|NoNewPrivileges|NotifyAccess|OnActiveSec|OnBootSec|OnCalendar|OnFailure|OnFailureIsolate|OnStartupSec|OnUnitActiveSec|OnUnitInactiveSec|OOMScoreAdjust|Options|output|PAMName|PartOf|PassCredentials|PassSecurity|PathChanged|PathExists|PathExistsGlob|PathModified|PermissionsStartOnly|_PID|PIDFile|PipeSize|PowerKeyIgnoreInhibited|PRETTY_HOSTNAME|PRETTY_NAME|Priority|PRIORITY|PrivateNetwork|PrivateTmp|PropagatesReloadTo|pss|RateLimitBurst|RateLimitInterval|ReadOnlyDirectories|ReadWriteDirectories|__REALTIME_TIMESTAMP|ReceiveBuffer|RefuseManualStart|RefuseManualStop|rel|ReloadPropagatedFrom|RemainAfterExit|RequiredBy|Requires|RequiresMountsFor|RequiresOverridable|Requisite|RequisiteOverridable|ReserveVT|ResetControllers|Restart|RestartPreventExitStatus|RestartSec|RootDirectory|RootDirectoryStartOnly|RuntimeKeepFree|RuntimeMaxFileSize|RuntimeMaxUse|RuntimeWatchdogSec|samples|scale_x|scale_y|Seal|SecureBits|_SELINUX_CONTEXT|SendBuffer|SendSIGKILL|Service|ShowStatus|ShutdownWatchdogSec|size|SmackLabel|SmackLabelIPIn|SmackLabelIPOut|SocketMode|Sockets|SourcePath|_SOURCE_REALTIME_TIMESTAMP|SplitMode|StandardError|StandardInput|StandardOutput|StartLimitAction|StartLimitBurst|StartLimitInterval|static_node|StopWhenUnneeded|Storage|string_escape|none|replaceSuccessExitStatus|SupplementaryGroups|SUPPORT_URL|SuspendKeyIgnoreInhibited|SyslogFacility|SYSLOG_FACILITY|SyslogIdentifier|SYSLOG_IDENTIFIER|SyslogLevel|SyslogLevelPrefix|SYSLOG_PID|SystemCallFilter|SYSTEMD_ALIAS|_SYSTEMD_CGROUP|_SYSTEMD_OWNER_UID|SYSTEMD_READY|_SYSTEMD_SESSION|_SYSTEMD_UNIT|_SYSTEMD_USER_UNIT|SYSTEMD_WANTS|SystemKeepFree|SystemMaxFileSize|SystemMaxUse|SysVStartPriority|TCPCongestion|TCPWrapName|timeout|TimeoutSec|TimeoutStartSec|TimeoutStopSec|TimerSlackNSec|Transparent|_TRANSPORT|tries|TTYPath|TTYReset|TTYVHangup|TTYVTDisallocate|Type|_UID|UMask|Unit|User|UtmpIdentifier|VERSION|VERSION_ID|WantedBy|Wants|WatchdogSec|What|Where|WorkingDirectory)=" + - preproc: "^\\.include\\>" + - symbol: "=" + - special: "^\\[(Unit|Install|Service|Socket)\\]" + - identifier.class: "\\$MAINPID" + - constant.bool: "\\b(true|false)\\b" + - comment: "(^|[[:space:]])#([^{].*)?$" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/tcl.yaml b/runtime/syntax/tcl.yaml new file mode 100644 index 00000000..82963c2b --- /dev/null +++ b/runtime/syntax/tcl.yaml @@ -0,0 +1,18 @@ +filetype: tcl + +detect: + filename: "\\.tcl$" + header: "^#!.*/(env +)?tclsh( |$)" + +rules: + - statement: "\\b(after|append|array|auto_execok|auto_import|auto_load|auto_load_index|auto_qualify|binary|break|case|catch|cd|clock|close|concat|continue|else|encoding|eof|error|eval|exec|exit|expr|fblocked|fconfigure|fcopy|file|fileevent|flush|for|foreach|format|gets|glob|global|history|if|incr|info|interp|join|lappend|lindex|linsert|list|llength|load|lrange|lreplace|lsearch|lset|lsort|namespace|open|package|pid|puts|pwd|read|regexp|regsub|rename|return|scan|seek|set|socket|source|split|string|subst|switch|tclLog|tell|time|trace|unknown|unset|update|uplevel|upvar|variable|vwait|while)\\b" + - statement: "\\b(array anymore|array donesearch|array exists|array get|array names|array nextelement|array set|array size|array startsearch|array statistics|array unset)\\b" + - statement: "\\b(string bytelength|string compare|string equal|string first|string index|string is|string last|string length|string map|string match|string range|string repeat|string replace|string to|string tolower|string totitle|string toupper|string trim|string trimleft|string trimright|string will|string wordend|string wordstart)\\b" + - statement: "\\b(alarm|auto_load_pkg|bsearch|catclose|catgets|catopen|ccollate|cconcat|cequal|chgrp|chmod|chown|chroot|cindex|clength|cmdtrace|commandloop|crange|csubstr|ctoken|ctype|dup|echo|execl|fcntl|flock|fork|fstat|ftruncate|funlock|host_info|id|infox|keyldel|keylget|keylkeys|keylset|kill|lassign|lcontain|lempty|lgets|link|lmatch|loadlibindex|loop|lvarcat|lvarpop|lvarpush|max|min|nice|pipe|profile|random|readdir|replicate|scancontext|scanfile|scanmatch|select|server_accept|server_create|signal|sleep|sync|system|tclx_findinit|tclx_fork|tclx_load_tndxs|tclx_sleep|tclx_system|tclx_wait|times|translit|try_eval|umask|wait)\\b" + - identifier.class: "proc[[:space:]]|(\\{|\\})" + - symbol.operator: "(\\(|\\)|\\;|`|\\\\|\\$|<|>|!|=|&|\\|)" + - constant.number: "\\b[0-9]+(\\.[0-9]+)?\\b" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - identifier.var: "\\$\\{?[0-9A-Z_!@#$*?-]+\\}?" + - comment: "(^|;)[[:space:]]*#.*" + - indent-char.whitespace: "[[:space:]]+$" diff --git a/runtime/syntax/tex.yaml b/runtime/syntax/tex.yaml index 929fdbc8..5f0f04eb 100644 --- a/runtime/syntax/tex.yaml +++ b/runtime/syntax/tex.yaml @@ -4,28 +4,23 @@ detect: filename: "\\.tex$|bib|\\.bib$|cls|\\.cls$" rules: - # colorize the identifiers of {} and [] - identifier: start: "\\{" end: "\\}" rules: [] + - identifier: start: "\\[" end: "\\]" rules: [] - # numbers + - constant.number: "\\b[0-9]+(\\.[0-9]+)?([[:space:]](pt|mm|cm|in|ex|em|bp|pc|dd|cc|nd|nc|sp))?\\b" - # let brackets have the default color again - - default: "[{}\\[\\]]" + - symbol.brackets: "[{}\\[\\]]" - special: "[&\\\\]" - # macros - - statement: "\\\\@?[a-zA-Z_]+" - # comments - - comment: - start: "%" - end: "$" - rules: [] + - identifier.macro: "\\\\@?[a-zA-Z_]+" + - comment: "%.*" - comment: start: "\\\\begin\\{comment\\}" end: "\\\\end\\{comment\\}" rules: [] + diff --git a/runtime/syntax/toml.yaml b/runtime/syntax/toml.yaml index 639be321..c1c8833f 100644 --- a/runtime/syntax/toml.yaml +++ b/runtime/syntax/toml.yaml @@ -1,39 +1,18 @@ filetype: toml -detect: - filename: "\\.toml" +detect: + filename: "\\.toml$" rules: - statement: "(.*)[[:space:]]=" - special: "=" - - # Bracket thingies - - special: "(\\[|\\])" - - # Numbers and strings + - symbol.brackets: "(\\[|\\])" - constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b|'.'" - - constant.number: "\\\\([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: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "`" - end: "`" - rules: - - constant.specialChar: "\\\\." - - - comment: - start: "#" - end: "$" - rules: - - todo: "(TODO|XXX|FIXME):?" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - 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: "`[^`]*`" + - constant.specialChar: "\"" + - constant.specialChar: "'" + - comment: "(^|[[:space:]])#.*" + - todo: "(TODO|XXX|FIXME):?" diff --git a/runtime/syntax/typescript.yaml b/runtime/syntax/typescript.yaml index 0b89423e..541d3484 100644 --- a/runtime/syntax/typescript.yaml +++ b/runtime/syntax/typescript.yaml @@ -1,42 +1,26 @@ filetype: typescript -detect: +detect: filename: "\\.ts$" 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:]]*[(]" + - 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.class: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]" - statement: "\\b(abstract|as|async|await|break|case|catch|class|const|constructor|continue)\\b" - statement: "\\b(debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from)\\b" - statement: "\\b(function|get|if|implements|import|in|instanceof|interface|is|let|module|namespace)\\b" - statement: "\\b(new|of|package|private|protected|public|require|return|set|static|super|switch)\\b" - statement: "\\b(this|throw|try|type|typeof|var|void|while|with|yield)\\b" - - constant: "\\b(false|true|null|undefined|NaN)\\b" + - constant.bool: "\\b(false|true|null|undefined|NaN)\\b" - type: "\\b(Array|Boolean|Date|Enumerator|Error|Function|Math)\\b" - type: "\\b(Number|Object|RegExp|String|Symbol)\\b" - type: "\\b(any|boolean|never|number|string|symbol)\\b" - - statement: "[-+/*=<>!~%?:&|]" + - symbol.operator: "[\\-+/*=<>!~%?:&|]" - constant: "/[^*]([^/]|(\\\\/))*[^\\\\]/[gim]*" - constant: "\\\\[0-7][0-7]?[0-7]?|\\\\x[0-9a-fA-F]+|\\\\[bfnrt'\"\\?\\\\]" - - comment: - start: "//" - end: "$" - rules: [] - - comment: - start: "/\\*" - end: "\\*/" - rules: - - todo: "TODO:?" - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." - \ No newline at end of file + - comment: "(^|[[:space:]])//.*" + - comment: "/\\*.+\\*/" + - todo: "TODO:?" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" diff --git a/runtime/syntax/vala.yaml b/runtime/syntax/vala.yaml new file mode 100644 index 00000000..aaa7f989 --- /dev/null +++ b/runtime/syntax/vala.yaml @@ -0,0 +1,26 @@ +filetype: vala + +detect: + filename: "\\.vala$" + +rules: + - type: "\\b(float|double|bool|char|int|uint|short|long|void|(un)?signed)\\b" + - identifier.class: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[()]" + - statement: "\\b(for|if|while|do|else|case|default|switch|try|throw|catch)\\b" + - statement: "\\b(inline|typedef|struct|enum|union|extern|static|const)\\b" + - statement: "\\b(operator|new|delete|return|null)\\b" + - statement: "\\b(class|override|private|public|signal|this|weak)\\b" + - special: "\\b(goto|break|continue)\\b" + - constant.bool: "\\b(true|false)\\b" + - constant.number: "\\b([0-9]+)\\b" + - symbol.operator: "[\\-+/*=<>?:!~%&|]|->" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - comment: "(^|[[:space:]])//.*" + - comment: + start: "/\\*" + end: "\\*/" + rules: [] + + - todo: "TODO:?" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/vhdl.yaml b/runtime/syntax/vhdl.yaml new file mode 100644 index 00000000..6bd3b53a --- /dev/null +++ b/runtime/syntax/vhdl.yaml @@ -0,0 +1,37 @@ +filetype: vhdl + +detect: + filename: "\\.vhdl?$" + +rules: + - type: "(i)\\b(string|integer|natural|positive|(un)?signed|std_u?logic(_vector)?|bit(_vector)?|boolean|u?x01z?|array|range)\\b" + - identifier: "(?i)library[[:space:]]+[a-zA-Z_0-9]+" + - identifier: "(?i)use[[:space:]]+[a-zA-Z_0-9\\.]+" + - identifier: "(?i)component[[:space:]]+[a-zA-Z_0-9]+" + - identifier: "(?i)(architecture|configuration)[[:space:]]+[a-zA-Z_0-9]+[[:space:]]+of[[:space:]]+[a-zA-Z_0-9]+" + - identifier: "(?i)(entity|package)[[:space:]]+[a-zA-Z_0-9]+[[:space:]]+is" + - identifier: "(?i)end[[:space:]]+((architecture|entity|component|process|package|generate)[[:space:]]+)?[a-zA-Z_0-9]+" + - statement: "(?i)\\b(abs|access|after|alias|all|and|architecture|assert|attribute)\\b" + - statement: "(?i)\\b(begin|block|body|buffer|bus|case|component|configuration|constant)\\b" + - statement: "(?i)\\b(disconnect|downto|else|elsif|end|entity|exit)\\b" + - statement: "(?i)\\b(file|for|function|generate|generic|guarded)\\b" + - statement: "(?i)\\b(if|impure|in|inertial|inout|is)\\b" + - statement: "(?i)\\b(label|library|linkage|literal|loop|map|mod)\\b" + - statement: "(?i)\\b(nand|new|next|nor|not|null|of|on|open|or|others|out)\\b" + - statement: "(?i)\\b(package|port|postponed|procedure|process|pure)\\b" + - statement: "(?i)\\b(range|record|register|reject|rem|report|return|rol|ror)\\b" + - statement: "(?i)\\b(select|severity|shared|signal|sla|sll|sra|srl|subtype)\\b" + - statement: "(?i)\\b(then|to|transport|type|unaffected|units|until|use)\\b" + - statement: "(?i)\\b(variable|wait|when|while|with|xnor|xor)\\b" + - statement: "(?i)'(base|left|right|high|low|pos|val|succ|pred|leftof|rightof|image|(last_)?value)" + - statement: "(?i)'((reverse_)?range|length|ascending|event|stable)" + - statement: "(?i)'(simple|path|instance)_name" + - statement: "(?i)\\b(std_match|(rising|falling)_edge|is_x)\\b" + - statement: "(?i)\\bto_(unsigned|signed|integer|u?x01z?|stdu?logic(vector)?)\\b" + - symbol.operator: "(\\+|-|\\*|/|&|<|>|=|\\.|:)" + - constant.number: "(?i)'([0-1]|u|x|z|w|l|h|-)'|[box]?\"([0-1a-fA-F]|u|x|z|w|l|h|-)+\"" + - constant.number: "(?i)\\b[0-9\\._]+(e[\\-]?[0-9]+)?( ?[fpnum]?s)?\\b" + - constant.bool: "(?i)\\b(true|false)\\b" + - constant: "(?i)\\b(note|warning|error|failure)\\b" + - constant.string: "\"[^\"]*\"" + - comment: "--.*" diff --git a/runtime/syntax/vi.yaml b/runtime/syntax/vi.yaml index 43fa54db..f0491d1d 100644 --- a/runtime/syntax/vi.yaml +++ b/runtime/syntax/vi.yaml @@ -1,29 +1,13 @@ filetype: vi -detect: +detect: filename: "(^|/|\\.)(ex|vim)rc$|\\.vim" rules: - identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[()]" - statement: "\\b([nvxsoilc]?(nore|un)?map|[nvlx]n|[ico]?no|[cilovx][um]|s?unm)\\b" - statement: "\\b(snor|nun|nm|set|if|endif|let|unlet)\\b" - - statement: "[!&=]" + - symbol.operator: "[!&=]" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" - constant.number: "\\b[0-9]+\\b" - - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." - - - constant.comment: - start: "\"" - end: "$" - rules: [] - + - comment: "(^|[[:space:]])\\\"[^\"]*$" diff --git a/runtime/syntax/xml.yaml b/runtime/syntax/xml.yaml index dbc99512..d43a2602 100644 --- a/runtime/syntax/xml.yaml +++ b/runtime/syntax/xml.yaml @@ -1,16 +1,14 @@ filetype: xml -detect: +detect: filename: "\\.(xml|sgml?|rng|plist)$" rules: - - identifier: "<.*?>" - - comment: + - symbol.tag: "<.*?>" + - preproc: start: "" rules: [] - - comment: - start: "" - rules: [] + + - comment: "" - special: "&[^;]*;" diff --git a/runtime/syntax/xresources.yaml b/runtime/syntax/xresources.yaml new file mode 100644 index 00000000..9e35d733 --- /dev/null +++ b/runtime/syntax/xresources.yaml @@ -0,0 +1,14 @@ +filetype: xresources + +detect: + filename: "X(defaults|resources)$" + +rules: + - special: "^[[:alnum:]]+\\*" + - identifier.var: "\\*[[:alnum:]]+\\:" + - constant.number: "\\b[0-9]+\\b" + - symbol.operator: "[*:=]" + - constant.bool: "\\b(true|false)\\b" + - comment: "(^|[[:space:]])#([^{].*)?$" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/yaml.yaml b/runtime/syntax/yaml.yaml index 2ca334f3..9a397ea0 100644 --- a/runtime/syntax/yaml.yaml +++ b/runtime/syntax/yaml.yaml @@ -1,32 +1,19 @@ filetype: yaml -detect: +detect: filename: "\\.ya?ml$" header: "%YAML" rules: - type: "(^| )!!(binary|bool|float|int|map|null|omap|seq|set|str) " - - constant: "\\b(YES|yes|Y|y|ON|on|NO|no|N|n|OFF|off)\\b" - - constant: "\\b(true|false)\\b" - - statement: "(:[[:space:]]|\\[|\\]|:[[:space:]]+[|>]|^[[:space:]]*- )" + - constant.bool.true: "\\b(YES|yes|Y|y|ON|on)\\b" + - constant.bool.false: "\\b(NO|no|N|n|OFF|off)\\b" + - constant.bool.true: "\\b(true)\\b" + - constant.bool.false: "\\b(false)\\b" + - statement: ":[[:space:]]|\\[|\\]|:[[:space:]]+[|>]|^[[:space:]]*- " - identifier: "[[:space:]][\\*&][A-Za-z0-9]+" - - type: "([-\\w]+:\\s+)|([-\\w]+:$)" - - special: "(^---|^\\.\\.\\.|^%YAML|^%TAG)" - - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: - - constant.specialChar: "\\\\." - - - comment: - start: "#" - end: "$" - rules: [] - + - type: "([-\\w\\.\\/]+[[:space:]]*:\\s+)|([-\\w\\.\\/]+[[:space:]]*:$)" + - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - comment: "(^|[[:space:]])#([^{].*)?$" + - special: "^---|^\\.\\.\\.|^%YAML|^%TAG" + - indent-char.whitespace: " $" diff --git a/runtime/syntax/yum.yaml b/runtime/syntax/yum.yaml new file mode 100644 index 00000000..ee2864d7 --- /dev/null +++ b/runtime/syntax/yum.yaml @@ -0,0 +1,12 @@ +filetype: yum + +detect: + filename: "\\.repo$|yum.*\\.conf$" + +rules: + - identifier: "^[[:space:]]*[^=]*=" + - constant.specialChar: "^[[:space:]]*\\[.*\\]$" + - statement: "\\$(releasever|arch|basearch|uuid|YUM[0-9])" + - comment: "(^|[[:space:]])#([^{].*)?$" + - indent-char.whitespace: "[[:space:]]+$" + - indent-char: " + +| + +" diff --git a/runtime/syntax/zsh.yaml b/runtime/syntax/zsh.yaml index b6583145..d3ae8fa7 100644 --- a/runtime/syntax/zsh.yaml +++ b/runtime/syntax/zsh.yaml @@ -1,50 +1,24 @@ filetype: zsh -detect: - filename: "(\\.zsh$|\\.?(zshenv|zprofile|zshrc|zlogin|zlogout)$)" +detect: + filename: "\\.zsh$|\\.?(zshenv|zprofile|zshrc|zlogin|zlogout|zsh-theme)$" header: "^#!.*/(env +)?zsh( |$)" rules: - ## Numbers - constant.number: "\\b[0-9]+\\b" - - ## Conditionals and control flow - statement: "\\b(always|break|bye|case|continue|disown|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\\b" - - - statement: "(\\{|\\}|\\(|\\)|\\;|\\]|\\[|`|\\\\|\\$|<|>|!|=|&|\\|)" - ## Conditional flags - - special: "-[Ldefgruwx]\\b" - - special: "-(eq|ne|gt|lt|ge|le|s|n|z)\\b" - - ## Bash-inherited - - statement: "\\b((un)?alias|bindkey|builtin|cd|declare|eval|exec|export|jobs|let|popd|pushd|set|source|typeset|umask|unset)\\b" - ## ZSH-specific - - type: "\\b(add-zsh-hook|autoload|chdir|compinit|dirs|(dis|en)able|echotc|emulate|print|prompt(init)?|(un)?setopt|zle|zmodload|zstyle|whence)\\b" - - ## Common linux commands - - statement: "\\b((g|ig)?awk|find|\\w{0,4}grep|kill|killall|\\w{0,4}less|make|pkill|sed|tar)\\b" - - ## Coreutils commands - - statement: "\\b(base64|basename|cat|chcon|chgrp|chmod|chown|chroot|cksum|comm|cp|csplit|cut|date|dd|df|dir|dircolors|dirname|du|echo|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|timeout|touch|tr|true|truncate|tsort|tty|uname|unexpand|uniq|unlink|users|vdir|wc|who|whoami|yes)\\b" - - ## Function definition - - identifier: "^\\s+(function\\s+)[0-9A-Z_]+\\s+\\(\\)" # (i) - - ## Variables - - identifier: "\\$\\{?[0-9A-Z_!@#$*?-]+\\}?" #(i) - - - constant.string: - start: "\"" - end: "\"" - rules: - - constant.specialChar: "\\\\." - - - constant.string: - start: "'" - end: "'" - rules: [] - - - comment: - start: "#" - end: "$" - rules: [] + - symbol.operator: "(\\{|\\}|\\(|\\)|\\;|\\]|\\[|`|\\\\|\\$|<|>|!|=|&|\\|)" + - statement: "-[Ldefgruwx]\\b" + - statement: "-(eq|ne|gt|lt|ge|le|s|n|z)\\b" + - preproc: "\\b((un)?alias|bindkey|builtin|cd|declare|eval|exec|export|jobs|let|popd|pushd|set|source|typeset|umask|unset)\\b" + - preproc: "\\b(add-zsh-hook|autoload|chdir|compinit|dirs|(dis|en)able|echotc|emulate|print|prompt(init)?|(un)?setopt|zle|zmodload|zstyle|whence)\\b" + - special: "\\b((g|ig)?awk|find|\\w{0,4}grep|kill|killall|\\w{0,4}less|make|pkill|sed|tar)\\b" + - type: "\\b(base64|basename|cat|chcon|chgrp|chmod|chown|chroot|cksum|comm|cp|csplit|cut|date|dd|df|dir|dircolors|dirname|du|echo|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|timeout|touch|tr|true|truncate|tsort|tty|uname|unexpand|uniq|unlink|users|vdir|wc|who|whoami|yes)\\b" + - identifier.class: "^\\s+(function\\s+)[0-9A-Z_]+\\s+\\(\\)" + - identifier.var: "\\$\\{?[0-9A-Z_!@#$*?-]+\\}?" + - constant.string: "\"(\\\\.|[^\"])*\"" + - constant.string: "'(\\\\.|[^'])*'" + - comment: "(^|[[:space:]])#.*$" + - comment.bright: "(^|[[:space:]])##.*$" + - indent-char.whitespace: "[[:space:]]+$" + - preproc.shebang: "^#!.+?( |$)"