PEGO

G160: Typed Operators Rule Line Bodies

Eligible typed operand, operator and skip matchers can inline structural bodies instead of dispatching each expression.

Mechanism and Invariants

Each line owns its capture scope. Runtime precedence, longest-match selection, frames and action finalization remain unchanged. This cut-free route excludes incompatible captures/layouts; framed-cut and recovery extensions have their own selectors.

Scope and State

Applied by default only to eligible generated typed Go bodies. Node parsing/recognition, closure, VMs and TypeScript retain their separate routes.

Reference Control

No generation option selects an alternative for this mechanism. Typed Go output comes from the Flow IR printer, and its generated parsers are compared with the engine oracle in the internal/engine tests.

Evidence and Implementation

Record 080 uses five same-generator direct/general pairs. Large action/capture line fixtures measure 0.891 CodePoints and 0.940 Bytes with unchanged allocations. Small action cases overlap parity, and large calculator Bytes also overlaps. The effect is line-body dispatch with the runtime fixed, not longest-attempt allocation or arbitrary Operators Rule grammars.

Evidence records: 080.

Source owners: typed structural emitter, framed body emission.

The comparison policy distinguishes same-source controls, historical changes and full checkpoints.

Related mechanisms: E030, G170, G180, G190.

Optimization Catalog