Skip to content

Implement without<IDs...>[p] directive#32

Merged
saki7 merged 1 commit intomainfrom
implement-without
Feb 16, 2026
Merged

Implement without<IDs...>[p] directive#32
saki7 merged 1 commit intomainfrom
implement-without

Conversation

@saki7
Copy link
Member

@saki7 saki7 commented Feb 16, 2026

This PR implements the without<IDs...>[p] directive. It is the counterpart to with<ID>(ref)[p] and with_local<T, ID>[p].

without strips out any contexts that match the IDs specified in the argument.

It is extremely useful for stripping unnecessary contexts from a parser type that is intended to be instantiated in a distinct translation unit. Without without, users must specify all the extraneous contexts specified by the full parser definition because IRIS_X4_INSTANTIATE requires the concrete context type. With without, users can shave off all the irrelevant contexts to minify the variations of the instantiated parser type.

Such operation is crucial for real-world grammars and it can often reduce the compile times proportionally.

@saki7 saki7 self-assigned this Feb 16, 2026
@saki7 saki7 added the enhancement New feature or request label Feb 16, 2026
@saki7 saki7 merged commit 639530a into main Feb 16, 2026
13 checks passed
@saki7 saki7 deleted the implement-without branch February 16, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant