Changeset View
Changeset View
Standalone View
Standalone View
src/lexer/PhutilLexer.php
Context not available. | |||||
// NOTE: The "\G" assertion is an offset-aware version of "^". | // NOTE: The "\G" assertion is an offset-aware version of "^". | ||||
$rule[0] = '(\\G'.$rule[0].')'.$flags; | $rule[0] = '(\\G'.$rule[0].')'.$flags; | ||||
if (@preg_match($rule[0], '') === false) { | if (@@preg_match($rule[0], '') === false) { | ||||
$error = error_get_last(); | $error = error_get_last(); | ||||
throw new UnexpectedValueException( | throw new UnexpectedValueException( | ||||
pht( | pht( | ||||
Context not available. | |||||
$this->lastState = null; | $this->lastState = null; | ||||
$position = 0; | $position = 0; | ||||
$length = strlen($input); | $length = @strlen($input); | ||||
$tokens = array(); | $tokens = array(); | ||||
$states = array(); | $states = array(); | ||||
Context not available. | |||||
foreach ($state_rules as $rule) { | foreach ($state_rules as $rule) { | ||||
$matches = null; | $matches = null; | ||||
if (!preg_match($rule[0], $input, $matches, 0, $position)) { | if (!@preg_match($rule[0], $input, $matches, 0, $position)) { | ||||
continue; | continue; | ||||
} | } | ||||
list($regexp, $token_type, $next_state, $options) = $rule; | list($regexp, $token_type, $next_state, $options) = $rule; | ||||
$match_length = strlen($matches[0]); | $match_length = @strlen($matches[0]); | ||||
if (!$match_length) { | if (!$match_length) { | ||||
if ($next_state === null) { | if ($next_state === null) { | ||||
throw new UnexpectedValueException( | throw new UnexpectedValueException( | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0