final class SyntaxException
    extends RuntimeException
Public API: explicitly declared with @visibility public.

Raised where Lemon would report an error in the grammar file.

The message is worded as Lemon words it and says where the problem is.

Reporting where a file is wrongdoctest
$exception = new \LemonParser\SyntaxException('Illegal character on RHS of rule: "?".', new \LemonParser\Ast\Location(3, 12));
    $exception->getMessage() // => 'Illegal character on RHS of rule: "?". at 3:12'
    (string) $exception->location // => "3:12"

Properties§

public Location $location

Methods§

public function __construct(string $message, public Location $location)

Parameters

$messagestringWhat is wrong
$locationLocationWhere it is wrong
Calls 1
  • static-call RuntimeException::__construct() line 30

Test cases 56§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 55

Relations§

Instantiated in 37
Type declarations 1