343e4ba4
text: render captured unknown fields, tolerate SGROUP in skip
Two changes close the proto3 text-format conformance suite:
1. `wire.skip_field` learns SGROUP/EGROUP. Wire 3 recurses through
inner tags until a matching EGROUP, with field_id checked against
the SGROUP's id. Callers (codec.lua, lazy.lua, wkt.lua, generated
full-mode `_pb.lua`) now pass the tag's field_id so groups inside
unknown-field skips don't error.
2. `pb.text.encode` walks the captured `_unknown_fields` buffer when
`opts.print_unknown_fields=true` and emits each entry in
TextFormat numeric-field form:
VARINT -> "<id>: <uint64>"
I64/I32 -> "<id>: 0x<hex>"
LEN -> speculative "<id> { <recurse> }"; rolls back to
byte-string form if the inner bytes don't parse as a
sub-message
SGROUP -> "<id> { <recurse> }" through matching EGROUP
`cmd/conformance/core.lua` threads `req.print_unknown_fields` into
`pb.text.encode` so `_Drop` tests drop unknowns and `_Print` tests
render them.
Conformance: text-format suite goes from 2 ✓ / 6 expected fails to
8 ✓ / 0 expected fails. All eight regression tests in
`conformance_test.lua` (one per upstream test, plus the fixed field-1011
tag bytes that were miscomputed earlier) now assert the target output.
Eugene Blikh <bigbes@gmail.com> — 2026-05-16 07:12:46 UTC
Commit 343e4ba4d5e8d8b6e1a046b5db40d8e58ca3eeb7 —
view raw patch
Parent(s):
b1d9c758
| File | Status | + | − |
|---|---|---|---|
PLAN.md
|
M | +9 | -7 |
cmd/conformance/core.lua
|
M | +2 | -1 |
cmd/protoc-gen-tarantool/internal/gen/inline.go
|
M | +2 | -2 |
examples/expected/full/conformance/conformance_pb.lua
|
M | +5 | -5 |
examples/expected/full/hello/hello_pb.lua
|
M | +9 | -9 |
examples/expected/full/protobuf_test_messages/proto3/test_messages_proto3_pb.lua
|
M | +24 | -24 |
runtime/pb/codec.lua
|
M | +2 | -2 |
runtime/pb/lazy.lua
|
M | +2 | -2 |
runtime/pb/text.lua
|
M | +101 | |
runtime/pb/wire.lua
|
M | +30 | -2 |
runtime/pb/wkt.lua
|
M | +9 | -9 |
test/conformance/known_failures_text.txt
|
M | +7 | -22 |
test/conformance_test.lua
|
M | +32 | -40 |