This function does not throw if lexing errors occur. Instead, errors may be retrieved using
the getErrors() method.
public startLexing ( string $code, phpparser\ErrorHandler $errorHandler = null ) | ||
$code | string | The source code to lex |
$errorHandler | phpparser\ErrorHandler | Error handler to use for lexing errors. Defaults to ErrorHandler\Throwing |
public function startLexing($code, ErrorHandler $errorHandler = null) { $this->inObjectAccess = false; parent::startLexing($code, $errorHandler); if ($this->requiresEmulation($code)) { $this->emulateTokens(); } }
public function startLexing($code) { $this->inObjectAccess = false; $preprocessedCode = $this->preprocessCode($code); parent::startLexing($preprocessedCode); if ($preprocessedCode !== $code) { $this->postprocessTokens(); } }
public function startLexing($code) { $this->inObjectAccess = false; $preprocessedCode = $this->preprocessCode($code); parent::startLexing($preprocessedCode); if ($preprocessedCode !== $code) { $this->postprocessTokens(); } // Set code property back to the original code, so __halt_compiler() // handling and (start|end)FilePos attributes use the correct offsets $this->code = $code; }