1 | <?php |
---|
2 | /************************************************************************************* |
---|
3 | * c.php |
---|
4 | * ----- |
---|
5 | * Author: Benny Baumann (BenBE@geshi.org) |
---|
6 | * Copyright: (c) 2014 Benny Baumann (http://qbnz.com/highlighter/) |
---|
7 | * Release Version: 1.0.9.0 |
---|
8 | * Date Started: 2014/08/10 |
---|
9 | * |
---|
10 | * PostScript language file for GeSHi. |
---|
11 | * |
---|
12 | * CHANGES |
---|
13 | * ------- |
---|
14 | * 2014/08/10 (1.0.8.13) |
---|
15 | * - First Release |
---|
16 | * |
---|
17 | * TODO (updated 2014/08/10) |
---|
18 | * ------------------------- |
---|
19 | * - Get a list of inbuilt functions to add |
---|
20 | * |
---|
21 | ************************************************************************************* |
---|
22 | * |
---|
23 | * This file is part of GeSHi. |
---|
24 | * |
---|
25 | * GeSHi is free software; you can redistribute it and/or modify |
---|
26 | * it under the terms of the GNU General Public License as published by |
---|
27 | * the Free Software Foundation; either version 2 of the License, or |
---|
28 | * (at your option) any later version. |
---|
29 | * |
---|
30 | * GeSHi is distributed in the hope that it will be useful, |
---|
31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
33 | * GNU General Public License for more details. |
---|
34 | * |
---|
35 | * You should have received a copy of the GNU General Public License |
---|
36 | * along with GeSHi; if not, write to the Free Software |
---|
37 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
38 | * |
---|
39 | ************************************************************************************/ |
---|
40 | |
---|
41 | $language_data = array ( |
---|
42 | 'LANG_NAME' => 'PostScript', |
---|
43 | 'COMMENT_SINGLE' => array(0 => '%'), |
---|
44 | 'COMMENT_MULTI' => array(), //array('/*' => '*/'), |
---|
45 | 'COMMENT_REGEXP' => array( |
---|
46 | // Strings |
---|
47 | 1 => "/\((?:\\\\[0-7]{3}|\\\\.|(?R)|[^)])*\)/s", |
---|
48 | // Hex Strings |
---|
49 | 2 => "/<(?!<)[0-9a-f\s]*>/si", |
---|
50 | // ASCII-85 Strings |
---|
51 | 3 => "/<~.*~>/si", |
---|
52 | ), |
---|
53 | 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, |
---|
54 | 'QUOTEMARKS' => array("'", '"'), |
---|
55 | 'ESCAPE_CHAR' => '', |
---|
56 | 'ESCAPE_REGEXP' => array( |
---|
57 | ), |
---|
58 | 'NUMBERS' => array( |
---|
59 | 0 => GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_FLT_NONSCI | GESHI_NUMBER_FLT_NONSCI_F | GESHI_NUMBER_FLT_SCI_SHORT | GESHI_NUMBER_FLT_SCI_ZERO, |
---|
60 | 1 => "\d+#[0-9a-zA-Z]+" |
---|
61 | ), |
---|
62 | 'KEYWORDS' => array( |
---|
63 | 1 => array( |
---|
64 | 'countexecstack', 'def', 'dup', 'exch', 'exec', 'execstack', 'exit', |
---|
65 | 'for', 'if', 'ifelse', 'loop', 'pop', 'repeat', |
---|
66 | |
---|
67 | 'abs', 'add', 'atan', 'ceiling', 'cos', 'div', 'exp', 'floor', |
---|
68 | 'idiv', 'ln', 'log', 'mul', 'mod', 'neg', 'rand', 'round', 'rrand', |
---|
69 | 'sin', 'sqrt', 'srand', 'sub', 'truncate', |
---|
70 | |
---|
71 | 'and', 'bitshift', 'eq', 'ge', 'gt', 'le', 'lt', 'ne', 'not', 'or', 'xor', |
---|
72 | ), |
---|
73 | 2 => array( |
---|
74 | 'false', 'null', 'true', 'version' |
---|
75 | ), |
---|
76 | 3 => array( |
---|
77 | 'quit', 'start', 'stop', 'stopped', |
---|
78 | |
---|
79 | 'clear', 'cleartomark', 'copy', 'count', 'counttomark', 'index', 'roll', |
---|
80 | |
---|
81 | 'aload', 'astore', 'begin', 'countdictstack', 'currentdict', |
---|
82 | 'dictstack', 'end', 'errordict', 'forall', 'get', |
---|
83 | 'getinterval', 'known', 'length', 'load', 'maxlength', 'put', |
---|
84 | 'putinterval', 'store', 'systemdict', 'userdict', 'where', |
---|
85 | |
---|
86 | 'anchorsearch', 'search', 'token', |
---|
87 | |
---|
88 | 'cvi', 'cvlit', 'cvn', 'cvr', 'cvrs', 'cvs', 'cvx', 'executeonly', |
---|
89 | 'noaccess', 'rcheck', 'readonly', 'type', 'wcheck', 'xcheck', |
---|
90 | |
---|
91 | 'bytesavailable', 'closefile', 'currentfile', 'echo', 'file', |
---|
92 | 'flush', 'flushfile', 'print', 'prompt', 'pstack', 'read', |
---|
93 | 'readhexstring', 'readline', 'readstring', 'resetfile', 'restore', |
---|
94 | 'run', 'save', 'stack', 'status', 'vmstatus', 'write', |
---|
95 | 'writehexstring', 'writestring', |
---|
96 | |
---|
97 | 'bind', 'usertime', |
---|
98 | |
---|
99 | 'currentdash', 'currentflat', 'currentgray', 'currenthsbcolor', |
---|
100 | 'currentlinecap', 'currentlinejoin', 'currentlinewidth', |
---|
101 | 'currentmiterlimit', 'currentrgbcolor', 'currentscreen', |
---|
102 | 'currenttransfer', 'grestore', 'grestoreall', 'gsave', |
---|
103 | 'initgraphics', 'proc', 'setdash', 'setflat', 'setgray', |
---|
104 | 'sethsbcolor', 'setlinecap', 'setlinejoin', 'setlinewidth', |
---|
105 | 'setmiterlimit', 'setrgbcolor', 'setscreen', 'settransfer', |
---|
106 | |
---|
107 | 'concat', 'concatmatrix', 'currentmatrix', 'defaultmatrix', |
---|
108 | 'dtransform', 'identmatrix', 'idtransform', 'initmatrix', |
---|
109 | 'invertmatrix', 'itransform', 'rotate', 'scale', 'setmatrix', |
---|
110 | 'transform', 'translate', |
---|
111 | |
---|
112 | 'arc', 'arcn', 'arcto', 'charpath', 'clip', 'clippath', 'closepath', |
---|
113 | 'currentpoint', 'curveto', 'eoclip', 'eofill', 'erasepage', 'fill', |
---|
114 | 'flattenpath', 'image', 'imagemask', 'initclip', 'lineto', 'moveto', |
---|
115 | 'newpath', 'pathbbox', 'pathforall', 'rcurveto', 'reversepath', |
---|
116 | 'rlineto', 'rmoveto', 'stroke', 'strokepath', |
---|
117 | |
---|
118 | 'banddevice', 'copypage', 'framedevice', 'nulldevice', 'renderbands', |
---|
119 | 'showpage', |
---|
120 | |
---|
121 | 'ashow', 'awidthshow', 'currentfont', 'definefont', 'findfont', |
---|
122 | 'fontdict', 'kshow', 'makefont', 'scalefont', 'setfont', 'show', |
---|
123 | 'stringwidth', 'widthshow', 'FontDirectory', 'StandardEncoding', |
---|
124 | |
---|
125 | 'cachestatus', 'setcachedevice', 'setcachelimit', 'setcharwidth', |
---|
126 | |
---|
127 | 'dictfull', 'dictstackoverflow', 'dictstackunderflow', |
---|
128 | 'execstackoverflow', 'handleerror', 'interrupt', 'invalidaccess', |
---|
129 | 'invalidexit', 'invalidfileaccess', 'invalidfont', 'invalidrestore', |
---|
130 | 'ioerror', 'limitcheck', 'nocurrentpoint', 'rangecheck', |
---|
131 | 'stackoverflow', 'stackunderflow', 'syntaxerror', 'timeout', |
---|
132 | 'typecheck', 'undefined', 'undefinedfilename', 'undefinedresult', |
---|
133 | 'unmatchedmark', 'unregistered', 'VMerror' |
---|
134 | ), |
---|
135 | 4 => array( |
---|
136 | 'array', 'dict', 'mark', 'matrix', 'string' |
---|
137 | ), |
---|
138 | ), |
---|
139 | 'SYMBOLS' => array( |
---|
140 | 0 => array('==', '=', '/', '//'), |
---|
141 | 1 => array('[', ']'), |
---|
142 | 2 => array('{', '}'), |
---|
143 | 3 => array('<<', '>>') |
---|
144 | ), |
---|
145 | 'CASE_SENSITIVE' => array( |
---|
146 | GESHI_COMMENTS => false, |
---|
147 | 1 => true, |
---|
148 | 2 => true, |
---|
149 | 3 => true, |
---|
150 | 4 => true, |
---|
151 | ), |
---|
152 | 'STYLES' => array( |
---|
153 | 'KEYWORDS' => array( |
---|
154 | 1 => 'color: #000066; font-weight: bold;', |
---|
155 | 2 => 'color: #0000ff; font-weight: bold;', |
---|
156 | 3 => 'color: #000000; font-weight: bold;', |
---|
157 | 4 => 'color: #993333; font-weight: bold;' |
---|
158 | ), |
---|
159 | 'COMMENTS' => array( |
---|
160 | 0 => 'color: #333333; font-style: italic;', |
---|
161 | 1 => 'color: #339933;', |
---|
162 | 2 => 'color: #006600;', |
---|
163 | 3 => 'color: #666666;', |
---|
164 | 'MULTI' => 'color: #808080; font-style: italic;' |
---|
165 | ), |
---|
166 | 'ESCAPE_CHAR' => array( |
---|
167 | 'HARD' => '' |
---|
168 | ), |
---|
169 | 'BRACKETS' => array( |
---|
170 | 0 => 'color: #009900;' |
---|
171 | ), |
---|
172 | 'STRINGS' => array( |
---|
173 | 0 => 'color: #ff0000;' |
---|
174 | ), |
---|
175 | 'NUMBERS' => array( |
---|
176 | 0 => 'color: #0000dd;', |
---|
177 | GESHI_NUMBER_BIN_PREFIX_0B => 'color: #208080;', |
---|
178 | GESHI_NUMBER_OCT_PREFIX => 'color: #208080;', |
---|
179 | GESHI_NUMBER_HEX_PREFIX => 'color: #208080;', |
---|
180 | GESHI_NUMBER_FLT_SCI_SHORT => 'color:#800080;', |
---|
181 | GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;', |
---|
182 | GESHI_NUMBER_FLT_NONSCI_F => 'color:#800080;', |
---|
183 | GESHI_NUMBER_FLT_NONSCI => 'color:#800080;' |
---|
184 | ), |
---|
185 | 'METHODS' => array( |
---|
186 | ), |
---|
187 | 'SYMBOLS' => array( |
---|
188 | 0 => 'color: #339933;', |
---|
189 | 1 => 'color: #009900;', |
---|
190 | 2 => 'color: #009900;', |
---|
191 | 3 => 'color: #009900;' |
---|
192 | ), |
---|
193 | 'REGEXPS' => array( |
---|
194 | 1 => 'color: #006600;' |
---|
195 | ), |
---|
196 | 'SCRIPT' => array( |
---|
197 | ) |
---|
198 | ), |
---|
199 | 'URLS' => array( |
---|
200 | 1 => '', |
---|
201 | 2 => '', |
---|
202 | 3 => '', |
---|
203 | 4 => '' |
---|
204 | ), |
---|
205 | 'OOLANG' => false, |
---|
206 | 'OBJECT_SPLITTERS' => array( |
---|
207 | ), |
---|
208 | 'REGEXPS' => array( |
---|
209 | 1 => "#(?<=\\x2F)[\\w-]+#" |
---|
210 | ), |
---|
211 | 'STRICT_MODE_APPLIES' => GESHI_NEVER, |
---|
212 | 'SCRIPT_DELIMITERS' => array( |
---|
213 | ), |
---|
214 | 'HIGHLIGHT_STRICT_BLOCK' => array( |
---|
215 | ), |
---|
216 | 'TAB_WIDTH' => 4 |
---|
217 | ); |
---|