From 4d57caedaa53da50eb55e574762cb82502b5fc02 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 12 Sep 2010 02:04:21 +0200 Subject: switch to geshi for highlighting Signed-off-by: Florian Pritz --- system/application/libraries/geshi/dos.php | 198 +++++++++++++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 system/application/libraries/geshi/dos.php (limited to 'system/application/libraries/geshi/dos.php') diff --git a/system/application/libraries/geshi/dos.php b/system/application/libraries/geshi/dos.php new file mode 100644 index 000000000..c111e1b5e --- /dev/null +++ b/system/application/libraries/geshi/dos.php @@ -0,0 +1,198 @@ + 'DOS', + 'COMMENT_SINGLE' => array(), + 'COMMENT_MULTI' => array(), + //DOS comment lines + 'COMMENT_REGEXP' => array(1 => "/^\s*@?REM.*$/mi"), + 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, + 'QUOTEMARKS' => array(), + 'ESCAPE_CHAR' => '', + 'KEYWORDS' => array( + /* Flow control keywords */ + 1 => array( + 'if', 'else', 'goto', 'shift', + 'for', 'in', 'do', + 'call', 'exit' + ), + /* IF statement keywords */ + 2 => array( + 'not', 'exist', 'errorlevel', + 'defined', + 'equ', 'neq', 'lss', 'leq', 'gtr', 'geq' + ), + /* Internal commands */ + 3 => array( + 'cd', 'md', 'rd', 'chdir', 'mkdir', 'rmdir', 'dir', + 'del', 'copy', 'move', 'ren', 'rename', + 'echo', + 'setlocal', 'endlocal', 'set', + 'pause', + 'pushd', 'popd', 'title', 'verify' + ), + /* Special files */ + 4 => array( + 'prn', 'nul', 'lpt3', 'lpt2', 'lpt1', 'con', + 'com4', 'com3', 'com2', 'com1', 'aux' + ) + ), + 'SYMBOLS' => array( + '(', ')', '@', '%' + ), + 'CASE_SENSITIVE' => array( + GESHI_COMMENTS => false, + 1 => false, + 2 => false, + 3 => false, + 4 => false + ), + 'STYLES' => array( + 'KEYWORDS' => array( + 1 => 'color: #00b100; font-weight: bold;', + 2 => 'color: #000000; font-weight: bold;', + 3 => 'color: #b1b100; font-weight: bold;', + 4 => 'color: #0000ff; font-weight: bold;' + ), + 'COMMENTS' => array( + 1 => 'color: #808080; font-style: italic;' + ), + 'ESCAPE_CHAR' => array( + 0 => 'color: #ff0000; font-weight: bold;' + ), + 'BRACKETS' => array( + 0 => 'color: #66cc66;' + ), + 'STRINGS' => array( + 0 => 'color: #ff0000;' + ), + 'NUMBERS' => array( + 0 => 'color: #cc66cc;' + ), + 'METHODS' => array( + ), + 'SYMBOLS' => array( + 0 => 'color: #33cc33;', + 1 => 'color: #33cc33;' + ), + 'SCRIPT' => array( + ), + 'REGEXPS' => array( + 0 => 'color: #b100b1; font-weight: bold;', + 1 => 'color: #448844;', + 2 => 'color: #448888;' + ) + ), + 'OOLANG' => false, + 'OBJECT_SPLITTERS' => array( + ), + 'URLS' => array( + 1 => 'http://www.ss64.com/nt/{FNAMEL}.html', + 2 => 'http://www.ss64.com/nt/{FNAMEL}.html', + 3 => 'http://www.ss64.com/nt/{FNAMEL}.html', + 4 => 'http://www.ss64.com/nt/{FNAMEL}.html' + ), + 'REGEXPS' => array( + /* Label */ + 0 => array( +/* GESHI_SEARCH => '((?si:[@\s]+GOTO\s+|\s+:)[\s]*)((? '((?si:[@\s]+GOTO\s+|\s+:)[\s]*)((? '\\2', + GESHI_MODIFIERS => 'si', + GESHI_BEFORE => '\\1', + GESHI_AFTER => '' + ), + /* Variable assignement */ + 1 => array( +/* GESHI_SEARCH => '(SET[\s]+(?si:\/A[\s]+|\/P[\s]+|))([^=\s\n]+)([\s]*=)',*/ + GESHI_SEARCH => '(SET[\s]+(?si:\/A[\s]+|\/P[\s]+|))([^=\n]+)([\s]*=)', + GESHI_REPLACE => '\\2', + GESHI_MODIFIERS => 'si', + GESHI_BEFORE => '\\1', + GESHI_AFTER => '\\3' + ), + /* Arguments or variable evaluation */ + 2 => array( +/* GESHI_SEARCH => '(%)([\d*]|[^%\s]*(?=%))((? '(%(?:%(?=[a-z0-9]))?)([\d*]|(?:~[adfnpstxz]*(?:$\w+:)?)?[a-z0-9](?!\w)|[^%\n]*(?=%))((? '\\2', + GESHI_MODIFIERS => 'si', + GESHI_BEFORE => '\\1', + GESHI_AFTER => '\\3' + ) + ), + 'STRICT_MODE_APPLIES' => GESHI_NEVER, + 'SCRIPT_DELIMITERS' => array( + ), + 'HIGHLIGHT_STRICT_BLOCK' => array( + ), + 'TAB_WIDTH' => 4, + 'PARSER_CONTROL' => array( + 'KEYWORDS' => array( + 4 => array( + 'DISALLOWED_BEFORE' => '(? -- cgit v1.2.3-24-g4f1b