本文整理汇总了PHP中Token::resolve方法的典型用法代码示例。如果您正苦于以下问题:PHP Token::resolve方法的具体用法?PHP Token::resolve怎么用?PHP Token::resolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Token
的用法示例。
在下文中一共展示了Token::resolve方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resolve
/**
* Resolves all tokens in this scope.
*
* @param int $i The current token index
* @param array $tokens The tokens being parsed
* @throws \gettext\pluralparser\ParseException If this token cannot be resolved
*/
public function resolve(&$i = 0, array &$tokens = null)
{
if (!$this->isResolved()) {
parent::resolve($i, $tokens);
$this->resolve0();
}
}
示例2: resolve
/**
* Removes the next token from the scope.
*
* @param int $i The current token index
* @param array $tokens The tokens being parsed
* @throws \gettext\pluralparser\ParseException If this token cannot be resolved
*/
public function resolve(&$i = 0, array &$tokens = null)
{
if (!$this->isResolved()) {
parent::resolve($i, $tokens);
if ($i + 1 < count($tokens)) {
$this->value = array_splice($tokens, $i + 1, 1)[0];
if (!is_int($this->value)) {
$this->value->resolve($i, $tokens);
}
} else {
throw new \gettext\pluralparser\ParseException('No value to negate');
}
}
}
示例3: resolve
/**
* Removes the left and right tokens from the scope.
*
* @param int $i The current token index
* @param array $tokens The tokens being parsed
* @throws \gettext\pluralparser\ParseException If this token cannot be resolved
*/
public function resolve(&$i = 0, array &$tokens = null)
{
if (!$this->isResolved()) {
parent::resolve($i, $tokens);
if ($i > 0 && $i + 1 < count($tokens)) {
$this->rhs = array_splice($tokens, $i + 1, 1)[0];
$this->lhs = array_splice($tokens, $i - 1, 1)[0];
if (!is_int($this->rhs)) {
$this->rhs->resolve($i, $tokens);
}
$i--;
} else {
throw new \gettext\pluralparser\ParseException($this->operator . 'without arguments');
}
}
}