63 if(!function_exists(
'geshi_langfile_algol68_vars')) {
64 function geshi_langfile_algol68_vars(){
65 $pre=
'(?<![0-9a-z_\.])';
66 $post=
'?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)';
71 $srad=
"Rr"; $rrad=
"[".$srad.
"]"; # either one digit, OR opt-space
in digits #
72 $sbin=
"0-1"; $rbin=
"[".$sbin.
"]"; $_bin=$rbin.
"(?:[".$sbin.
"\s]*".$rbin.
"|)";
73 $snib=
"0-3"; $rnib=
"[".$snib.
"]"; $_nib=$rnib.
"(?:[".$snib.
"\s]*".$rnib.
"|)";
74 $soct=
"0-7"; $roct=
"[".$soct.
"]"; $_oct=$roct.
"(?:[".$soct.
"\s]*".$roct.
"|)";
75 $sdec=
"0-9"; $rdec=
"[".$sdec.
"]"; $_dec=$rdec.
"(?:[".$sdec.
"\s]*".$rdec.
"|)";
76 $shex=
"0-9A-Fa-f"; $rhex=
"[".$shex.
"]"; $_hex=$rhex.
"(?:[".$shex.
"\s]*".$rhex.
"|)";
79 $prebits=$pre; $postbits=
$post;
80 $bl=
"2".$_.$rrad.$_.$_bin;
81 $bl=$bl.
"|".
"2".$_.$rrad.$_.$_bin;
82 $bl=$bl.
"|".
"4".$_.$rrad.$_.$_nib;
83 $bl=$bl.
"|".
"8".$_.$rrad.$_.$_oct;
84 $bl=$bl.
"|".
"1".$_.
"0".$_.$rrad.$_.$_dec;
85 $bl=$bl.
"|".
"1".$_.
"6".$_.$rrad.$_.$_hex;
88 $preint=$pre; $postint=
$post;
89 # for some reason ".0 e - 2" is not recognised, but ".0 e + 2" IS! 90 # work around: remove spaces between sign and digits! Maybe because 91 # of the Unary '-' Operator 92 $sign_=
"(?:-|\-|[-]|[\-]|\+|)"; # attempts #
94 $sign_=
"(?:-\s*|\+\s*|)"; #
n.b. sign
is followed by white space #
102 $prereal=$pre; $postreal=
$post;
103 $sexp=
"Ee\\\\"; $_exp=
"(?:⏨|[".$sexp.
"])".$_.$_int;
104 $_decimal=
"[.]".$_.$_dec;
106 # Add permitted permutations of various parts # 107 $rl= $_int.$_.$_decimal.$_.$_exp; # +_9_._9_e_+_9 #
108 $rl=$rl.
"|".$_int.$_.
"[.]".$_.$_exp; # +_9_.___e_+_9 #
109 $rl=$rl.
"|".$_int.$_.$_exp; # +_9_____e_+_9 #
110 $rl=$rl.
"|".$sign_.$_decimal.$_.$_exp; # +___._9_e_+_9 #
112 $rl=$rl.
"|".$_int.$_.$_decimal; # +_9_._9 #
113 $rl=$rl.
"|".$sign_.$_decimal; # +___._9 #
115 # The following line damaged formatting... 116 #$rl=$rl."|".$_int; # +_9 # 118 # Apparently Algol68 does not support '2.', c.f. Algol 68G 119 #$rl=$rl."|".$_int.$_."[.]"; # +_9_. # 121 # Literal prefixes are overridden by KEYWORDS :-( 122 $LONGS=
"(?:(?:(LONG\s+)*|(SHORT\s+))*|)";
125 "BITS" => $prebits.$LONGS.
"(?:".$bl.
")".$postbits,
126 "INT" => $preint.$LONGS.
"(?:".$il.
")".$postint,
127 "REAL" => $prereal.$LONGS.
"(?:".$rl.
")".$postreal,
129 "BOLD" =>
'color: #b1b100; font-weight: bold;',
130 "ITALIC" =>
'color: #b1b100;', # procedures traditionally italic #
131 "NONSTD" =>
'color: #FF0000; font-weight: bold;', # RED #
132 "COMMENT" =>
'color: #666666; font-style: italic;' 136 $a68=geshi_langfile_algol68_vars();
139 'LANG_NAME' =>
'ALGOL 68',
140 'COMMENT_SINGLE' => array(),
141 'COMMENT_MULTI' => array(
146 'COMMENT_REGEXP' => array(
147 1 =>
'/\bCO((?:MMENT)?)\b.*?\bCO\\1\b/i',
148 2 =>
'/\bPR((?:AGMAT)?)\b.*?\bPR\\1\b/i',
149 3 =>
'/\bQUOTE\b.*?\bQUOTE\b/i' 152 'QUOTEMARKS' => array(
'"'),
153 'ESCAPE_CHAR' =>
'"',
158 1 => array(
'KEEP',
'FINISH',
'USE',
'SYSPROCS',
'IOSTATE',
'USING',
'ENVIRON',
'PROGRAM',
'CONTEXT'),
159 # 2 => array(
'CASE',
'IN',
'OUSE',
'IN',
'OUT',
'ESAC',
'(',
'|',
'|:',
')',
'FOR',
'FROM',
'TO',
'BY',
'WHILE',
'DO',
'OD',
'IF',
'THEN',
'ELIF',
'THEN',
'ELSE',
'FI',
'PAR',
'BEGIN',
'EXIT',
'END',
'GO',
'GOTO',
'FORALL',
'UPTO',
'DOWNTO',
'FOREACH',
'ASSERT'), #
160 2 => array(
'CASE',
'IN',
'OUSE',
'OUT',
'ESAC',
'PAR',
'BEGIN',
'EXIT',
'END',
'GO TO',
'GOTO',
'FOR',
'FROM',
'TO',
'BY',
'WHILE',
'DO',
'OD',
'IF',
'THEN',
'ELIF',
'ELSE',
'FI' ),
161 3 => array(
'BITS',
'BOOL',
'BYTES',
'CHAR',
'COMPL',
'INT',
'REAL',
'SEMA',
'STRING',
'VOID'),
162 4 => array(
'MODE',
'OP',
'PRIO',
'PROC',
'FLEX',
'HEAP',
'LOC',
'REF',
'LONG',
'SHORT',
'EITHER'),
163 # Extensions
or deprecated keywords
164 #
'PIPE': keyword somehow interferes with
the internal operation
of GeSHi 165 5 => array(
'FORALL',
'UPTO',
'DOWNTO',
'FOREACH',
'ASSERT',
'CTB',
'CT',
'CTAB',
'COMPLEX',
'VECTOR',
'SOUND' ),
166 6 => array(
'CHANNEL',
'FILE',
'FORMAT',
'STRUCT',
'UNION',
'OF'),
167 #
'(',
'|',
'|:',
')', #
168 # 7 => array(
'OF',
'AT',
'@',
'IS',
':=:',
'ISNT',
':/=:',
':≠:',
'CTB',
'CT',
'::',
'CTAB',
'::=',
'TRUE',
'FALSE',
'EMPTY',
'NIL',
'○',
'SKIP',
'~'),
169 7 => array(
'AT',
'IS',
'ISNT',
'TRUE',
'FALSE',
'EMPTY',
'NIL',
'SKIP'),
170 8 => array(
'NOT',
'UP',
'DOWN',
'LWB',
'UPB',
'ABS',
'ARG',
'BIN',
'ENTIER',
'LENG',
'LEVEL',
'ODD',
'REPR',
'ROUND',
'SHORTEN',
'CONJ',
'SIGN'),
171 # OPERATORS ordered roughtly by PRIORITY #
172 # 9 => array(
'¬',
'↑',
'↓',
'⌊',
'⌈',
'~',
'⎩',
'⎧'),
173 # 10 => array(
'+*',
'I',
'+×',
'⊥',
'!',
'⏨'),
175 # 11 => array(
'SHL',
'SHR',
'**',
'UP',
'DOWN',
'LWB',
'UPB',
'↑',
'↓',
'⌊',
'⌈',
'⎩',
'⎧'),
176 11 => array(
'SHL',
'SHR', ),
177 # 12 => array(
'*',
'/',
'%',
'OVER',
'%*',
'MOD',
'ELEM',
'×',
'÷',
'÷×',
'÷*',
'%×',
'□',
'÷:'),
178 12 => array(
'OVER',
'MOD',
'ELEM'),
179 # 13 => array(
'-',
'+'),
180 # 14 => array(
'<',
'LT',
'<=',
'LE',
'>=',
'GE',
'>',
'GT',
'≤',
'≥'),
181 14 => array(
'LT',
'LE',
'GE',
'GT'),
182 # 15 => array(
'=',
'EQ',
'/=',
'NE',
'≠',
'~='),
183 15 => array(
'EQ',
'NE'),
184 # 16 => array(
'&',
'AND',
'∧',
'OR',
'∨',
'/\\',
'\\/'),
185 16 => array(
'AND',
'OR'),
186 17 => array(
'MINUSAB',
'PLUSAB',
'TIMESAB',
'DIVAB',
'OVERAB',
'MODAB',
'PLUSTO'),
187 # 18 => array(
'-:=',
'+:=',
'*:=',
'/:=',
'%:=',
'%*:=',
'+=:',
'×:=',
'÷:=',
'÷×:=',
'÷*:=',
'%×:=',
'÷::=',
'MINUS',
'PLUS',
'DIV',
'MOD',
'PRUS'),
188 # Extensions
or deprecated keywords
189 18 => array(
'MINUS',
'PLUS',
'DIV',
'PRUS',
'IS NOT'),
190 # Extensions
or deprecated keywords
191 19 => array(
'THEF',
'ANDF',
'ORF',
'ANDTH',
'OREL',
'ANDTHEN',
'ORELSE'),
192 # Built
in procedures - from standard prelude #
193 20 => array(
'int lengths',
'intlengths',
'int shorths',
'intshorths',
'max int',
'maxint',
'real lengths',
'reallengths',
'real shorths',
'realshorths',
'bits lengths',
'bitslengths',
'bits shorths',
'bitsshorths',
'bytes lengths',
'byteslengths',
'bytes shorths',
'bytesshorths',
'max abs char',
'maxabschar',
'int width',
'intwidth',
'long int width',
'longintwidth',
'long long int width',
'longlongintwidth',
'real width',
'realwidth',
'long real width',
'longrealwidth',
'long long real width',
'longlongrealwidth',
'exp width',
'expwidth',
'long exp width',
'longexpwidth',
'long long exp width',
'longlongexpwidth',
'bits width',
'bitswidth',
'long bits width',
'longbitswidth',
'long long bits width',
'longlongbitswidth',
'bytes width',
'byteswidth',
'long bytes width',
'longbyteswidth',
'max real',
'maxreal',
'small real',
'smallreal',
'long max int',
'longmaxint',
'long long max int',
'longlongmaxint',
'long max real',
'longmaxreal',
'long small real',
'longsmallreal',
'long long max real',
'longlongmaxreal',
'long long small real',
'longlongsmallreal',
'long max bits',
'longmaxbits',
'long long max bits',
'longlongmaxbits',
'null character',
'nullcharacter',
'blank',
'flip',
'flop',
'error char',
'errorchar',
'exp char',
'expchar',
'newline char',
'newlinechar',
'formfeed char',
'formfeedchar',
'tab char',
'tabchar'),
194 21 => array(
'stand in channel',
'standinchannel',
'stand out channel',
'standoutchannel',
'stand back channel',
'standbackchannel',
'stand draw channel',
'standdrawchannel',
'stand error channel',
'standerrorchannel'),
195 22 => array(
'put possible',
'putpossible',
'get possible',
'getpossible',
'bin possible',
'binpossible',
'set possible',
'setpossible',
'reset possible',
'resetpossible',
'reidf possible',
'reidfpossible',
'draw possible',
'drawpossible',
'compressible',
'on logical file end',
'onlogicalfileend',
'on physical file end',
'onphysicalfileend',
'on line end',
'onlineend',
'on page end',
'onpageend',
'on format end',
'onformatend',
'on value error',
'onvalueerror',
'on open error',
'onopenerror',
'on transput error',
'ontransputerror',
'on format error',
'onformaterror',
'open',
'establish',
'create',
'associate',
'close',
'lock',
'scratch',
'space',
'new line',
'newline',
'print',
'write f',
'writef',
'print f',
'printf',
'write bin',
'writebin',
'print bin',
'printbin',
'read f',
'readf',
'read bin',
'readbin',
'put f',
'putf',
'get f',
'getf',
'make term',
'maketerm',
'make device',
'makedevice',
'idf',
'term',
'read int',
'readint',
'read long int',
'readlongint',
'read long long int',
'readlonglongint',
'read real',
'readreal',
'read long real',
'readlongreal',
'read long long real',
'readlonglongreal',
'read complex',
'readcomplex',
'read long complex',
'readlongcomplex',
'read long long complex',
'readlonglongcomplex',
'read bool',
'readbool',
'read bits',
'readbits',
'read long bits',
'readlongbits',
'read long long bits',
'readlonglongbits',
'read char',
'readchar',
'read string',
'readstring',
'print int',
'printint',
'print long int',
'printlongint',
'print long long int',
'printlonglongint',
'print real',
'printreal',
'print long real',
'printlongreal',
'print long long real',
'printlonglongreal',
'print complex',
'printcomplex',
'print long complex',
'printlongcomplex',
'print long long complex',
'printlonglongcomplex',
'print bool',
'printbool',
'print bits',
'printbits',
'print long bits',
'printlongbits',
'print long long bits',
'printlonglongbits',
'print char',
'printchar',
'print string',
'printstring',
'whole',
'fixed',
'float'),
196 23 => array(
'pi',
'long pi',
'longpi',
'long long pi',
'longlongpi'),
197 24 => array(
'sqrt',
'curt',
'cbrt',
'exp',
'ln',
'log',
'sin',
'arc sin',
'arcsin',
'cos',
'arc cos',
'arccos',
'tan',
'arc tan',
'arctan',
'long sqrt',
'longsqrt',
'long curt',
'longcurt',
'long cbrt',
'longcbrt',
'long exp',
'longexp',
'long ln',
'longln',
'long log',
'longlog',
'long sin',
'longsin',
'long arc sin',
'longarcsin',
'long cos',
'longcos',
'long arc cos',
'longarccos',
'long tan',
'longtan',
'long arc tan',
'longarctan',
'long long sqrt',
'longlongsqrt',
'long long curt',
'longlongcurt',
'long long cbrt',
'longlongcbrt',
'long long exp',
'longlongexp',
'long long ln',
'longlongln',
'long long log',
'longlonglog',
'long long sin',
'longlongsin',
'long long arc sin',
'longlongarcsin',
'long long cos',
'longlongcos',
'long long arc cos',
'longlongarccos',
'long long tan',
'longlongtan',
'long long arc tan',
'longlongarctan'),
198 25 => array(
'first random',
'firstrandom',
'next random',
'nextrandom',
'long next random',
'longnextrandom',
'long long next random',
'longlongnextrandom'),
199 26 => array(
'real',
'bits pack',
'bitspack',
'long bits pack',
'longbitspack',
'long long bits pack',
'longlongbitspack',
'bytes pack',
'bytespack',
'long bytes pack',
'longbytespack',
'char in string',
'charinstring',
'last char in string',
'lastcharinstring',
'string in string',
'stringinstring'),
200 27 => array(
'utc time',
'utctime',
'local time',
'localtime',
'argc',
'argv',
'get env',
'getenv',
'reset errno',
'reseterrno',
'errno',
'strerror'),
201 28 => array(
'sinh',
'long sinh',
'longsinh',
'long long sinh',
'longlongsinh',
'arc sinh',
'arcsinh',
'long arc sinh',
'longarcsinh',
'long long arc sinh',
'longlongarcsinh',
'cosh',
'long cosh',
'longcosh',
'long long cosh',
'longlongcosh',
'arc cosh',
'arccosh',
'long arc cosh',
'longarccosh',
'long long arc cosh',
'longlongarccosh',
'tanh',
'long tanh',
'longtanh',
'long long tanh',
'longlongtanh',
'arc tanh',
'arctanh',
'long arc tanh',
'longarctanh',
'long long arc tanh',
'longlongarctanh',
'arc tan2',
'arctan2',
'long arc tan2',
'longarctan2',
'long long arc tan2',
'longlongarctan2'),
202 29 => array(
'complex sqrt',
'complexsqrt',
'long complex sqrt',
'longcomplexsqrt',
'long long complex sqrt',
'longlongcomplexsqrt',
'complex exp',
'complexexp',
'long complex exp',
'longcomplexexp',
'long long complex exp',
'longlongcomplexexp',
'complex ln',
'complexln',
'long complex ln',
'longcomplexln',
'long long complex ln',
'longlongcomplexln',
'complex sin',
'complexsin',
'long complex sin',
'longcomplexsin',
'long long complex sin',
'longlongcomplexsin',
'complex arc sin',
'complexarcsin',
'long complex arc sin',
'longcomplexarcsin',
'long long complex arc sin',
'longlongcomplexarcsin',
'complex cos',
'complexcos',
'long complex cos',
'longcomplexcos',
'long long complex cos',
'longlongcomplexcos',
'complex arc cos',
'complexarccos',
'long complex arc cos',
'longcomplexarccos',
'long long complex arc cos',
'longlongcomplexarccos',
'complex tan',
'complextan',
'long complex tan',
'longcomplextan',
'long long complex tan',
'longlongcomplextan',
'complex arc tan',
'complexarctan',
'long complex arc tan',
'longcomplexarctan',
'long long complex arc tan',
'longlongcomplexarctan',
'complex sinh',
'complexsinh',
'complex arc sinh',
'complexarcsinh',
'complex cosh',
'complexcosh',
'complex arc cosh',
'complexarccosh',
'complex tanh',
'complextanh',
'complex arc tanh',
'complexarctanh')
205 1 => array(
'÷×:=',
'%×:=',
':≠:',
'÷*:=',
'÷::=',
'%*:=',
':/=:',
'×:=',
'÷:=',
'÷×',
'%:=',
'%×',
'*:=',
'+:=',
'+=:',
'+×',
'-:=',
'/:=',
'::=',
':=:',
'÷*',
'÷:',
'↑',
'↓',
'∧',
'∨',
'≠',
'≤',
'≥',
'⊥',
'⌈',
'⌊',
'⎧',
'⎩',
'□',
'○',
'%*',
'**',
'+*',
'/=',
'::',
'/\\',
'\\/',
'<=',
'>=',
'|:',
'~=',
'¬',
'×',
'÷',
'!',
'%',
'&',
'(',
')',
'*',
'+',
',',
'-',
'/',
':',
';',
'<',
'=',
'>',
'?',
'@',
'[',
']',
'^',
'{',
'|',
'}',
'~')
207 'CASE_SENSITIVE' => array(
241 1 =>
$a68[
'NONSTD'], 2 =>
$a68[
'BOLD'], 3 =>
$a68[
'BOLD'], 4 =>
$a68[
'BOLD'],
242 5 =>
$a68[
'NONSTD'], 6 =>
$a68[
'BOLD'], 7 =>
$a68[
'BOLD'], 8 =>
$a68[
'BOLD'],
243 10 =>
$a68[
'BOLD'], 11 =>
$a68[
'BOLD'], 12 =>
$a68[
'BOLD'],
244 14 =>
$a68[
'BOLD'], 15 =>
$a68[
'BOLD'], 16 =>
$a68[
'BOLD'], 17 =>
$a68[
'BOLD'],
245 18 =>
$a68[
'NONSTD'], 19 =>
$a68[
'NONSTD'],
246 20 =>
$a68[
'ITALIC'], 21 =>
$a68[
'ITALIC'], 22 =>
$a68[
'ITALIC'], 23 =>
$a68[
'ITALIC'],
247 24 =>
$a68[
'ITALIC'], 25 =>
$a68[
'ITALIC'], 26 =>
$a68[
'ITALIC'], 27 =>
$a68[
'ITALIC'],
248 28 =>
$a68[
'ITALIC'], 29 =>
$a68[
'ITALIC']
251 1 =>
$a68[
'COMMENT'], 2 =>
$a68[
'COMMENT'], 3 =>
$a68[
'COMMENT'],
252 'MULTI' =>
$a68[
'COMMENT']
254 'ESCAPE_CHAR' => array(
255 0 =>
'color: #000099; font-weight: bold;' 258 0 =>
'color: #009900;' 261 0 =>
'color: #0000ff;' 264 0 =>
'color: #cc66cc;',
267 0 =>
'color: #004000;',
268 1 =>
'color: #004000;' 271 0 =>
'color: #339933;',
272 1 =>
'color: #339933;' 275 0 =>
'color: #cc66cc;', # BITS #
276 1 =>
'color: #cc66cc;', # REAL #
313 'OBJECT_SPLITTERS' => array(
320 # 2 =>
$a68[
'INT'], # Breaks formatting
for some reason #
321 # 2 => $GESHI_NUMBER_INT_BASIC # Also breaks formatting #
324 'SCRIPT_DELIMITERS' => array(),
325 'HIGHLIGHT_STRICT_BLOCK' => array()
const GESHI_NUMBER_HEX_SUFFIX
Number format to highlight hex numbers with a suffix of h.
if(! $in) print Initializing normalization quick check tables n
const GESHI_COMMENTS
Used in language files to mark comments.
if(!function_exists('geshi_langfile_algol68_vars')) $a68
const GESHI_NEVER
#+ private
const GESHI_CAPS_NO_CHANGE
Lowercase keywords found.