final class ExpressionGroupingRule
    implements RewriteRule

Preserves derived operand grouping where the source grammar permits parenthesized expressions. This also prevents non-associative operators from being serialized as forbidden flat chains.

Methods§

public function __construct(
    private non-empty-list<string> $expressions,
    private string $source,
    private string $open = '(',
    private string $close = ')',
)

Parameters

$expressionsnon-empty-list<string>Expression families with a parenthesized primary production
$sourcestring
$openstring
$closestring
public function ranges(TerminalSequence $sequence): array<int, array{int, int}>

Private surface 4§

Implementation details, listed for orientation only.

private non-empty-list<string> $expressions
private string $source
private string $open = '('
private string $close = ')'

Test cases 11§

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

Dedicated tests 7
Other tests reaching this symbol 4

Relations§

Instantiated in 1