Skip to content

Replace custom parser with Protoc generation#1

Merged
semtexzv merged 2 commits intomainfrom
claude/replace-parser-protoc-01Pz3UoAfTnmoD9SLucGdAKZ
Dec 19, 2025
Merged

Replace custom parser with Protoc generation#1
semtexzv merged 2 commits intomainfrom
claude/replace-parser-protoc-01Pz3UoAfTnmoD9SLucGdAKZ

Conversation

@semtexzv
Copy link
Owner

@semtexzv semtexzv commented Dec 7, 2025

No description provided.

…generation

This major refactoring removes the custom nom-based parser from protokit
and simplifies the code generation pipeline to work directly with protoc's
FileDescriptorSet output.

Key changes:
- Remove protokit_proto crate from the workspace
- Remove parser and protoc feature flags from protokit_build
- Create new DescriptorPool as a thin overlay on FileDescriptorSet
- Rewrite code generation to work directly with protobuf descriptors
- Simplify grpc.rs to use the new pool-based approach
- Remove unused deps.rs and tabular.rs files
- Update conformance and gendesc tools to use the simplified API

The new architecture:
1. protoc generates FileDescriptorSet with fully resolved type names
2. DescriptorPool indexes types by FQN and detects circular references
3. CodeGenerator works directly with protobuf descriptor types

This eliminates the complexity of the custom parser and AST translation
layer while leveraging protoc's robust name resolution.
Fixed issues in merge_repeated:
- Allow implicit whitespace separators in lists (e.g., [1 2 3])
- Allow semicolons as separators in lists
- Check if comma is followed by field name before continuing to parse values
  This fixes comma-separated field syntax like "vals: 1, vals: 2"

Removed repro test files that were only used for debugging:
- repro_ext.rs
- repro_list.rs
- repro_p2.rs
- repro_sep.rs
@semtexzv semtexzv merged commit 901c4f1 into main Dec 19, 2025
1 check failed
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.

2 participants