Clause
← All documentation

Preprocessor

Native C++ reimplementation of OTP epp for the pinned maint-29 source. Boost.Parser handles character rules; shared compiler metadata supplies operator precedence. Expanded tokens are never turned back into source text.

PreprocessorSession returns expanded forms (including implicit -file attributes), structured diagnostics and immutable per-form feature snapshots; features() exposes final session state for the parser. This is an internal interface, not a public stage format. DirectiveReader is the older syntax-only API.

Supported behavior

Compatibility policies

Limits and diagnostics

Defaults (configurable through PreprocessorLimits): 256 expansion levels and 1,000,000 produced tokens per form, include depth 64, expression nesting 256, plus fixed bounds of 4,194,240 bits for integers (OTP's limit on 64-bit hosts) and 1,000,000 bits for bitstring values. Exhaustion is a resource diagnostic, never a silent false condition.

Diagnostics carry a stable category, severity, physical spans, optional logical coordinates and related macro/include spans. Warnings do not fail; errors latch failure while recovery continues at the next form boundary.

Tests

Token goldens (semantic/*.erl.tokens) record epp token kinds, decoded values (floats as binary64 bits) and diagnostic order; wording need not equal OTP. Local semantic/headers/*.hrl fragments replace formerly copied OTP headers. preprocessor_workflow covers real include trees, option order, environment, Latin-1 and condition cases through the CLI.