diff options
author | Guy Brand <gb@unistra.fr> | 2015-08-10 10:03:27 +0200 |
---|---|---|
committer | Guy Brand <gb@unistra.fr> | 2015-08-10 10:03:27 +0200 |
commit | 53a57d16b9c741bb44099fd93bf79efa06796341 (patch) | |
tree | 24a90a50afe9325926c8ebaa2ed90f9fa093e5b9 /inc/parser/lexer.php | |
parent | cf6e6645c31a9f185cef3fb9452fb188882ede47 (diff) | |
parent | a060d9973e7c1d5051f2cc426937881826e4972e (diff) | |
download | rpg-53a57d16b9c741bb44099fd93bf79efa06796341.tar.gz rpg-53a57d16b9c741bb44099fd93bf79efa06796341.tar.bz2 |
Merge branch master into stable
Diffstat (limited to 'inc/parser/lexer.php')
-rw-r--r-- | inc/parser/lexer.php | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/inc/parser/lexer.php b/inc/parser/lexer.php index 2e84eca7c..17aa6c170 100644 --- a/inc/parser/lexer.php +++ b/inc/parser/lexer.php @@ -46,7 +46,7 @@ class Doku_LexerParallelRegex { * for insensitive. * @access public */ - function Doku_LexerParallelRegex($case) { + function __construct($case) { $this->_case = $case; $this->_patterns = array(); $this->_labels = array(); @@ -56,12 +56,12 @@ class Doku_LexerParallelRegex { /** * Adds a pattern with an optional label. * - * @param mixed $pattern Perl style regex. Must be UTF-8 + * @param mixed $pattern Perl style regex. Must be UTF-8 * encoded. If its a string, the (, ) * lose their meaning unless they * form part of a lookahead or * lookbehind assertation. - * @param string $label Label of regex to be returned + * @param bool|string $label Label of regex to be returned * on a match. Label must be ASCII * @access public */ @@ -151,7 +151,8 @@ class Doku_LexerParallelRegex { * "or" operator. Caches the regex. * Will automatically escape (, ) and / tokens. * - * @param array $patterns List of patterns in order. + * @internal array $_patterns List of patterns in order. + * @return null|string * @access private */ function _getCompoundedRegex() { @@ -231,7 +232,7 @@ class Doku_LexerStateStack { * @param string $start Starting state name. * @access public */ - function Doku_LexerStateStack($start) { + function __construct($start) { $this->_stack = array($start); } @@ -295,10 +296,11 @@ class Doku_Lexer { * @param boolean $case True for case sensitive. * @access public */ - function Doku_Lexer(&$parser, $start = "accept", $case = false) { + function __construct($parser, $start = "accept", $case = false) { $this->_case = $case; + /** @var Doku_LexerParallelRegex[] _regexes */ $this->_regexes = array(); - $this->_parser = &$parser; + $this->_parser = $parser; $this->_mode = new Doku_LexerStateStack($start); $this->_mode_handlers = array(); } @@ -425,11 +427,13 @@ class Doku_Lexer { * Sends the matched token and any leading unmatched * text to the parser changing the lexer to a new * mode if one is listed. - * @param string $unmatched Unmatched leading portion. - * @param string $matched Actual token match. - * @param string $mode Mode after match. A boolean + * @param string $unmatched Unmatched leading portion. + * @param string $matched Actual token match. + * @param bool|string $mode Mode after match. A boolean * false mode causes no change. - * @param int $pos Current byte index location in raw doc + * @param int $initialPos + * @param int $matchPos + * Current byte index location in raw doc * thats being parsed * @return boolean False if there was any error * from the parser. @@ -498,11 +502,12 @@ class Doku_Lexer { * Calls the parser method named after the current * mode. Empty content will be ignored. The lexer * has a parser handler for each mode in the lexer. - * @param string $content Text parsed. - * @param boolean $is_match Token is recognised rather + * @param string $content Text parsed. + * @param boolean $is_match Token is recognised rather * than unparsed data. - * @param int $pos Current byte index location in raw doc + * @param int $pos Current byte index location in raw doc * thats being parsed + * @return bool * @access private */ function _invokeParser($content, $is_match, $pos) { |