Skip to content

refactor: Make the parser selectable via --parser - #109

Merged
sbernauer merged 8 commits into
mainfrom
refactor/selectable-parser
Oct 4, 2026
Merged

sbernauer merged 8 commits into
mainfrom
refactor/selectable-parser

Conversation

@sbernauer

Copy link
Copy Markdown
Owner

No description provided.

sbernauer and others added 5 commits October 4, 2026 17:44
The server picks the parser per connection, so further parsers can be
offered via the new `--parser` option. For now there's only `original`,
which stays the default.

There's no dynamic dispatch: Server::start spawns a separate task type per
parser, and handle_connection is generic over it. So every connection loop
is compiled on its own, exactly as if the parser was hardcoded.

ParserKind lives in breakwater-parser, which owns the parsers. Its
clap::ValueEnum is derived behind a new optional `clap` feature, which
breakwater enables. The C bindings stay clap-free.

The server tests take the parser as a parameter, so they can run against
every parser.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The `--advertised-endpoint` value name, the `--network-buffer-size` text and
the two web frame compression options had drifted from the actual help.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ParserKind is renamed to ParserImplementation, with docs on what each
parser is good at.

`--parser refactored` selects RefactoredParser. It doesn't implement
PXMULTI, so ParserImplementation::check_supported() rejects it at startup
when binary-sync-pixels is enabled. refactored.rs states that itself.

The server tests run against both parsers and all pass, including PB and
alpha.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sbernauer
sbernauer marked this pull request as ready for review October 4, 2026 16:06
@sbernauer
sbernauer merged commit fb576e0 into main Oct 4, 2026
11 checks passed
sbernauer added a commit that referenced this pull request Oct 4, 2026
The parser selection from main (#109) replaces the spike's own version:
ParserKind becomes ParserImplementation with an added `Fear` variant. Its
check_supported() asks fear::UNSUPPORTED_ENABLED_FEATURE, and the server
and the general server tests got their Fear arms. The PB tests stay
without Fear, as it doesn't support the binary commands.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant