source: documentation/trunk/packages/dokuwiki-2011-05-25a/inc/geshi/j.php@ 25027

Last change on this file since 25027 was 25027, checked in by jmt12, 12 years ago

Adding the packages directory, and within it a configured version of dokuwiki all ready to run

File size: 8.7 KB
Line 
1<?php
2/*************************************************************************************
3 * j.php
4 * --------
5 * Author: Ric Sherlock ([email protected])
6 * Copyright: (c) 2009 Ric Sherlock
7 * Release Version: 1.0.8.8
8 * Date Started: 2009/11/10
9 *
10 * J language file for GeSHi.
11 *
12 * CHANGES
13 * -------
14 * 2010/03/01 (1.0.8.8)
15 * - Add support for label_xyz. and goto_xyz.
16 * - Fix highlighting of for_i.
17 * - Use alternative method for highlighting for_xyz. construct
18 * 2010/02/14 (1.0.8.7)
19 * - Add support for primitives
20 * 2010/01/12 (1.0.2)
21 * - Use HARDQUOTE for strings
22 * - Highlight open quotes/incomplete strings
23 * - Highlight multi-line comments that use Note
24 * - Refinements for NUMBERS and Argument keywords
25 * - Highlight infinity and neg. infinity using REGEXPS
26 * - Highlight "for_myvar." style Control keyword using REGEXPS
27 * 2009/12/14 (1.0.1)
28 * - Regex for NUMBERS, SYMBOLS for () and turn off BRACKETS
29 * 2009/11/12 (1.0.0)
30 * - First Release
31 *
32 *
33 * TODO (updated 2010/01/27)
34 * -------------------------
35 * * combine keyword categories by using conditional regex statement in PARSER CONTROL?
36 *************************************************************************************
37 *
38 * This file is part of GeSHi.
39 *
40 * GeSHi is free software; you can redistribute it and/or modify
41 * it under the terms of the GNU General Public License as published by
42 * the Free Software Foundation; either version 2 of the License, or
43 * (at your option) any later version.
44 *
45 * GeSHi is distributed in the hope that it will be useful,
46 * but WITHOUT ANY WARRANTY; without even the implied warranty of
47 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48 * GNU General Public License for more details.
49 *
50 * You should have received a copy of the GNU General Public License
51 * along with GeSHi; if not, write to the Free Software
52 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
53 *
54 ************************************************************************************/
55
56$language_data = array (
57 'LANG_NAME' => 'J',
58 'COMMENT_SINGLE' => array(),
59 'COMMENT_MULTI' => array(),
60 'COMMENT_REGEXP' => array(
61 1 => '/(?<!\w)NB\..*?$/m', //singleline comments NB.
62 2 => '/(?<=\bNote\b).*?$\s+\)(?:(?!\n)\s)*$/sm', //multiline comments in Note
63 3 => "/'[^']*?$/m" //incomplete strings/open quotes
64 ),
65 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
66 'QUOTEMARKS' => array(),
67 'ESCAPE_CHAR' => '',
68 'HARDQUOTE' => array("'", "'"),
69 'HARDESCAPE' => array("'"),
70 'HARDCHAR' => "'",
71 'NUMBERS' => array(
72 //Some instances of infinity are not correctly handled by GeSHi NUMBERS currently
73 //There are two solutions labelled "infinity Method A" and "infinity Method B"
74 //infinity Method B - requires following adjustment to line 3349 of geshi.php
75 // preg_match('#\d#' becomes preg_match('#[\d_]#'
76 0 => '\b(?:_?\d+(?:\.\d+)?(?:x|[bejprx]_?[\da-z]+(?:\.[\da-z]+)?)?)(?![\w\.\:])', //infinity Method A
77 //0 => '\b(?:_?\d+(?:\.\d+)?(?:x|[bejprx]_?[\da-z]+(?:\.[\da-z]+)?)?|__?)(?![\w\.\:])', //infinity Method B
78 ),
79 'KEYWORDS' => array(
80 //Control words
81 1 => array(
82 'assert.', 'break.', 'case.', 'catch.', 'catcht.', 'continue.', 'do.',
83 'else.', 'elseif.', 'end.', 'fcase.', 'for.', 'goto.', 'if.', 'label.',
84 'return.', 'select.', 'throw.', 'trap.', 'try.', 'while.', 'whilst.'
85 ),
86 //Arguments
87 2 => array(
88 'm', 'n', 'u', 'v', 'x', 'y'
89 ),
90/*
91Commented out for now due to conflicts with Lang Check
92 //Primitives beginning with a symbol (except . or :)
93 6 => array(
94 '=', '&lt;', '&lt;.', '&lt;:', //verbs
95 '_:','&gt;', '&gt;.', '&gt;:',
96 '+', '+.', '+:', '*', '*.', '*:', '-', '-.', '-:', '%', '%.', '%:',
97 '^', '^.', '$', '$.', '$:', '~.', '~:', '\|', '|.', '|:',
98 ',', ',.', ',:', ';', ';:', '#', '#.', '#:', '!', '/:', '\:',
99 '[', '[:', ']', '{', '{.', '{:', '{::', '}.', '}:',
100 '&quot;.', '&quot;:', '?', '?.',
101 '~', '\/;', '\\', '/.', '\\.', '}', //adverbs
102 '^:', ';.', '!.', '!:', //conj
103 '&quot;', '`', '`:', '@', '@.', '@:',
104 '&amp;', '&amp;.', '&amp;:', '&amp;.:',
105 '_.', //nouns
106 '=.', '=:', //other
107 ),
108 //Primitives beginning with a letter or number
109 7 => array(
110 'A.', 'c.', 'C.', 'e.', 'E.', //verbs
111 'i.', 'i:', 'I.', 'j.', 'L.', 'o.',
112 'p.', 'p..', 'p:', 'q:', 'r.', 's:', 'u:', 'x:',
113 '_9:', '_8:', '_7:', '_6:', '_5:', '_4:', '_3:', '_2:', '_1:',
114 '0:', '1:', '2:', '3:', '4:', '5:', '6:', '7:', '8:', '9:',
115 'b.', 'f.', 'M.', 't.', 't:', //adverbs
116 'd.', 'D.', 'D:', 'H.', 'L:', 'S:', 'T.', //conj
117 'a.', 'a:', //nouns
118 ),
119 //Primitives beginning with symbol . or :
120 8 => array(
121 '..', '.:', '.', ':.', '::', ':', //conj
122 ),
123*/
124 ),
125 'SYMBOLS' => array(
126 //Punctuation
127 0 => array(
128 '(', ')'
129 )
130 ),
131 'CASE_SENSITIVE' => array(
132 GESHI_COMMENTS => false,
133 1 => true,
134 2 => true,
135// 6 => true,
136// 7 => true,
137// 8 => true,
138 ),
139 'STYLES' => array(
140 'KEYWORDS' => array(
141 1 => 'color: #0000ff; font-weight: bold;',
142 2 => 'color: #0000cc; font-weight: bold;',
143// 6 => 'color: #000000; font-weight: bold;',
144// 7 => 'color: #000000; font-weight: bold;',
145// 8 => 'color: #000000; font-weight: bold;',
146 ),
147 'COMMENTS' => array(
148 1 => 'color: #666666; font-style: italic;',
149 2 => 'color: #666666; font-style: italic; font-weight: bold;',
150 3 => 'color: #ff00ff; ', //open quote
151 'MULTI' => 'color: #666666; font-style: italic;'
152 ),
153 'ESCAPE_CHAR' => array(
154 'HARD' => 'font-weight: bold;',
155 0 => '',
156 ),
157 'BRACKETS' => array(
158 0 => 'color: #009900;'
159 ),
160 'STRINGS' => array(
161 'HARD' => 'color: #ff0000;',
162 0 => 'color: #ff0000;',
163 ),
164 'NUMBERS' => array(
165 0 => 'color: #009999; font-weight: bold;'
166 ),
167 'METHODS' => array(
168 ),
169 'SYMBOLS' => array(
170 0 => 'color: #009900; font-weight: bold;'
171 ),
172 'REGEXPS' => array(
173 0 => 'color: #0000ff; font-weight: bold;', //for_xyz. - same as kw1
174 1 => 'color: #009999; font-weight: bold;' //infinity - same as nu0
175 ),
176 'SCRIPT' => array(
177 )
178 ),
179 'URLS' => array(
180 1 => '', //'http://www.jsoftware.com/help/dictionary/ctrl.htm',
181 2 => '',
182// 6 => '', //'http://www.jsoftware.com/jwiki/Vocabulary',
183// 7 => '', //'http://www.jsoftware.com/jwiki/Vocabulary',
184// 8 => '', //'http://www.jsoftware.com/jwiki/Vocabulary',
185 ),
186 'OOLANG' => false,
187 'OBJECT_SPLITTERS' => array(
188 ),
189 'REGEXPS' => array(
190 0 => '\b(for|goto|label)_[a-zA-Z]\w*\.', //for_xyz. - should be kw1
191 1 => '\b__?(?![\w\.\:])' //infinity - should be nu0
192 ),
193 'STRICT_MODE_APPLIES' => GESHI_NEVER,
194 'SCRIPT_DELIMITERS' => array(
195 ),
196 'HIGHLIGHT_STRICT_BLOCK' => array(
197 ),
198 'PARSER_CONTROL' => array(
199 'ENABLE_FLAGS' => array(
200 'BRACKETS' => GESHI_NEVER,
201 ),
202 'KEYWORDS' => array(
203 //Control words
204 2 => array(
205 'DISALLOWED_BEFORE' => '(?<!\w)',
206 'DISALLOWED_AFTER' => '(?![\w\.\:])',
207 ),
208 //Primtives starting with a symbol (except . or :)
209 6 => array(
210 'DISALLOWED_BEFORE' => '(?!K)', // effect should be to allow anything
211 'DISALLOWED_AFTER' => '(?=.*)',
212 ),
213 //Primtives starting with a letter
214 7 => array(
215 'DISALLOWED_BEFORE' => '(?<!\w)',
216 'DISALLOWED_AFTER' => '(?=.*)',
217 ),
218 //Primtives starting with symbol . or :
219 8 => array(
220 'DISALLOWED_BEFORE' => '(?<=\s)',
221 'DISALLOWED_AFTER' => '(?=.*)',
222 ),
223 )
224 )
225);
226
227?>
Note: See TracBrowser for help on using the repository browser.