Esempio n. 1
0
 private function isLiteralISO8601(Token $token)
 {
     return preg_match('/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$/', $token->getValue());
 }
Esempio n. 2
0
 private function getFloat(Token $token)
 {
     $value = $token->getValue();
     if (preg_match('/([^\\d]_[^\\d])|_[eE]|[eE]_|(_$)/', $value)) {
         throw new ParseException('Invalid float number: underscore must be surrounded by at least one digit', $this->currentLine, $token->getValue());
     }
     $value = str_replace('_', '', $value);
     if (preg_match('/^0\\d+/', $value)) {
         throw new ParseException('Invalid float number: leading zeros are not allowed', $this->currentLine, $token->getValue());
     }
     return (double) $value;
 }