Dave Jarvis' Repositories

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

Updates batch file syntax

Author Dave Jarvis <email>
Date 2026-02-14 20:02:44 GMT-0800
Commit 643e639996f3661e68bc646df4a163b2dea8e392
Parent d081538
Delta 7 lines added, 6 lines removed, 1-line increase
render/LanguageDefinitions.php
'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 . '/',
+ 'batch' => [
+ 'comment' => '/((?i:rem)\b.*$|::.*$)/m',
+ 'string' => '/("[^"]*")/',
+ 'keyword' => '/(?i)\b(if|else|goto|for|in|do|call|exit|echo|pause|set|shift|start|cd|dir|copy|del|md|rd|cls|setlocal|endlocal|enabledelayedexpansion|defined|exist|not|errorlevel|setx|findstr|reg|nul|tokens|usebackq|equ|neq|lss|leq|gtr|geq)\b/',
+ 'variable' => '/(![\w-]+!|%[\w\(\)-]+%|%%[~a-zA-Z]+|%[~a-zA-Z0-9]+)/',
+ 'label' => '/(^\s*:[a-zA-Z0-9_-]+)/m',
+ 'number' => '/' . $int . '/',
],
'c' => [