コード例 #1
0
ファイル: Parser.php プロジェクト: runekaagaard/snowscript
 protected function yyn303($line, $docComment)
 {
     $this->yyval = new PHPParser_Node_Scalar_LNumber(PHPParser_Node_Scalar_LNumber::parse($this->yyastk[$this->yysp - (1 - 1)]), $line, $docComment);
 }
コード例 #2
0
 protected function yyn305($attributes)
 {
     $this->yyval = new PHPParser_Node_Scalar_LNumber(PHPParser_Node_Scalar_LNumber::parse($this->yyastk[$this->stackPos - (1 - 1)]), $attributes);
 }
 private function createNumber($number)
 {
     if (is_int($number)) {
         $n = new \PHPParser_Node_Scalar_LNumber($number);
         $n->setAttribute('type', $this->registry->getNativeType('integer'));
     } else {
         if (is_double($number)) {
             $n = new \PHPParser_Node_Scalar_DNumber($number);
             $n->setAttribute('type', $this->registry->getNativeType('double'));
         } else {
             throw new \InvalidArgumentException('Invalid number: ' . var_export($number, true));
         }
     }
     return $n;
 }