spec(v1.0): rename @table → @dataset, add @proto, expand reserved names#15
Merged
Conversation
Implements the three one-time spec changes from the protowire v1.0
freeze line (STABILITY.md) in lockstep with the other v1.0 ports.
Hard cutover, no alias period; v1.0 is itself the major bump.
Public API rename surface:
Ast::TableDirective → Ast::DatasetDirective
Ast::TableRow → Ast::DatasetRow
class TableReader → class DatasetReader
Result::Tables() → Result::Datasets()
Result::AddTable() → Result::AddDataset()
TokenKind::kAtTable → kAtDataset; + kAtProto (new)
Ast::ProtoDirective + Ast::ProtoShape (kAnonymous/kNamed/
kSource/kDescriptor) (new)
Document::protos / Result::Protos() / Result::AddProto() (new)
IsFutureReservedDirective(name) from schema.h (new)
Source files renamed:
include/protowire/pxf/table_reader.h → dataset_reader.h
src/pxf/table_reader.cc → dataset_reader.cc
test/pxf_table_reader_test.cc → pxf_dataset_reader_test.cc
New: test/pxf_proto_directive_test.cc with 11 cases covering all
four @proto body shapes, anonymous binding, multi-@proto, nested-
brace bodies, reserved-name rejection, @type coexistence.
@dataset's row message type is now optional in the AST (binding to
an anonymous @proto). Lexer::RepositionTo(int) added so the parser
can skip past an @proto brace-body whose interior is protobuf
source rather than PXF.
CMake project VERSION bumped 0.75.0 → 1.0.0.
ctest: 229 tests, 0 failures.
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
CI's format-check flagged 25 violations across 7 files touched by the rename / @proto addition. Re-ran clang-format -i (LLVM 22.1.5 from Homebrew) over the affected files; ctest still green (230/230). No behavioural change.
Adds targeted coverage for the v1.0 additions previously below CI's patch threshold (60.9% with 102 lines missing). Adds 12 new tests to pxf_proto_directive_test.cc (now 23 total, 241 across the suite): - ProtoFast fixture mirroring PxfDirectiveFast — drives consume- ProtoDirective + capture_brace_body on the fast path via Unmarshal / UnmarshalFull against test.proto's AllTypes. Covers all four body shapes (anonymous, named, source, descriptor), nested-brace bodies, multi-@proto, three error paths (bad-shape, named-missing-brace, anonymous-unmatched-brace), and a reserved-directive-name rejection. Exercises Result::AddProto / Result::Protos() accessors along the way. - ProtoShape.NameLookup — covers ProtoShapeName for all four enum values. Adds the previously-declared-but-undefined ProtoShapeName implementation to src/pxf/ast.cc. ctest: 241 tests, 0 failures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the three one-time spec changes from the protowire v1.0 freeze line (STABILITY.md) in lockstep with the other v1.0 ports.
@table→@dataset(draft §3.4.4). Hard cutover, no alias period.@protodirective added (draft §3.4.5). Four body shapes lexically distinguished (anonymous, named, source, descriptor). Descriptor form is the MUST-support shape; this port supports all four.Public API rename surface
Ast::TableDirectiveAst::DatasetDirectiveAst::TableRowAst::DatasetRowclass TableReaderclass DatasetReaderResult::Tables()Result::Datasets()Result::AddTable()Result::AddDataset()TokenKind::kAtTablekAtDatasetAst::ProtoDirective+Ast::ProtoShape(new)Document::protos+Result::Protos()+Result::AddProto()(new)TokenKind::kAtProto(new)IsFutureReservedDirective(name)fromschema.h(new)Source files renamed:
include/protowire/pxf/table_reader.h→dataset_reader.hsrc/pxf/table_reader.cc→dataset_reader.cctest/pxf_table_reader_test.cc→pxf_dataset_reader_test.cc@dataset's row message type is now optional in the AST — binding to an anonymous@protoper draft §3.4.4 Anonymous binding.Lexer::RepositionTo(int)added so the parser can skip past an@protobrace-body whose interior is protobuf source rather than PXF.Test plan
0.75.0→1.0.0cmake --build buildclean (no errors in our code; absl/protobuf nullability warnings from headers are pre-existing)ctest: 229 tests, 0 failurestest/pxf_proto_directive_test.ccwith 11 cases covering all four body shapes, anonymous binding, multi-@proto, nested-brace bodies, reserved-name rejection,@typecoexistenceCompanion releases (v1.0 lockstep):
After this merges + tags v1.0.0,
protowire-python(which wraps this port via nanobind FFI) can land its v1.0 update.