startLexing() public method

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
Exemplo n.º 1
0
 public function startLexing($code, ErrorHandler $errorHandler = null)
 {
     $this->inObjectAccess = false;
     parent::startLexing($code, $errorHandler);
     if ($this->requiresEmulation($code)) {
         $this->emulateTokens();
     }
 }
Exemplo n.º 2
0
 public function startLexing($code)
 {
     $this->inObjectAccess = false;
     $preprocessedCode = $this->preprocessCode($code);
     parent::startLexing($preprocessedCode);
     if ($preprocessedCode !== $code) {
         $this->postprocessTokens();
     }
 }
Exemplo n.º 3
0
 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;
 }