spec(v1.0): rename @table → @dataset, add @proto, expand reserved names#16
Merged
Conversation
Implements the three one-time spec changes from the protowire v1.0 freeze line (STABILITY.md in the spec repo): - @table directive renamed to @dataset (draft §3.4.4). Same semantics; v1 reserves @table for a future storage-definition meaning. Hard cutover — no alias period. - @proto directive added (draft §3.4.5). Four body shapes lexically distinguished: anonymous { ... }, named pkg.Type { ... }, source """...""", descriptor b"...". Descriptor form is mandatory per spec; the other three are QoI (all four supported). Anonymous @proto is consumed one-shot by the next typed-binding directive. - Reserved directive name list expanded from 5 to 13 (draft §3.4.6). Parser + decoder reject @table, @Datasource, @view, @procedure, @function, @permissions as spec-reserved. Public API rename surface: TableDirective → DatasetDirective TableRow → DatasetRow TableReader → DatasetReader Document.tables → Document.datasets Result.tables() → Result.datasets() TokenKind.AT_TABLE → AT_DATASET; + AT_PROTO (new) ProtoDirective + ProtoShape (new) Document.protos / Result.protos() (new) FUTURE_RESERVED_DIRECTIVES export from schema.ts (new) Source files renamed: src/pxf/table_reader.ts → dataset_reader.ts src/pxf/table_reader.test.ts → dataset_reader.test.ts New: src/pxf/proto-directive.test.ts with 17 cases covering all four body shapes, anonymous binding, multi-@proto, nested-brace bodies, reserved-name rejection (per name), @type coexistence. @dataset's row message type is now optional in the AST (binding to an anonymous @proto). Lexer.repositionTo(target) added so the parser can skip past an @proto brace-body whose interior is protobuf source rather than PXF. findMatchingBrace and decodeBase64 exported from parser.ts for reuse by the decoder. DatasetReader's internal byte-scanner updated for the new keyword length (@dataset is 8 chars, was 6 for @table). 395 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):
@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.@table,@datasource,@view,@procedure,@function,@permissions.Public API rename surface
TableDirectiveDatasetDirectiveTableRowDatasetRowTableReaderDatasetReaderDocument.tablesDocument.datasetsResult.tables()Result.datasets()TokenKind.AT_TABLEAT_DATASETProtoDirective+ProtoShape(new)Document.protos+Result.protos()(new)TokenKind.AT_PROTO(new)FUTURE_RESERVED_DIRECTIVESexport fromschema.ts(new)Source files
table_reader.ts/table_reader.test.tsrenamed todataset_reader.*. `DatasetReader`'s internal byte-scanner updated for the new keyword length (@datasetis 8 chars vs@table's 6).@dataset's row message type is now optional in the AST — binding to an anonymous@protoper draft §3.4.4 Anonymous binding.Lexer.repositionTo(target)added so the parser can skip past an@protobrace-body whose interior is protobuf source rather than PXF.Test plan
Companion PRs:
Next: editor grammar updates (VS Code + JetBrains both embed parsers from this port and protowire-java).