From ddc4b1706f8b6e363c57b4062d4e4d6bc6759f74 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 1 Sep 2016 09:22:11 +0200 Subject: [PATCH] manually merge https://github.com/claudehohl/Stikked/pull/329/files - thanks kylelaker! --- htdocs/application/config/geshi_languages.php | 1 + .../libraries/geshi/geshi/kotlin.php | 132 ++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 htdocs/application/libraries/geshi/geshi/kotlin.php diff --git a/htdocs/application/config/geshi_languages.php b/htdocs/application/config/geshi_languages.php index 37d435d..a498b3a 100644 --- a/htdocs/application/config/geshi_languages.php +++ b/htdocs/application/config/geshi_languages.php @@ -120,6 +120,7 @@ $config['geshi_languages'] = array( //'kixtart' => 'PHP', 'klonec' => 'KLone with C', 'klonecpp' => 'KLone with C++', + 'kotlin' => 'Kotlin', 'latex' => 'LaTeX', 'lb' => 'Liberty BASIC', 'ldif' => 'LDIF', diff --git a/htdocs/application/libraries/geshi/geshi/kotlin.php b/htdocs/application/libraries/geshi/geshi/kotlin.php new file mode 100644 index 0000000..3fd8cf0 --- /dev/null +++ b/htdocs/application/libraries/geshi/geshi/kotlin.php @@ -0,0 +1,132 @@ + 'Kotlin', + 'COMMENT_SINGLE' => array(1 => '//'), + 'COMMENT_MULTI' => array('/*' => '*/'), + 'COMMENT_REGEXP' => array(), + 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, + 'QUOTEMARKS' => array("'",'"'), + 'ESCAPE_CHAR' => '\\', + 'ESCAPE_REGEXP' => array( + // Simple Single Char Escapes + 1 => "#\\\\[nfrtv\$\"\n\\\\]#i", + // Hexadecimal Char Specs + 2 => "#\\\\x[\da-fA-F]{1,2}#i", + // Hexadecimal Char Specs (unicode) + 3 => "#\\\\u[\da-fA-F]{1,4}#", + // Hexadecimal Char Specs (Extended Unicode) + 4 => "#\\\\U[\da-fA-F]{1,8}#", + ), + 'KEYWORDS' => array( + 1 => array('package', 'file', 'import', 'as', 'is', 'class', 'interface', 'constructor', 'by', + 'where', 'when', 'init', 'companion', 'object', + 'val', 'var', 'fun', 'get', 'set', 'super', 'this', 'dynamic', 'if', 'else', + 'try', 'catch', 'finally', 'for', 'while', 'do', 'in', 'out', 'true', 'false', 'null', + 'throw', 'return', 'continue', 'break', + 'abstract', 'final', 'enum', 'open', 'override', 'annotation', + 'public', 'private', 'protected', 'internal' + ), + 2 => array('Unit', 'Double', 'Float', 'Long', 'Int', 'Short', 'Byte', 'Boolean', 'Char', 'String') + ), + 'SYMBOLS' => array( + '(', ')', '[', ']', '{', '}', '*', '<', '>', '?', '!', + 'it', ':', '=', '->', '..', '::', + '$', '@' + ), + 'CASE_SENSITIVE' => array( + GESHI_COMMENTS => false, + 1 => true, + 2 => true + ), + 'STYLES' => array( + 'KEYWORDS' => array( + 1 => 'color: #0000ff; font-weight: bold;', + 2 => 'color: #9999cc; font-weight: bold;', + ), + 'COMMENTS' => array( + 1 => 'color: #008000; font-style: italic;', + 2 => 'color: #CC66FF;', + 'MULTI' => 'color: #00ff00; font-style: italic;' + ), + 'ESCAPE_CHAR' => array( + 0 => 'color: #6666ff; font-weight: bold;', + 1 => 'color: #6666ff; font-weight: bold;', + 2 => 'color: #5555ff; font-weight: bold;', + 3 => 'color: #4444ff; font-weight: bold;', + 4 => 'color: #3333ff; font-weight: bold;' + ), + 'BRACKETS' => array( + 0 => 'color: #F78811;' + ), + 'STRINGS' => array( + 0 => 'color: #6666FF;' + ), + 'NUMBERS' => array( + 0 => 'color: #F78811;' + ), + 'METHODS' => array( + 1 => 'color: #000000;', + 2 => 'color: #000000;' + ), + 'SYMBOLS' => array( + 0 => 'color: #000080;' + ), + 'SCRIPT' => array( + ), + 'REGEXPS' => array( + ) + ), + 'URLS' => array( + 1 => 'https://kotlinlang.org/', + 2 => '' + ), + 'OOLANG' => true, + 'OBJECT_SPLITTERS' => array( + 1 => '.' + ), + 'REGEXPS' => array( + ), + 'STRICT_MODE_APPLIES' => GESHI_NEVER, + 'SCRIPT_DELIMITERS' => array( + ), + 'HIGHLIGHT_STRICT_BLOCK' => array( + ) +); + +?>