1 | <?php
|
---|
2 | /*************************************************************************************
|
---|
3 | * logtalk.php
|
---|
4 | * -----------
|
---|
5 | *
|
---|
6 | * Author: Paulo Moura ([email protected])
|
---|
7 | * Copyright: (c) 2009 Paulo Moura (http://logtalk.org/)
|
---|
8 | * Release Version: 1.0.8.8
|
---|
9 | * Date Started: 2009/10/24
|
---|
10 | *
|
---|
11 | * Logtalk language file for GeSHi.
|
---|
12 | *
|
---|
13 | * CHANGES
|
---|
14 | * -------
|
---|
15 | * 2009/10/28 (1.0.0)
|
---|
16 | * - First Release
|
---|
17 | *
|
---|
18 | *************************************************************************************
|
---|
19 | *
|
---|
20 | * This file is part of GeSHi.
|
---|
21 | *
|
---|
22 | * GeSHi is free software; you can redistribute it and/or modify
|
---|
23 | * it under the terms of the GNU General Public License as published by
|
---|
24 | * the Free Software Foundation; either version 2 of the License, or
|
---|
25 | * (at your option) any later version.
|
---|
26 | *
|
---|
27 | * GeSHi is distributed in the hope that it will be useful,
|
---|
28 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
29 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
30 | * GNU General Public License for more details.
|
---|
31 | *
|
---|
32 | * You should have received a copy of the GNU General Public License
|
---|
33 | * along with GeSHi; if not, write to the Free Software
|
---|
34 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
35 | *
|
---|
36 | ************************************************************************************/
|
---|
37 |
|
---|
38 | $language_data = array(
|
---|
39 | 'LANG_NAME' => 'Logtalk',
|
---|
40 | 'COMMENT_SINGLE' => array(1 => '%'),
|
---|
41 | 'COMMENT_MULTI' => array('/*' => '*/'),
|
---|
42 | 'COMMENT_REGEXP' => array(2 => "/0'./sim"),
|
---|
43 | 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
|
---|
44 | 'QUOTEMARKS' => array("'"),
|
---|
45 | 'HARDQUOTE' => array('"', '"'),
|
---|
46 | 'HARDESCAPE' => array(),
|
---|
47 | 'ESCAPE_CHAR' => '',
|
---|
48 | 'ESCAPE_REGEXP' => array(
|
---|
49 | //Simple Single Char Escapes
|
---|
50 | 1 => "#\\\\[\\\\abfnrtv\'\"?\n]#i",
|
---|
51 | //Hexadecimal Char Specs
|
---|
52 | 2 => "#\\\\x[\da-fA-F]+\\\\#",
|
---|
53 | //Octal Char Specs
|
---|
54 | 3 => "#\\\\[0-7]+\\\\#"
|
---|
55 | ),
|
---|
56 | 'NUMBERS' =>
|
---|
57 | GESHI_NUMBER_INT_BASIC |
|
---|
58 | GESHI_NUMBER_BIN_PREFIX_0B |
|
---|
59 | GESHI_NUMBER_OCT_PREFIX_0O |
|
---|
60 | GESHI_NUMBER_HEX_PREFIX |
|
---|
61 | GESHI_NUMBER_FLT_NONSCI |
|
---|
62 | GESHI_NUMBER_FLT_SCI_ZERO,
|
---|
63 | 'KEYWORDS' => array(
|
---|
64 | // Directives (with arguments)
|
---|
65 | 1 => array(
|
---|
66 | // file directives
|
---|
67 | 'encoding', 'ensure_loaded',
|
---|
68 | // flag directives
|
---|
69 | 'set_logtalk_flag', 'set_prolog_flag',
|
---|
70 | // entity opening directives
|
---|
71 | 'category', 'object', 'protocol',
|
---|
72 | // predicate scope directives
|
---|
73 | 'private', 'protected', 'public',
|
---|
74 | // conditional compilation directives
|
---|
75 | 'elif', 'if',
|
---|
76 | // entity directives
|
---|
77 | 'calls', 'initialization', 'op', 'uses',
|
---|
78 | // predicate directives
|
---|
79 | 'alias', 'discontiguous', 'dynamic', 'mode', 'info', 'meta_predicate', 'multifile', 'synchronized',
|
---|
80 | // module directives
|
---|
81 | 'export', 'module', 'reexport', 'use_module'
|
---|
82 | ),
|
---|
83 | // Directives (no arguments)
|
---|
84 | 2 => array(
|
---|
85 | // entity directives
|
---|
86 | 'dynamic',
|
---|
87 | // multi-threading directives
|
---|
88 | 'synchronized', 'threaded',
|
---|
89 | // entity closing directives
|
---|
90 | 'end_category', 'end_object', 'end_protocol',
|
---|
91 | // conditional compilation directives
|
---|
92 | 'else', 'endif'
|
---|
93 | ),
|
---|
94 | // Entity relations
|
---|
95 | 3 => array(
|
---|
96 | 'complements', 'extends', 'imports', 'implements','instantiates', 'specializes'
|
---|
97 | ),
|
---|
98 | // Built-in predicates (with arguments)
|
---|
99 | 4 => array(
|
---|
100 | // event handlers
|
---|
101 | 'after', 'before',
|
---|
102 | // execution-context methods
|
---|
103 | 'parameter', 'self', 'sender', 'this',
|
---|
104 | // predicate reflection
|
---|
105 | 'current_predicate', 'predicate_property',
|
---|
106 | // DCGs and term expansion
|
---|
107 | 'expand_goal', 'expand_term', 'goal_expansion', 'phrase', 'term_expansion',
|
---|
108 | // entity
|
---|
109 | 'abolish_category', 'abolish_object', 'abolish_protocol',
|
---|
110 | 'create_category', 'create_object', 'create_protocol',
|
---|
111 | 'current_category', 'current_object', 'current_protocol',
|
---|
112 | 'category_property', 'object_property', 'protocol_property',
|
---|
113 | // entity relations
|
---|
114 | 'complements_object',
|
---|
115 | 'extends_category', 'extends_object', 'extends_protocol',
|
---|
116 | 'implements_protocol', 'imports_category',
|
---|
117 | 'instantiates_class', 'specializes_class',
|
---|
118 | // events
|
---|
119 | 'abolish_events', 'current_event', 'define_events',
|
---|
120 | // flags
|
---|
121 | 'current_logtalk_flag', 'set_logtalk_flag',
|
---|
122 | 'current_prolog_flag', 'set_prolog_flag',
|
---|
123 | // compiling, loading, and library path
|
---|
124 | 'logtalk_compile', 'logtalk_library_path', 'logtalk_load',
|
---|
125 | // database
|
---|
126 | 'abolish', 'asserta', 'assertz', 'clause', 'retract', 'retractall',
|
---|
127 | // control
|
---|
128 | 'call', 'catch', 'once', 'throw',
|
---|
129 | // all solutions predicates
|
---|
130 | 'bagof', 'findall', 'forall', 'setof',
|
---|
131 | // multi-threading meta-predicates
|
---|
132 | 'threaded',
|
---|
133 | 'threaded_call', 'threaded_once', 'threaded_ignore', 'threaded_exit', 'threaded_peek',
|
---|
134 | 'threaded_wait', 'threaded_notify',
|
---|
135 | // term unification
|
---|
136 | 'unify_with_occurs_check',
|
---|
137 | // atomic term processing
|
---|
138 | 'atom_chars', 'atom_codes', 'atom_concat', 'atom_length',
|
---|
139 | 'number_chars', 'number_codes',
|
---|
140 | 'char_code',
|
---|
141 | // term creation and decomposition
|
---|
142 | 'arg', 'copy_term', 'functor',
|
---|
143 | // term testing
|
---|
144 | 'atom', 'atomic', 'compound', 'float', 'integer', 'nonvar', 'number', 'sub_atom', 'var',
|
---|
145 | // stream selection and control
|
---|
146 | 'current_input', 'current_output', 'set_input', 'set_output',
|
---|
147 | 'open', 'close', 'flush_output', 'stream_property',
|
---|
148 | 'at_end_of_stream', 'set_stream_position',
|
---|
149 | // character and byte input/output predicates
|
---|
150 | 'get_byte', 'get_char', 'get_code',
|
---|
151 | 'peek_byte', 'peek_char', 'peek_code',
|
---|
152 | 'put_byte', 'put_char', 'put_code',
|
---|
153 | 'nl',
|
---|
154 | // term input/output predicates
|
---|
155 | 'current_op', 'op',
|
---|
156 | 'write', 'writeq', 'write_canonical', 'write_term',
|
---|
157 | 'read', 'read_term',
|
---|
158 | 'char_conversion', 'current_char_conversion',
|
---|
159 | //
|
---|
160 | 'halt'
|
---|
161 | ),
|
---|
162 | // Built-in predicates (no arguments)
|
---|
163 | 5 => array(
|
---|
164 | // control
|
---|
165 | 'fail', 'repeat', 'true',
|
---|
166 | // character and byte input/output predicates
|
---|
167 | 'nl',
|
---|
168 | // implementation defined hooks functions
|
---|
169 | 'halt',
|
---|
170 | // arithemtic evaluation
|
---|
171 | 'is',
|
---|
172 | // stream selection and control
|
---|
173 | 'at_end_of_stream', 'flush_output'
|
---|
174 | ),
|
---|
175 | // Evaluable functors (with arguments)
|
---|
176 | 6 => array(
|
---|
177 | 'float_integer_part', 'float_fractional_part',
|
---|
178 | 'rem', 'mod', 'abs', 'sign', 'floor', 'truncate', 'round', 'ceiling',
|
---|
179 | 'cos', 'atan', 'exp', 'log', 'sin', 'sqrt'
|
---|
180 | ),
|
---|
181 | // Evaluable functors (no arguments)
|
---|
182 | 7 => array(
|
---|
183 | 'mod', 'rem'
|
---|
184 | ),
|
---|
185 | ),
|
---|
186 | 'SYMBOLS' => array(
|
---|
187 | 0 => array(
|
---|
188 | // external call
|
---|
189 | '{', '}'
|
---|
190 | ),
|
---|
191 | 1 => array(
|
---|
192 | // arithemtic comparison
|
---|
193 | '=:=', '=\=', '<', '=<', '>=', '>',
|
---|
194 | // term comparison
|
---|
195 | '<<', '>>', '/\\', '\\/', '\\',
|
---|
196 | // bitwise functors
|
---|
197 | '==', '\==', '@<', '@=<', '@>=', '@>',
|
---|
198 | // evaluable functors
|
---|
199 | '+', '-', '*', '/', '**',
|
---|
200 | // logic and control
|
---|
201 | '!', '\\+', ';',
|
---|
202 | // message sending operators
|
---|
203 | '::', '^^', ':',
|
---|
204 | // grammar rule and conditional functors
|
---|
205 | '-->', '->',
|
---|
206 | // mode operators
|
---|
207 | '@', '?',
|
---|
208 | // term to list predicate
|
---|
209 | '=..',
|
---|
210 | // unification
|
---|
211 | '=', '\\='
|
---|
212 | ),
|
---|
213 | 2 => array(
|
---|
214 | // clause and directive functors
|
---|
215 | ':-'
|
---|
216 | )
|
---|
217 | ),
|
---|
218 | 'CASE_SENSITIVE' => array(
|
---|
219 | GESHI_COMMENTS => false,
|
---|
220 | 1 => true,
|
---|
221 | 2 => true,
|
---|
222 | 3 => true,
|
---|
223 | 4 => true,
|
---|
224 | 5 => true,
|
---|
225 | 6 => true,
|
---|
226 | 7 => true
|
---|
227 | ),
|
---|
228 | 'STYLES' => array(
|
---|
229 | 'KEYWORDS' => array(
|
---|
230 | 1 => 'color: #2e4dc9;',
|
---|
231 | 2 => 'color: #2e4dc9;',
|
---|
232 | 3 => 'color: #2e4dc9;',
|
---|
233 | 4 => 'color: #9d4f37;',
|
---|
234 | 5 => 'color: #9d4f37;',
|
---|
235 | 6 => 'color: #9d4f37;',
|
---|
236 | 7 => 'color: #9d4f37;'
|
---|
237 | ),
|
---|
238 | 'NUMBERS' => array(
|
---|
239 | 0 => 'color: #430000;'
|
---|
240 | ),
|
---|
241 | 'COMMENTS' => array(
|
---|
242 | 1 => 'color: #60a0b0; font-style: italic;',
|
---|
243 | 2 => 'color: #430000;',
|
---|
244 | 'MULTI' => 'color: #60a0b0; font-style: italic;'
|
---|
245 | ),
|
---|
246 | 'ESCAPE_CHAR' => array(
|
---|
247 | 0 => 'color: #9f0000; font-weight: bold;',
|
---|
248 | 1 => 'color: #9f0000; font-weight: bold;',
|
---|
249 | 2 => 'color: #9f0000; font-weight: bold;',
|
---|
250 | 3 => 'color: #9f0000; font-weight: bold;',
|
---|
251 | 'HARD' => '',
|
---|
252 | ),
|
---|
253 | 'SYMBOLS' => array(
|
---|
254 | 0 => 'color: #666666;font-weight: bold;',
|
---|
255 | 1 => 'color: #666666;font-weight: bold;',
|
---|
256 | 2 => 'color: #000000;'
|
---|
257 | ),
|
---|
258 | 'BRACKETS' => array(
|
---|
259 | 0 => 'color: #000000;'
|
---|
260 | ),
|
---|
261 | 'STRINGS' => array(
|
---|
262 | 0 => 'color: #9f0000;',
|
---|
263 | 'HARD' => 'color: #9f0000;'
|
---|
264 | ),
|
---|
265 | 'METHODS' => array(
|
---|
266 | ),
|
---|
267 | 'REGEXPS' => array(
|
---|
268 | 0 => 'color: #848484;'
|
---|
269 | ),
|
---|
270 | 'SCRIPT' => array()
|
---|
271 | ),
|
---|
272 | 'URLS' => array(
|
---|
273 | 1 => '',
|
---|
274 | 2 => '',
|
---|
275 | 3 => '',
|
---|
276 | 4 => '',
|
---|
277 | 5 => '',
|
---|
278 | 6 => '',
|
---|
279 | 7 => ''
|
---|
280 | ),
|
---|
281 | 'OOLANG' => false,
|
---|
282 | 'OBJECT_SPLITTERS' => array(
|
---|
283 | 1 => '::'
|
---|
284 | ),
|
---|
285 | 'REGEXPS' => array(
|
---|
286 | // variables
|
---|
287 | 0 => '\b(?!(?:PIPE|SEMI|REG3XP\d*)[^a-zA-Z0-9_])[A-Z_][a-zA-Z0-9_]*(?![a-zA-Z0-9_])'
|
---|
288 | ),
|
---|
289 | 'STRICT_MODE_APPLIES' => GESHI_NEVER,
|
---|
290 | 'SCRIPT_DELIMITERS' => array(),
|
---|
291 | 'HIGHLIGHT_STRICT_BLOCK' => array(),
|
---|
292 | 'TAB_WIDTH' => 4,
|
---|
293 | 'PARSER_CONTROL' => array(
|
---|
294 | 'ENABLE_FLAGS' => array(
|
---|
295 | 'BRACKETS' => GESHI_NEVER
|
---|
296 | ),
|
---|
297 | 'KEYWORDS' => array(
|
---|
298 | 1 => array(
|
---|
299 | 'DISALLOWED_BEFORE' => '(?<=:-\s)',
|
---|
300 | 'DISALLOWED_AFTER' => '(?=\()'
|
---|
301 | ),
|
---|
302 | 2 => array(
|
---|
303 | 'DISALLOWED_BEFORE' => '(?<=:-\s)',
|
---|
304 | 'DISALLOWED_AFTER' => '(?=\.)'
|
---|
305 | ),
|
---|
306 | 3 => array(
|
---|
307 | 'DISALLOWED_BEFORE' => '(?<![a-zA-Z0-9\$_\|\#>|^&\'"])',
|
---|
308 | 'DISALLOWED_AFTER' => '(?=\()'
|
---|
309 | ),
|
---|
310 | 4 => array(
|
---|
311 | 'DISALLOWED_BEFORE' => '(?<![a-zA-Z0-9\$_\|\#>|^&\'"])',
|
---|
312 | 'DISALLOWED_AFTER' => '(?=\()'
|
---|
313 | ),
|
---|
314 | 5 => array(
|
---|
315 | 'DISALLOWED_BEFORE' => '(?<![a-zA-Z0-9\$_\|\#>|^&\'"])',
|
---|
316 | 'DISALLOWED_AFTER' => '(?![a-zA-Z0-9_\|%\\-&\'"])'
|
---|
317 | ),
|
---|
318 | 6 => array(
|
---|
319 | 'DISALLOWED_BEFORE' => '(?<![a-zA-Z0-9\$_\|\#;>|^&\'"])',
|
---|
320 | 'DISALLOWED_AFTER' => '(?=\()'
|
---|
321 | ),
|
---|
322 | 7 => array(
|
---|
323 | 'DISALLOWED_BEFORE' => '(?<![a-zA-Z0-9\$_\|\#;>|^&\'"])',
|
---|
324 | 'DISALLOWED_AFTER' => '(?![a-zA-Z0-9_\|%\\-&\'"])'
|
---|
325 | )
|
---|
326 | )
|
---|
327 | ),
|
---|
328 | );
|
---|
329 |
|
---|
330 | ?> |
---|