Hi all,
Just updated my wiki to the latest version and noticed the geshi stuff had moved, so it didn't see my language file for the Zep language (a program for doing psycholinguistic experiments
https://www.beexy.nl/zep2 of which I'm the author). I moved my language file to the new location and ran into some problems I got before with previous versions of dokuwiki (which I didn't report back then, sorry).
See my language file below. The problem I'm facing is that semicolons and vertical bars in code are shown as
<SEMI> resp.
<PIPE>[/m] and some fragments are preceded by [m]REG3XP0[/m]. I managed to fix my problem in geshi.php by replacing all occurences of [m]REG3XP[/m] by [m]@reg3xp[/m], [m]<SEMI>[/m] by [m]<@semi>[/m] and [m]<PIPE>[/m] by [m]<@pipe>. I'm not sure if I fixed it or just made problem go away.
Here you can see the result before the 'fix':
https://www.beexy.nl/zep2/wiki-prob/doku.php?id=notation#source-code_fragments
Here you can see the result after the 'fix':
https://www.beexy.nl/zep2/wiki/doku.php?id=notation#source-code_fragments
The problem seems to lie in the
REGEXPS section of the language file, but I don't see what could possibly be wrong there. I hope someone with knowledge about geshi can see what the problem might be.
My geshi Language file zep.php (without header block):
$language_data = array (
'LANG_NAME' => 'Zep',
'COMMENT_SINGLE' => array(1 => '//'),
'COMMENT_MULTI' => array('/*' => '*/'),
'COMMENT_REGEXP' => array(
//Multiline-continued single-line comments
1 => '/\/\/(?:\\\\\\\\|\\\\\\n|.)*$/m',
),
'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
'QUOTEMARKS' => array("'", '"'),
'ESCAPE_CHAR' => '',
'ESCAPE_REGEXP' => array(
//Simple Single Char Escapes
1 => "#\\\\[abfnrtv\\\'\"?\n]#i",
//Hexadecimal Char Specs
2 => "#\\\\x[\da-fA-F]{2}#",
//Hexadecimal Char Specs
3 => "#\\\\u[\da-fA-F]{4}#",
//Hexadecimal Char Specs
4 => "#\\\\U[\da-fA-F]{8}#"
),
'NUMBERS' =>
GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_HEX_PREFIX |
GESHI_NUMBER_FLT_NONSCI | GESHI_NUMBER_FLT_SCI_SHORT |
GESHI_NUMBER_FLT_SCI_ZERO,
'KEYWORDS' => array(
1 => array(
'break', 'continue', 'else', 'for', 'foreach', 'if', 'return',
'switch', 'terminate', 'while'
),
2 => array(
'alias', 'cast', 'castable', 'const', 'enum', 'import',
'metadata', 'module', 'plugin', 'program', 'record', 'requires',
'on_event', 'weak'
),
3 => array(
'false', 'null', 'this', 'true'
),
4 => array(
'bool', 'char', 'color', 'date', 'dur', 'int', 'real', 'string',
'time', 'void'
),
),
'SYMBOLS' => array(
0 => array('(', ')', '{', '}', '[', ']'),
1 => array('<', '>', '='),
2 => array('+', '-', '*', '/', '%'),
3 => array('!', '^', '&', '|'),
4 => array('?', ':', ';')
),
'CASE_SENSITIVE' => array(
GESHI_COMMENTS => false,
1 => true,
2 => true,
3 => true,
4 => true,
),
'URLS' => array(
1 => '',
2 => '',
3 => '',
4 => ''
),
'OOLANG' => true,
'OBJECT_SPLITTERS' => array(
1 => '.',
2 => '::'
),
'REGEXPS' => array(
0 => array(
GESHI_SEARCH => "([\p{L}_][\p{L}\p{N}_]*)(\s*\()",
GESHI_REPLACE => '\\1',
GESHI_MODIFIERS => '',
GESHI_BEFORE => '',
GESHI_AFTER => '('
),
1 => array(
GESHI_SEARCH => '(\b)((\p{Lu}[\p{L}\p{N}_]*)+)',
GESHI_REPLACE => '\\2',
GESHI_MODIFIERS => '',
GESHI_BEFORE => '',
GESHI_AFTER => ''
),
2 => array(
GESHI_SEARCH => '(\b)((\p{Lu}[\p{Ll}\p{N}]+)+)',
GESHI_REPLACE => '\\2',
GESHI_MODIFIERS => '',
GESHI_BEFORE => '',
GESHI_AFTER => ''
)
),
'STRICT_MODE_APPLIES' => GESHI_NEVER,
'SCRIPT_DELIMITERS' => array(
),
'HIGHLIGHT_STRICT_BLOCK' => array(
),
'TAB_WIDTH' => 4,
);
Theo