[ Index ] |
PHP Cross Reference of DokuWiki |
[Summary view] [Print] [Text view]
1 <?php 2 /************************************************************************************* 3 * standardml.php 4 * ---------- 5 * Author: eldesh (nephits@gmail.com) 6 * Copyright: (c) 2014 eldesh (http://d.hatena.ne.jp/eldesh/) 7 * Release Version: 1.0.9.1 8 * Date Started: 2014/02/04 9 * 10 * SML (StandardML'97) language file for GeSHi. 11 * This file also support some implementation dependent keywords by SML/NJ and SML#. 12 * 13 * CHANGES 14 * ------- 15 * 2014/02/05 (1.0.8.11) 16 * - First Release 17 * 18 * TODO (updated 2014/02/04) 19 * ------------------------- 20 * - support character literal 21 * - support Vector expressions and patterns (http://www.smlnj.org/doc/features.html) 22 * - support more Basis functions...? 23 * 24 ************************************************************************************* 25 * 26 * This file is part of GeSHi. 27 * 28 * GeSHi is free software; you can redistribute it and/or modify 29 * it under the terms of the GNU General Public License as published by 30 * the Free Software Foundation; either version 2 of the License, or 31 * (at your option) any later version. 32 * 33 * GeSHi is distributed in the hope that it will be useful, 34 * but WITHOUT ANY WARRANTY; without even the implied warranty of 35 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 36 * GNU General Public License for more details. 37 * 38 * You should have received a copy of the GNU General Public License 39 * along with GeSHi; if not, write to the Free Software 40 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 41 * 42 ************************************************************************************/ 43 44 $language_data = array ( 45 'LANG_NAME' => 'StandardML', 46 'COMMENT_SINGLE' => array(), 47 'COMMENT_MULTI' => array('(*' => '*)'), 48 'COMMENT_REGEXP' => array(1 => '/\(\*(?:(?R)|.)+?\*\)/s'), 49 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, 50 'QUOTEMARKS' => array('"'), 51 'ESCAPE_CHAR' => '\\', 52 'NUMBERS' => 53 array( 54 /* integer dec */ 55 0 => GESHI_NUMBER_INT_BASIC, 56 /* integer hex */ 57 1 => GESHI_NUMBER_HEX_PREFIX, 58 /* real */ 59 2 => GESHI_NUMBER_FLT_SCI_ZERO, 60 /* word dec */ 61 3 => '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])0w[0-9]+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)', 62 /* word hex */ 63 4 => '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])0wx[0-9a-fA-F]+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)' 64 ), 65 'KEYWORDS' => array( 66 /* main SML keywords */ 67 1 => array( 68 /* deprecated: SML90 */ 69 'abstype', 70 71 'and', 'andalso', 'as', 'case', 'datatype', 'else', 72 'end', 'exception', 'fn', 'fun', 'functor', 73 'if', 'in', 'infix', 'infixr', 'let', 'local', 'nonfix', 74 'of', 'op', 'open', 'orelse', 75 'rec', 'raise', 'sharing', 'sig', 'signature', 'struct', 'structure', 'then', 76 'type', 'val', 'while', 'with', 'withtype' 77 ), 78 /* Top-level type and constructors */ 79 2 => array( 80 'unit', 'int', 'word', 'real', 'char', 'string', 'substring', 'exn', 81 'array', 'vector', 'bool', 'option', 82 'list' 83 ), 84 /* standard structures/signatures/functors provided by Basis library */ 85 3 => array( 86 'ARRAY', 'Array', 'Array2', 'ARRAY2', 'ArraySlice', 'ARRAY_SLICE', 87 'BinIO', 'BIT_FLAGS', 'Bool', 'BOOL', 'Byte', 'CHAR', 'Char', 88 'CommandLine', 'Date', 'General', 'GenericSock', 'IEEEReal', 'IMPERATIVE_IO', 89 'ImperativeIO', 'INetSock', 'INTEGER', 'Int', 'IntInf', 'IO', 'List', 'ListPair', 90 'MATH', 'MONO_ARRAY', 'MONO_ARRAY2', 'MONO_ARRAY_SLICE', 'MONO_VECTOR', 91 'MONO_VECTOR_SLICE', 'NetHostDB', 'NetProtDB', 'NetServDB', 'Option', 92 'OS', 'OS.FileSys', 'OS.IO', 'OS.Path', 'OS.Process', 'PACK_REAL', 'PACK_WORD', 93 'Posix', 'Posix.Error', 'Posix.FileSys', 'Posix.IO', 'Posix.ProcEnv', 'Posix.Process', 94 'Posix.Signal', 'Posix.SysDB', 'Posix.TTY', 'PRIM_IO', 'PrimIO', 'REAL', 'Real', 'Socket', 95 'STREAM_IO', 'StreamIO', 'STRING', 'String', 'StringCvt', 'SUBSTRING', 'Substring', 'TEXT', 'TEXT_IO', 96 'TEXT_STREAM_IO', 'Time', 'Timer', 'Unix', 'UnixSock', 'VECTOR', 'Vector', 'VECTOR_SLICE', 97 'Windows', 'WORD', 'Word' 98 ), 99 /* Top-level value identifiers / constructors */ 100 4 => array( 101 'app', 'before', 'ceil', 'chr', 'concat', 'exnMessage', 'exnName', 'explode', 102 'floor', 'foldl', 'foldr', 'getOpt', 'hd', 'ignore', 'implode', 'isSome', 'length', 'map', 'not', 103 'null', 'o', 'ord', 'print', 'rev', 'round', 'size', 'str', 'tl', 'trunc', 104 'use', 'valOf', 105 /* constructors */ 106 'ref', 'true', 'false', 'NONE', 'SOME', 'LESS', 'EQUAL', 'GREATER', 'nil', 107 /* overloaded identifiers */ 108 'div', 'mod', 'abs' 109 ), 110 /* standard exceptions */ 111 5 => array ( 112 'Bind', 'Chr', 'Div', 'Domain', 'Empty', 'Fail', 'Match', 'Overflow', 'Size', 'Span', 'Subscript' 113 ), 114 /* implementation dependent keyword (not be sorted) */ 115 6 => array ( 116 /** SML/NJ */ 117 /* functor signature > http://www.smlnj.org/doc/features.html */ 118 'funsig', 119 /* lazy evaluation */ 120 'lazy', 121 /** SML# */ 122 /* binding to C function */ 123 '_import', 124 /* read other source */ 125 '_require', 126 /* export aggregated interface files */ 127 'include', 128 /* integrated sql */ 129 '_sqlserver', '_sql', 'from', 'where', '_sqleval', '_sqlexec', 130 'select', 'insert', 'update', 'begin', 'commit', 'rollback', 131 'values', 'delete' 132 ) 133 ), 134 /* highlighting symbols */ 135 'SYMBOLS' => array( 136 0 => array('=', ':', ':>', '=>', '(', ')', '|', '_', '==', ';', '.'), 137 1 => array('!', ':=', '@', '^'), 138 2 => array('[', ']', '::', '{', '}'), 139 /* overloaded identifiers */ 140 3 => array('+', '-', '*', '/', '~', '<', '>', '<=', '>=') 141 ), 142 'CASE_SENSITIVE' => array( 143 GESHI_COMMENTS => false, 144 1 => true, /* keywords */ 145 2 => true, /* top level types */ 146 3 => true, /* structures */ 147 4 => true, /* top level identifiers */ 148 5 => true, /* top level exceptions */ 149 6 => true /* implementation dependent keyword */ 150 ), 151 'STYLES' => array( 152 'KEYWORDS' => array( 153 1 => 'color: #557cde; font-weight: bold;', 154 2 => 'color: #8dda4a; font-weight: bold;', 155 3 => 'color: #0066cc; font-weight: bold;', 156 4 => 'color: #5c8cbb;', 157 5 => 'color: #f33e64; font-weight: bold;', 158 6 => 'color: #f33e64;' 159 ), 160 'COMMENTS' => array( 161 'MULTI' => 'color: #5d478b; font-style: italic;', /* light purple */ 162 1 => 'color: #5d478b; font-style: italic;' /* light purple */ 163 ), 164 'ESCAPE_CHAR' => array( 165 ), 166 'BRACKETS' => array( 167 0 => 'color: #79c200;' 168 ), 169 'STRINGS' => array( 170 0 => 'color: #488614;' 171 ), 172 'NUMBERS' => array( 173 0 => 'color: #fb7600;', 174 1 => 'color: #fb7600;', 175 2 => 'color: #fb7600;', 176 3 => 'color: #fb7600;', 177 4 => 'color: #fb7600;' 178 ), 179 'METHODS' => array( 180 1 => 'color: #0066cc;' 181 ), 182 'REGEXPS' => array( 183 1 => 'font-style:italic; color:#9f7eff;', 184 2 => 'font-weight:bold; color:#8dda4a;' 185 ), 186 'SYMBOLS' => array( 187 0 => 'color: #ff4bcf;', 188 1 => 'color: #ff4bcf; font-weight: bold;', // pink 189 2 => 'color: #90f963;', // orange 190 3 => 'color: #fa5bf8;' 191 ), 192 'SCRIPT' => array( 193 ) 194 ), 195 'URLS' => array( 196 1 => '', 197 2 => 'http://www.standardml.org/Basis/top-level-chapter.html', 198 3 => '', 199 4 => '', 200 5 => 'http://www.standardml.org/Basis/top-level-chapter.html#section:2', 201 6 => '' 202 ), 203 'OOLANG' => true, 204 'OBJECT_SPLITTERS' => array( 205 1 => '.' 206 ), 207 'REGEXPS' => array( 208 1 => '(?<!\w)#\w+', /* record field access */ 209 2 => '(?:(?<![0-9a-zA-Z]))\'[a-z]+' /* type variable */ 210 ), 211 'STRICT_MODE_APPLIES' => GESHI_NEVER, 212 'SCRIPT_DELIMITERS' => array( 213 ), 214 'HIGHLIGHT_STRICT_BLOCK' => array( 215 ) 216 );
title
Description
Body
title
Description
Body
title
Description
Body
title
Body