protected function parseLNumber($str, $attributes, $allowInvalidOctal = false) { try { return LNumber::fromString($str, $attributes, $allowInvalidOctal); } catch (Error $error) { $this->emitError($error); // Use dummy value return new LNumber(0, $attributes); } }
protected function reduceRule397() { $this->semValue = Scalar\LNumber::fromString($this->semStack[$this->stackPos - (1 - 1)], $this->startAttributeStack[$this->stackPos - (1 - 1)] + $this->endAttributes); }
public function provideTestParse() { return [['<?php class Test { function function() {} }', $this->getPrefer5(), [new Stmt\Class_('Test', ['stmts' => [new Stmt\ClassMethod('function')]])]], ['<?php global $$a->b;', $this->getPrefer7(), [new Stmt\Global_([new Expr\Variable(new Expr\PropertyFetch(new Expr\Variable('a'), 'b'))])]], ['<?php $$a[0];', $this->getPrefer5(), [new Expr\Variable(new Expr\ArrayDimFetch(new Expr\Variable('a'), LNumber::fromString('0')))]], ['<?php $$a[0];', $this->getPrefer7(), [new Expr\ArrayDimFetch(new Expr\Variable(new Expr\Variable('a')), LNumber::fromString('0'))]]]; }