final class CodeBlock
Public API: explicitly declared with @visibility public.

Host code written between braces, kept as written.

The braces are not part of the code. Lemon never interprets the code beyond finding its closing brace, and neither does the tree.

Reading the action of a ruledoctest
$file = (new \LemonParser\Parser())->parse("expr(A) ::= NUM(B). { A = B; }\n");
    $file->rules()[0]->code?->code // => " A = B; "

Properties§

public string $code
public Location $location

Methods§

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

Parameters

$codestringThe text between the braces
$locationLocationWhere the opening brace is

Test cases 7§

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 6

Relations§

Instantiated in 1
Type declarations 2