예제 #1
0
 /**
  * Skips whitespace in the specified text by advancing an index to
  * the next non-whitespace character.
  * 
  * @param string $text       Text to scan.
  * @param int    &$textIndex Index to begin scanning from.
  * 
  * @return boolean true if the end of the string was reached, false otherwise.
  */
 public static function skipWhiteSpace($text, &$textIndex)
 {
     $textLen = strlen($text);
     while ($textIndex < $textLen && Char::isWhiteSpace($text[$textIndex])) {
         $textIndex++;
     }
     return $textLen == $textIndex;
 }
예제 #2
0
 /**
  * Validate current character is a digit.
  * 
  * @return void
  */
 private function _validateDigit()
 {
     if (!Char::isDigit($this->_ch)) {
         throw $this->_parseError(Messages::expressionLexerDigitExpected($this->_textPos));
     }
 }