7ec8f2b4
text: add pb.text.decode and wire it into conformance dispatch
Hand-written recursive-descent parser for the textproto grammar
covering every bucket the proto3 conformance suite exercises:
decimal/hex/octal integer literals with full 32/64-bit range checks,
float specials (inf/infinity/nan any case, oversize exponents
saturating to ±inf, underflows to ±0), C-style + \u/\U string escapes
with adjacent-literal concat and surrogate rejection, aggregate {} /
<> bodies, repeated short-form `[a, b, c]`, `key: K value: V` map
entries, the `[type.googleapis.com/...]` inline Any form alongside
the direct `type_url:`/`value:` form, enum-by-name-or-number,
reserved-name silent drop, numeric-field-ID tolerance, and
duplicate-singular-field rejection.
Plugin gains a small reserved_names emitter so the parser can match
mainline TextFormat::Parser's "silently drop reserved" rule. The Any
WKT descriptor advertises its real fields (type_url + string,
value + bytes) so the generic body walker can populate it directly
when the input doesn't use the inline-URL form.
cmd/conformance/core.lua stops short-circuiting text_payload to
`skipped` and runs it through pb.text.decode. The proto3 TextFormat
input suite climbs from 8 ✓ / 426 skipped to 406 ✓ / 18 skipped / 10
expected failures. The 10 surviving failures all share one cause
(proto3 -0.0 elision in the codec, not a parser bug — documented in
test/conformance/known_failures_text.txt). Binary+JSON conformance
holds at 1478 ✓. 591 unit tests pass across both codegen modes.
Closes the text-conformance-output branch.
Eugene Blikh <bigbes@gmail.com> — 2026-05-16 15:43:52 UTC
Commit 7ec8f2b488e27723ebff9b5eea9587d3a854414b —
view raw patch
Parent(s):
bd0709dd
| File | Status | + | − |
|---|---|---|---|
PLAN.md
|
M | +16 | -1 |
cmd/conformance/core.lua
|
M | +5 | -2 |
cmd/protoc-gen-tarantool/internal/gen/gen.go
|
M | +18 | |
examples/expected/full/protobuf_test_messages/proto3/test_messages_proto3_pb.lua
|
M | +3 | |
examples/expected/runtime/protobuf_test_messages/proto3/test_messages_proto3_pb.lua
|
M | +3 | |
runtime/pb/text.lua
|
M | +965 | -1 |
runtime/pb/wkt.lua
|
M | +21 | -1 |
test/conformance/known_failures_text.txt
|
M | +27 | -7 |
test/conformance_test.lua
|
M | +135 | -4 |
test/text_decode_test.lua
|
A | +248 |