13header(
'Content-Type: text/html; charset=utf-8');
16error_reporting(E_ALL);
20if (get_magic_quotes_gpc()) {
21 function stripslashes_deep($value) {
22 $value = is_array($value) ?
23 array_map(
'stripslashes_deep', $value) :
32 $_REQUEST = array_map(
'stripslashes_deep', $_REQUEST);
36 return is_array($value) ? array_map(
'htmlspecialchars_deep', $value) : htmlspecialchars($value);
39define (
'TYPE_NOTICE', 0);
40define (
'TYPE_WARNING', 1);
41define (
'TYPE_ERROR', 2);
49 echo
"<span style=\"color: #F00; font-weight: bold;\">Failed</span><br />";
53 switch($error_msg[
't']) {
55 echo
"<span style=\"color: #080; font-weight: bold;\">NOTICE:</span>";
58 echo
"<span style=\"color: #CC0; font-weight: bold;\">WARNING:</span>";
61 echo
"<span style=\"color: #F00; font-weight: bold;\">ERROR:</span>";
64 echo
" " . $error_msg[
'm'] .
"</li>";
68 echo
"<span style=\"color: #080; font-weight: bold;\">OK</span><br />";
85<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
86 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
87<html xmlns=
"http://www.w3.org/1999/xhtml" xml:lang=
"en" lang=
"en">
89 <title>
GeSHi Language File Generator Script</title>
90 <style type=
"text/css">
93 background-
color: #f0f0f0;
96 font-family: Verdana, Arial, sans-serif;
98 border: 2px solid #e0e0e0;
99 background-
color: #fcfcfc;
104 margin: .1em 0 .2em .5em;
105 border-bottom: 1px solid #b0b0b0;
111 margin: .1em 0 .2em .5em;
125 border: 1px solid #b0b0b0;
132 border: 1px solid #808080;
139 border: 1px dotted gray;
140 background-
color: #f0f0f0;
145 background-
color: #f9f9f9;
146 border: 1px solid #a0a0a0;
147 border-width: 1px 2px 2px 1px;
149 fieldset table > tbody > tr > td {
152 fieldset table > tbody > tr > td+td {
156 fieldset table > tbody > tr > td+td >
input {
163<h2>
GeSHi Language File Generator Script</h2>
164<
p>To use
this script, make sure that <strong>
geshi.php</strong> is in the
165parent directory or in your include_path, and that the language files are in a
166subdirectory of
GeSHi's directory called <strong>geshi/</strong>.</p>
167<p>If not already done, select a language file below that will be used as
168base for the language file to generate or create a blank one. Following this
169you can do whatever you like to edit your language file. But note that not all
170features are made available through this script.</p>
172<p>Checking GeSHi installation ... <?php
173// Rudimentary checking of where GeSHi is. In a default install it will be in ../, but
174// it could be in the current directory if the include_path is set. There's nowhere
else
176if (is_readable(
'../geshi.php')) {
178} elseif (is_readable(
'geshi.php')) {
185 require
$path .
'geshi.php';
187 if(!class_exists(
'GeSHi')) {
188 report_error(
TYPE_ERROR,
'The GeSHi class was not found, although it seemed we loaded the correct file!');
193 if(!
defined(
'GESHI_LANG_ROOT')) {
210 while (
$file = readdir($dir)) {
239 'name' =>
'Benny Baumann',
240 'email' =>
'BenBE@geshi.org',
241 'web' =>
'http://qbnz.com/highlighter/'
249 'style' =>
'font-style: italic; color: #666666;'
253 'style' =>
'font-style: italic; color: #666666;'
260 'style' =>
'font-style: italic; color: #666666;'
265 'style' =>
'font-style: italic; color: #006600;'
270 'rx' =>
'/Hello RegExp/',
271 'style' =>
'font-style: italic; color: #666666;'
279 'style' =>
'color: #0000FF;'
283 'style' =>
'color: #0000FF;'
288 'style' =>
'font-weight: bold; color: #000080;'
292 'rx' =>
'/\{\\\\$\w+\}/',
293 'style' =>
'font-weight: bold; color: #008080;'
296 'rx'=>
'/\{\\\\$\w+\}/',
297 'style' =>
'font-weight: bold; color: #008080;'
301 'kw_case' =>
'GESHI_CAPS_NO_CHANGE',
306 'style' =>
'color: #0000FF; font-weight: bold;',
313 'style' =>
'color: #0000FF; font-weight: bold;'
319 'GESHI_CAPS_NO_CHANGE' =>
'',
320 'GESHI_CAPS_UPPER' =>
'',
321 'GESHI_CAPS_LOWER' =>
''
336 if(array_key_exists($varName,
$_POST)) {
355<form action=
"?action=test" method=
"post">
357 <legend>Generic Information</legend>
362 <label
for=
"li[file]">Language File ID:</label>
365 <
input type=
"text" name=
"li[file]" id=
"li[file]" value=
"<?=$li['file']; ?>" />
371 <label
for=
"li[name]">Language Name:</label>
374 <
input type=
"text" name=
"li[name]" id=
"li[name]" value=
"<?=$li['name']; ?>" />
382 <legend>Author</legend>
387 <label
for=
"ai[name]">Full Name:</label>
390 <
input type=
"text" name=
"ai[name]" id=
"ai[name]" value=
"<?=$ai['name']; ?>" />
396 <label
for=
"ai[email]">eMail address:</label>
399 <
input type=
"text" name=
"ai[email]" id=
"ai[email]" value=
"<?=$ai['email']; ?>" />
405 <label
for=
"ai[web]">Homepage:</label>
408 <
input type=
"text" name=
"ai[web]" id=
"ai[web]" value=
"<?=$ai['web']; ?>" />
415 <legend>Comments</legend>
418 <legend>Single Line</legend>
421 <legend>Comment Group 1</legend>
426 <label
for=
"ld[cmt][sl][1][start]">Comment Start:</label>
429 <
input type=
"text" name=
"ld[cmt][sl][1][start]" id=
"ld[cmt][sl][1][start]" value=
"<?=$ld['cmt']['sl'][1]['start']; ?>" />
435 <label
for=
"ld[cmt][sl][1][style]">Comment Style:</label>
438 <
input type=
"text" name=
"ld[cmt][sl][1][style]" id=
"ld[cmt][sl][1][style]" value=
"<?=$ld['cmt']['sl'][1]['style']; ?>" />
445 <legend>Comment Group 2</legend>
450 <label
for=
"ld[cmt][sl][2][start]">Comment Start:</label>
453 <
input type=
"text" name=
"ld[cmt][sl][2][start]" id=
"ld[cmt][sl][2][start]" value=
"<?=$ld['cmt']['sl'][2]['start']; ?>" />
459 <label
for=
"ld[cmt][sl][2][style]">Comment Style:</label>
462 <
input type=
"text" name=
"ld[cmt][sl][2][style]" id=
"ld[cmt][sl][2][style]" value=
"<?=$ld['cmt']['sl'][2]['style']; ?>" />
470 <legend>Multiple Lines</legend>
473 <legend>Comment Group 1</legend>
478 <label
for=
"ld[cmt][ml][1][start]">Comment Start:</label>
481 <
input type=
"text" name=
"ld[cmt][ml][1][start]" id=
"ld[cmt][ml][1][start]" value=
"<?=$ld['cmt']['ml'][1]['start']; ?>" />
487 <label
for=
"ld[cmt][ml][1][end]">Comment End:</label>
490 <
input type=
"text" name=
"ld[cmt][ml][1][end]" id=
"ld[cmt][ml][1][end]" value=
"<?=$ld['cmt']['ml'][1]['end']; ?>" />
496 <label
for=
"ld[cmt][ml][1][style]">Comment Style:</label>
499 <
input type=
"text" name=
"ld[cmt][ml][1][style]" id=
"ld[cmt][ml][1][style]" value=
"<?=$ld['cmt']['ml'][1]['style']; ?>" />
506 <legend>Comment Group 2</legend>
511 <label
for=
"ld[cmt][ml][2][start]">Comment Start:</label>
514 <
input type=
"text" name=
"ld[cmt][ml][2][start]" id=
"ld[cmt][ml][2][start]" value=
"<?=$ld['cmt']['ml'][2]['start']; ?>" />
520 <label
for=
"ld[cmt][ml][2][end]">Comment End:</label>
523 <
input type=
"text" name=
"ld[cmt][ml][2][end]" id=
"ld[cmt][ml][2][end]" value=
"<?=$ld['cmt']['ml'][2]['end']; ?>" />
529 <label
for=
"ld[cmt][ml][2][style]">Comment Style:</label>
532 <
input type=
"text" name=
"ld[cmt][ml][2][style]" id=
"ld[cmt][ml][2][style]" value=
"<?=$ld['cmt']['ml'][2]['style']; ?>" />
540 <legend>Regular Expressions</legend>
543 <legend>Comment Group 1</legend>
548 <label
for=
"ld[cmt][rxc][1][rx]">Comment RX:</label>
551 <
input type=
"text" name=
"ld[cmt][rxc][1][rx]" id=
"ld[cmt][rxc][1][rx]" value=
"<?=$ld['cmt']['rxc'][1]['rx']; ?>" />
557 <label
for=
"ld[cmt][rxc][1][style]">Comment Style:</label>
560 <
input type=
"text" name=
"ld[cmt][rxc][1][style]" id=
"ld[cmt][rxc][1][style]" value=
"<?=$ld['cmt']['rxc'][1]['style']; ?>" />
569 <legend>Strings</legend>
572 <legend>String \ Quotes (delimiters, parsed)</legend>
575 <legend>Quotemark Group 1</legend>
580 <label
for=
"ld[str][qm][1][delim]">String Delimiter:</label>
583 <
input type=
"text" name=
"ld[str][qm][1][delim]" id=
"ld[str][qm][1][delim]" value=
"<?=$ld['str']['qm'][1]['delim']; ?>" />
589 <label
for=
"ld[str][qm][1][style]">String Style:</label>
592 <
input type=
"text" name=
"ld[str][qm][1][style]" id=
"ld[str][qm][1][style]" value=
"<?=$ld['str']['qm'][1]['style']; ?>" />
598 <legend>Quotemark Group 2</legend>
603 <label
for=
"ld[str][qm][1][delim]">String Delimiter:</label>
606 <
input type=
"text" name=
"ld[str][qm][2][delim]" id=
"ld[str][qm][2][delim]" value=
"<?=$ld['str']['qm'][2]['delim']; ?>" />
612 <label
for=
"ld[str][qm][1][style]">String Style:</label>
615 <
input type=
"text" name=
"ld[str][qm][2][style]" id=
"ld[str][qm][2][style]" value=
"<?=$ld['str']['qm'][2]['style']; ?>" />
625 <legend>Escape Sequences</legend>
628 <legend>Generic Escape Char</legend>
633 <label
for=
"ld[str][ec][char]">Escape Char:</label>
636 <
input type=
"text" name=
"ld[str][ec][char]" id=
"ld[str][ec][char]" value=
"<?=$ld['str']['ec']['char']; ?>" />
642 <label
for=
"ld[str][ec][style]">Escape Char Style:</label>
645 <
input type=
"text" name=
"ld[str][ec][style]" id=
"ld[str][ec][style]" value=
"<?=$ld['str']['ec']['style']; ?>" />
652 <legend>Escape Regexp Group 1</legend>
657 <label
for=
"ld[str][erx][1][rx]">Escape Regexp:</label>
660 <
input type=
"text" name=
"ld[str][erx][1][rx]" id=
"ld[str][erx][1][rx]" value=
"<?=$ld['str']['erx'][1]['rx']; ?>" />
666 <label
for=
"ld[str][erx][1][style]">Escape Style:</label>
669 <
input type=
"text" name=
"ld[str][erx][1][style]" id=
"ld[str][erx][1][style]" value=
"<?=$ld['str']['erx'][1]['style']; ?>" />
676 <legend>Escape Regexp Group 2</legend>
681 <label
for=
"ld[str][erx][2][rx]">Escape Regexp:</label>
684 <
input type=
"text" name=
"ld[str][erx][2][rx]" id=
"ld[str][erx][2][rx]" value=
"<?=$ld['str']['erx'][2]['rx']; ?>" />
690 <label
for=
"ld[str][erx][2][style]">Escape Style:</label>
693 <
input type=
"text" name=
"ld[str][erx][2][style]" id=
"ld[str][erx][2][style]" value=
"<?=$ld['str']['erx'][2]['style']; ?>" />
702 <legend>Keywords</legend>
705 <legend>Case of Keywords</legend>
710 <label
for=
"ld[kw_case]">Handling of keywords
case:</label>
713 <
select name=ld[kw_case]
" id="ld[kw_case]
">
714 <option value="GESHI_CAPS_NO_CHANGE"<?=$kw_case_sel['GESHI_CAPS_NO_CHANGE']; ?>>Don’t change the case of any keyword</option>
715 <option value="GESHI_CAPS_UPPER"<?=$kw_case_sel['GESHI_CAPS_UPPER']; ?>>Convert the case of all keywords to upper case</option>
716 <option value="GESHI_CAPS_LOWER"<?=$kw_case_sel['GESHI_CAPS_LOWER']; ?>>Convert the case of all keywords to lower case</option>
724 <legend>Keyword Group 1</legend>
729 <label for="ld[kw][1][list]
">Keyword List:</label>
732 <textarea name="ld[kw][1][list]
" id="ld[kw][1][list]
" rows="10
" cols="80
"><?=$ld['kw'][1]['list']; ?></textarea>
738 <label for="ld[kw][1][
case]
">Case Sensitive:</label>
741 <select name="ld[kw][1][
case]
" id="ld[kw][1][
case]
">
742 <option value="0
"<?=$kw_cases_sel[1][0]; ?>>No</option>
743 <option value="1
"<?=$kw_cases_sel[1][1]; ?>>Yes</option>
750 <label for="ld[kw][1][style]
">Keyword Style:</label>
753 <input type="text
" name="ld[kw][1][style]
" id="ld[kw][1][style]
" value="<?=
$ld[
'kw'][1][
'style']; ?>
" />
759 <label for="ld[kw][1][docs]
">Documentation URL:</label>
762 <input type="text
" name="ld[kw][1][docs]
" id="ld[kw][1][docs]
" value="<?=
$ld[
'kw'][1][
'docs']; ?>
" />
772 <legend>Symbols</legend>
775 <legend>Symbols Group 1</legend>
780 <label for="ld[sy][0][list]
">Symbols List:</label>
783 <textarea name="ld[sy][0][list]
" id="ld[sy][0][list]
" rows="10
" cols="80
"><?=$ld['sy'][0]['list']; ?></textarea>
789 <label for="ld[sy][0][style]
">Symbols Style:</label>
792 <input type="text
" name="ld[sy][0][style]
" id="ld[sy][0][style]
" value="<?=
$ld[
'sy'][0][
'style']; ?>
" />
803 <legend>Language File Source</legend>
805$G = new GeSHi('', 'php');
806$langfile_source = gen_langfile($lang);
807$G->set_source($langfile_source);
808echo $G->parse_code();
814 <input type="submit
" name="btn
" value="Send!
" />
817<p>Operation completed in <?php
818$time_end = explode(' ', microtime());
819$time_diff = $time_end[0] + $time_end[1] - $time_start[0] - $time_start[1];
821echo sprintf("%.2f
", $time_diff);
824<div id="footer
">GeSHi © 2004-2007 Nigel McNie, 2007-2009 Benny Baumann, released under the GNU GPL</div>
829function str_to_phpstring($str, $doublequote = false){
831 return '"' . strtr($str,
843 return "'" . strtr($str,
852function validate_lang(){
854 'name' => 'Benny Baumann',
855 'email' => 'BenBE@geshi.org',
856 'web' => 'http://qbnz.com/highlighter/'
864 if(isset($_POST['ld'])) {
879 'style' => 'font-style: italic; color: #666666;'
885 'style' => 'color: #00000'
897 'kw_case' => 'GESHI_CAPS_NO_CHANGE',
902 return array('ai' => $ai, 'li' => $li, 'ld' => $ld);
905function gen_langfile($lang){
906 $langfile = $lang['li']['file'];
907 $langdesc = $lang['li']['desc'];
909 $langauthor_name = $lang['ai']['name'];
910 $langauthor_email = $lang['ai']['email'];
911 $langauthor_web = $lang['ai']['web'];
913 $langversion = GESHI_VERSION;
915 $langdate = date('Y/m/d');
916 $langyear = date('Y');
919 $i = array('', $i, $i.$i, $i.$i.$i);
921 $src = <<<GESHI_LANGFILE_HEAD
962\$language_data = array(
967 $src .= $i[1] . "
'LANG_NAME' =>
".str_to_phpstring($langdesc).",\n
";
970 $src .= $i[1] . "'COMMENT_SINGLE' => array(\n
";
971 foreach($lang['ld']['cmt']['sl'] as $idx_cmt_sl => $tmp_cmt_sl) {
972 $src .= $i[2] . ((int)$idx_cmt_sl). " =>
". str_to_phpstring($tmp_cmt_sl['start']) . ",\n
";
974 $src .= $i[2] . "),\n
";
975 $src .= $i[1] . "'COMMENT_MULTI' => array(\n
";
976 foreach($lang['ld']['cmt']['ml'] as $tmp_cmt_ml) {
977 $src .= $i[2] . str_to_phpstring($tmp_cmt_ml['start']). " =>
". str_to_phpstring($tmp_cmt_ml['end']) . ",\n
";
979 $src .= $i[2] . "),\n
";
980 $src .= $i[1] . "'COMMENT_REGEXP' => array(\n
";
981 foreach($lang['ld']['cmt']['rxc'] as $idx_cmt_rxc => $tmp_cmt_rxc) {
982 $src .= $i[2] . ((int)$idx_cmt_rxc). " =>
". str_to_phpstring($tmp_cmt_rxc['rx']) . ",\n
";
984 $src .= $i[2] . "),\n
";
987 $src .= $i[1] . "'CASE_KEYWORDS' =>
" . $lang['ld']['kw_case'] . ",\n
";
990 $src .= $i[1] . "'QUOTEMARKS' => array(\n
";
991 foreach($lang['ld']['str']['qm'] as $idx_str_qm => $tmp_str_qm) {
992 $src .= $i[2] . ((int)$idx_str_qm). " =>
". str_to_phpstring($tmp_str_qm['delim']) . ",\n
";
994 $src .= $i[2] . "),\n
";
995 $src .= $i[1] . "'ESCAPE_CHAR' =>
" . str_to_phpstring($lang['ld']['str']['ec']['char']) . ",\n
";
996 $src .= $i[1] . "'ESCAPE_REGEXP' => array(\n
";
997 foreach($lang['ld']['str']['erx'] as $idx_str_erx => $tmp_str_erx) {
998 $src .= $i[2] . ((int)$idx_str_erx). " =>
". str_to_phpstring($tmp_str_erx['rx']) . ",\n
";
1000 $src .= $i[2] . "),\n
";
1003 $src .= $i[1] . "'HARDQUOTE' => array(\n
";
1004 $src .= $i[2] . "),\n
";
1005 $src .= $i[1] . "'HARDESCAPE' => array(\n
";
1006 $src .= $i[2] . "),\n
";
1007 $src .= $i[1] . "'HARDCHAR' =>
'',\n
";
1010 $src .= $i[1] . "'NUMBERS' =>\n
";
1015 $src .= $i[1] . "'KEYWRODS' => array(\n
";
1016 foreach($lang['ld']['kw'] as $idx_kw => $tmp_kw) {
1017 $src .= $i[2] . ((int)$idx_kw) . " => array(\n
";
1018 if(!is_array($tmp_kw['list'])) {
1019 $tmp_kw['list'] = explode("\n
", $tmp_kw['list']);
1021 $tmp_kw['list'] = array_map('trim', $tmp_kw['list']);
1022 sort($tmp_kw['list']);
1023 $kw_esc = array_map('str_to_phpstring', $tmp_kw['list']);
1026 foreach($kw_esc as $kw_data) {
1027 if((strlen($kw_data) + $kw_pos > 79) && $kw_pos > strlen($i[3])) {
1034 $kw_pos += strlen($i[3]);
1037 $src .= $kw_data . ', ';
1038 $kw_pos += strlen($kw_data) + 2;
1041 $src .= $i[3] . "),\n
";
1043 $src .= $i[2] . "),\n
";
1046 $src .= $i[1] . "'CASE_SENSITIVE' => array(\n
";
1047 foreach($lang['ld']['kw'] as $idx_kw => $tmp_kw) {
1048 $src .= $i[2] . ((int)$idx_kw) . " =>
" . ($tmp_kw['case'] ? 'true' : 'false') . ",\n
";
1050 $src .= $i[2] . "),\n
";
1053 $src .= $i[1] . "'SYMBOLS' => array(\n
";
1054 foreach($lang['ld']['sy'] as $idx_kw => $tmp_kw) {
1055 $src .= $i[2] . ((int)$idx_kw) . " => array(\n
";
1056 $tmp_kw['list'] = (array)$tmp_kw['list'];
1057 sort($tmp_kw['list']);
1058 $kw_esc = array_map('str_to_phpstring', $tmp_kw['list']);
1060 $kw_pos = strlen($i[3]);
1061 foreach($kw_esc as $kw_data) {
1062 if((strlen($kw_data) + $kw_pos > 79) && $kw_pos > strlen($i[3])) {
1069 $kw_pos += strlen($i[3]);
1072 $src .= $kw_data . ', ';
1073 $kw_pos += strlen($kw_data) + 2;
1076 $src .= $i[3] . "),\n
";
1078 $src .= $i[2] . "),\n
";
1081 $src .= $i[1] . "'STYLES' => array(\n
";
1082 $src .= $i[2] . "'KEYWRODS' => array(\n
";
1083 foreach($lang['ld']['kw'] as $idx_kw => $tmp_kw) {
1084 $src .= $i[3] . ((int)$idx_kw) . " =>
" . str_to_phpstring($tmp_kw['style']) . ",\n
";
1086 $src .= $i[3] . "),\n
";
1087 $src .= $i[2] . "'COMMENTS' => array(\n
";
1088 foreach($lang['ld']['cmt']['sl'] as $idx_cmt_sl => $tmp_cmt_sl) {
1089 $src .= $i[3] . ((int)$idx_cmt_sl) . " =>
" . str_to_phpstring($tmp_cmt_sl['style']) . ",\n
";
1091 foreach($lang['ld']['cmt']['rxc'] as $idx_cmt_rxc => $tmp_cmt_rxc) {
1092 $src .= $i[3] . ((int)$idx_cmt_rxc) . " =>
" . str_to_phpstring($tmp_cmt_rxc['style']) . ",\n
";
1094 $src .= $i[3] . "'MULTI' =>
" . str_to_phpstring($lang['ld']['cmt']['ml'][1]['style']) . "\n
";
1095 $src .= $i[3] . "),\n
";
1096 $src .= $i[2] . "'ESCAPE_CHAR' => array(\n
";
1097 foreach($lang['ld']['str']['erx'] as $idx_str_erx => $tmp_str_erx) {
1098 $src .= $i[3] . ((int)$idx_str_erx). " =>
". str_to_phpstring($tmp_str_erx['style']) . ",\n
";
1100 // 'HARD' => 'color: #000099; font-weight: bold;'
1101 $src .= $i[3] . "),\n
";
1102 $src .= $i[2] . "'BRACKETS' => array(\n
";
1103 $src .= $i[3] . "),\n
";
1104 $src .= $i[2] . "'STRINGS' => array(\n
";
1105 foreach($lang['ld']['str']['qm'] as $idx_str_qm => $tmp_str_qm) {
1106 $src .= $i[3] . ((int)$idx_str_qm). " =>
". str_to_phpstring($tmp_str_qm['style']) . ",\n
";
1108 // 'HARD' => 'color: #0000ff;'
1109 $src .= $i[3] . "),\n
";
1110 $src .= $i[2] . "'NUMBERS' => array(\n
";
1111 $src .= $i[3] . "),\n
";
1112 $src .= $i[2] . "'METHODS' => array(\n
";
1113 $src .= $i[3] . "),\n
";
1114 $src .= $i[2] . "'SYMBOLS' => array(\n
";
1115 foreach($lang['ld']['sy'] as $idx_kw => $tmp_kw) {
1116 $src .= $i[3] . ((int)$idx_kw) . " =>
" . str_to_phpstring($tmp_kw['style']) . ",\n
";
1118 $src .= $i[3] . "),\n
";
1119 $src .= $i[2] . "'REGEXPS' => array(\n
";
1120 $src .= $i[3] . "),\n
";
1121 $src .= $i[2] . "'SCRIPT' => array(\n
";
1122 $src .= $i[3] . "),\n
";
1123 $src .= $i[2] . "),\n
";
1125 //Keyword Documentation
1126 $src .= $i[1] . "'URLS' => array(\n
";
1127 foreach($lang['ld']['kw'] as $idx_kw => $tmp_kw) {
1128 $src .= $i[2] . ((int)$idx_kw) . " =>
" . str_to_phpstring($tmp_kw['docs']) . ",\n
";
1130 $src .= $i[2] . "),\n
";
1131 $src .= $i[1] . "'OOLANG' =>
false,\n
";
1132 $src .= $i[1] . "'OBJECT_SPLITTERS' => array(\n
";
1133 $src .= $i[2] . "),\n
";
1134 $src .= $i[1] . "'REGEXPS' => array(\n
";
1135 $src .= $i[2] . "),\n
";
1136 $src .= $i[1] . "'STRICT_MODE_APPLIES' =>
GESHI_MAYBE,\n
";
1137 $src .= $i[1] . "'SCRIPT_DELIMITERS' => array(\n
";
1138 $src .= $i[2] . "),\n
";
1139 $src .= $i[1] . "'HIGHLIGHT_STRICT_BLOCK' => array(\n
";
1140 $src .= $i[2] . "),\n
";
1141 $src .= $i[1] . "'TAB_WIDTH' => 4\n
";
1143 $src .= <<<GESHI_LANGFILE_FOOTER
1145GESHI_LANGFILE_FOOTER;
1148 $src = preg_replace('/array\(\s*\)/s', 'array()', $src);
1149 $src = preg_replace('/\,(\s*\))/s', '\1', $src);
1150 $src = preg_replace('/\s+$/m', '', $src);
An exception for terminatinating execution or to throw for unit testing.
const GESHI_NUMBER_INT_BASIC
Basic number format for integers.
const GESHI_MAYBE
Strict mode might apply, and can be enabled or disabled by GeSHi->enable_strict_mode().
const GESHI_CAPS_NO_CHANGE
Lowercase keywords found.
const GESHI_NUMBER_OCT_PREFIX
Number format to highlight octal numbers with a leading zero.
const GESHI_LANG_ROOT(!defined('GESHI_ROOT'))
The language file directory for GeSHi @access private.
const GESHI_NUMBER_HEX_PREFIX
Number format to highlight hex numbers with a prefix 0x.
const GESHI_NUMBER_FLT_SCI_ZERO
Number format to highlight floating-point numbers with support for scientific notation (E) and requir...
const GESHI_CAPS_LOWER
Leave keywords found as the case that they are.
const GESHI_CAPS_UPPER
Uppercase keywords found.
if(PHP_SAPI !='cli') color
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
if(get_magic_quotes_gpc()) htmlspecialchars_deep($value)
report_error($type, $message)
A simple script which outputs the CSS classes for all languages supported by GeSHi.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file