Defined in header <cparse/Parser.hh>

protected:
void leaveScope() noexcept;

Decrements the internal open-scope depth counter if it is greater than zero; no-op otherwise. Paired with enterScope() on the matching-opener consumption path.

Parameters

None.

Return value

(none)

Exceptions

noexcept.

Notes

Call only from the code path that actually consumed a closer. Never from a destructor, never from an exception handler. See enterScope for the full rationale — in short, the depth must stay non-zero during EOF unwinding so that parse() can distinguish clean EOF from a truncated file.

The > 0 guard makes double-decrement harmless — an extra leaveScope() call cannot make the counter go negative. This is a safety net, not a licence to leave the pairing loose: paired enterScope/leaveScope is still the invariant.

See also