Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/treetrek.git

Adds .bat highlighting

AuthorDave Jarvis <email>
Date2026-02-14 19:59:31 GMT-0800
Commitd0815387cb22e63ea5879a9477f5001664a8a58e
Parent9614648
File.php
'lua' => 'lua',
'sh', 'bash', 'zsh' => 'bash',
+ 'bat', 'cmd' => 'bat',
'md', 'markdown' => 'markdown',
'rmd' => 'rmd',
render/LanguageDefinitions.php
'string_interp' => '/(".*?")/',
'string' => '/(\'.*?\')/',
- 'comment' => '/(\/\/.*$|#.*$|\/\*.*?\*\/)/ms',
+ 'comment' => '/(\/\/[^\r\n]*|#[^\r\n]*|\/\*.*?\*\/)/ms',
'keyword' => '/\b(class|abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/',
'function' => '/\b([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\s*(?=\()/',
'variable' => '/(\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)/',
'number' => '/' . $int . '/',
],
'bash' => [
'string_interp' => '/(".*?")/',
'string' => '/(\'.*?\')/',
- 'comment' => '/(#.*$)/m',
+ 'comment' => '/(#[^\r\n]*)/m',
'keyword' => '/\b(if|then|else|elif|fi|case|esac|for|while|until|do|done|function|local|return|exit|break|continue|export|source|alias|eval|exec)\b/',
'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\()/',
'variable' => '/(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{[^}]+\})/',
+ 'number' => '/' . $int . '/',
+ ],
+ 'bat' => [
+ 'comment' => '/(REM[^\r\n]*|::[^\r\n]*)/mi',
+ 'keyword' => '/\b(ASSOC|BREAK|CALL|CD|CHDIR|CLS|COLOR|COPY|DATE|DEL|DIR|ECHO|ENDLOCAL|ERASE|EXIT|FOR|FTYPE|GOTO|IF|MD|MKDIR|MOVE|PATH|PAUSE|POPD|PROMPT|PUSHD|RD|REM|REN|RENAME|RMDIR|SET|SETLOCAL|SHIFT|START|TIME|TITLE|TYPE|VER|VERIFY|VOL|DEFINED|ERRORLEVEL|EXIST|IN|DO|NOT|NUL|OFF|ON)\b/i',
+ 'variable' => '/(%[a-zA-Z_][a-zA-Z0-9_]*%|%\d+|![a-zA-Z_][a-zA-Z0-9_]*!)/',
+ 'string' => '/' . $str . '/',
'number' => '/' . $int . '/',
],
'c' => [
'string' => '/' . $str . '/',
- 'comment' => '/(\/\/.*$|\/\*.*?\*\/)/ms',
+ 'comment' => '/(\/\/[^\r\n]*|\/\*.*?\*\/)/ms',
'keyword' => '/\b(auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/',
'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\()/',
'number' => '/' . $int . '/',
],
'cpp' => [
'string' => '/' . $str . '/',
- 'comment' => '/(\/\/.*$|\/\*.*?\*\/)/ms',
+ 'comment' => '/(\/\/[^\r\n]*|\/\*.*?\*\/)/ms',
'keyword' => '/\b(alignas|alignof|and|and_eq|asm|auto|bitand|bitor|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|false|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|not|not_eq|nullptr|operator|or|or_eq|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|true|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while|xor|xor_eq)\b/',
'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\()/',
'number' => '/' . $int . '/',
],
'java' => [
'string' => '/' . $str . '/',
- 'comment' => '/(\/\/.*$|\/\*.*?\*\/)/ms',
+ 'comment' => '/(\/\/[^\r\n]*|\/\*.*?\*\/)/ms',
'keyword' => '/\b(abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|void|volatile|while)\b/',
'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\()/',
'number' => '/' . $int . '/',
],
'go' => [
'string' => '/(".*?"|`.*?`)/s',
- 'comment' => '/(\/\/.*$|\/\*.*?\*\/)/ms',
+ 'comment' => '/(\/\/[^\r\n]*|\/\*.*?\*\/)/ms',
'keyword' => '/\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/',
'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\()/',
'number' => '/' . $int . '/',
],
'rust' => [
'string' => '/(".*?"|\'.*?\')/',
- 'comment' => '/(\/\/.*$|\/\*.*?\*\/)/ms',
+ 'comment' => '/(\/\/[^\r\n]*|\/\*.*?\*\/)/ms',
'keyword' => '/\b(as|break|const|continue|crate|else|enum|extern|false|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|true|type|unsafe|use|where|while|async|await|dyn)\b/',
'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\()/',
'number' => '/' . $int . '/',
],
'python' => [
'string' => '/(\'\'\'.*?\'\'\'|""".*?"""|".*?"|\'.*?\')/s',
- 'comment' => '/(#.*$)/m',
+ 'comment' => '/(#[^\r\n]*)/m',
'keyword' => '/\b(False|None|True|and|as|assert|async|await|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/',
'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\()/',
'number' => '/' . $int . '/',
],
'ruby' => [
'string_interp' => '/(".*?")/',
'string' => '/(\'.*?\')/',
- 'comment' => '/(#.*$)/m',
+ 'comment' => '/(#[^\r\n]*)/m',
'keyword' => '/\b(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/',
'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*[?!]?)\s*(?=\()/',
'variable' => '/(@[a-zA-Z_]\w*|\$[a-zA-Z_]\w*)/',
'number' => '/' . $int . '/',
],
'lua' => [
'string' => '/(".*?"|\'.*?\'|\[\[.*?\]\])/s',
- 'comment' => '/(--\[\[.*?\]\]|--.*$)/ms',
+ 'comment' => '/(--\[\[.*?\]\]|--[^\r\n]*)/ms',
'keyword' => '/\b(and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/',
'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\()/',
'number' => '/' . $int . '/',
],
'javascript' => [
'string' => '/(".*?"|\'.*?\'|`.*?`)/s',
- 'comment' => '/(\/\/.*$|\/\*.*?\*\/)/ms',
+ 'comment' => '/(\/\/[^\r\n]*|\/\*.*?\*\/)/ms',
'keyword' => '/\b(async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|export|extends|false|finally|for|function|if|import|in|instanceof|new|null|return|super|switch|this|throw|true|try|typeof|var|void|while|with|yield|let|static|enum)\b/',
'function' => '/\b([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?=\()/',
'number' => '/' . $int . '/',
],
'typescript' => [
'string' => '/(".*?"|\'.*?\'|`.*?`)/s',
- 'comment' => '/(\/\/.*$|\/\*.*?\*\/)/ms',
+ 'comment' => '/(\/\/[^\r\n]*|\/\*.*?\*\/)/ms',
'keyword' => '/\b(any|as|boolean|break|case|catch|class|const|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|if|implements|import|in|instanceof|interface|let|module|namespace|new|null|number|of|package|private|protected|public|require|return|static|string|super|switch|this|throw|true|try|type|typeof|var|void|while|with|yield)\b/',
'function' => '/\b([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?=\()/',
'number' => '/' . $int . '/',
],
'xml' => [
- 'comment' => '/()/s',
+ 'comment' => '/(<!--.*?-->)/s',
'string' => '/' . $str . '/',
'keyword' => '/(<\/?[a-zA-Z0-9:-]+|\s*\/?>|<\?xml|\?>)/',
'variable' => '/([a-zA-Z0-9:-]+=)/',
],
'html' => [
- 'comment' => '/()/s',
+ 'comment' => '/(<!--.*?-->)/s',
'string' => '/' . $str . '/',
'keyword' => '/(<\/?[a-zA-Z0-9:-]+|\s*\/?>)/',
'sql' => [
'string' => '/(\'.*?\')/',
- 'comment' => '/(--.*$|\/\*.*?\*\/)/ms',
+ 'comment' => '/(--[^\r\n]*|\/\*.*?\*\/)/ms',
'keyword' => '/\b(SELECT|FROM|WHERE|INSERT|UPDATE|DELETE|JOIN|LEFT|RIGHT|INNER|OUTER|ON|GROUP|BY|ORDER|HAVING|LIMIT|OFFSET|CREATE|TABLE|DROP|ALTER|INDEX|KEY|PRIMARY|FOREIGN|CONSTRAINT|DEFAULT|NULL|NOT|AND|OR|IN|VALUES|SET|AS|DISTINCT|UNION|ALL|CASE|WHEN|THEN|ELSE|END)\b/i',
'number' => '/' . $int . '/',
],
'yaml' => [
'string' => '/' . $str . '/',
- 'comment' => '/(#.*$)/m',
+ 'comment' => '/(#[^\r\n]*)/m',
'keyword' => '/^(\s*[a-zA-Z0-9_-]+:)/m',
'number' => '/' . $float . '/',
],
'markdown' => [
- 'comment' => '/()/s',
+ 'comment' => '/(<!--.*?-->)/s',
'keyword' => '/^(#{1,6}\s+.*)$/m',
'string' => '/(\*\*.*?\*\*|__.*?__|\*.*?\*|_.*?_)/',
'variable' => '/(\[.*?\]\(.*?\))/',
'number' => '/^(\s*[-*+]\s|\s*\d+\.\s)/m',
],
'rmd' => [
- 'comment' => '/()/s',
+ 'comment' => '/(<!--.*?-->)/s',
'keyword' => '/^(#{1,6}\s+.*)$/m',
'variable' => '/(`{3}\{r.*?`{3})/s',
],
'r' => [
'string' => '/' . $str . '/',
- 'comment' => '/(#.*$)/m',
+ 'comment' => '/(#[^\r\n]*)/m',
'keyword' => '/\b(if|else|repeat|while|function|for|in|next|break|TRUE|FALSE|NULL|Inf|NaN|NA)\b/',
'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\()/',
Delta27 lines added, 19 lines removed, 8-line increase