@@ 429-436 (lines=8) @@ | ||
426 | } |
|
427 | $token .= $this->str[$this->last]; |
|
428 | if (($this->last + 1 === $this->len) || (Context::isSeparator($this->str[$this->last + 1]))) { |
|
429 | if (($flags = Context::isKeyword($token))) { |
|
430 | $ret = new Token($token, Token::TYPE_KEYWORD, $flags); |
|
431 | $iEnd = $this->last; |
|
432 | ||
433 | // We don't break so we find longest keyword. |
|
434 | // For example, `OR` and `ORDER` have a common prefix `OR`. |
|
435 | // If we stopped at `OR`, the parsing would be invalid. |
|
436 | } |
|
437 | } |
|
438 | } |
|
439 | ||
@@ 524-527 (lines=4) @@ | ||
521 | ||
522 | for ($j = 1; $j < Context::OPERATOR_MAX_LENGTH && $this->last < $this->len; ++$j, ++$this->last) { |
|
523 | $token .= $this->str[$this->last]; |
|
524 | if ($flags = Context::isOperator($token)) { |
|
525 | $ret = new Token($token, Token::TYPE_OPERATOR, $flags); |
|
526 | $iEnd = $this->last; |
|
527 | } |
|
528 | } |
|
529 | ||
530 | $this->last = $iEnd; |