Joshua Haberman
b0ed763a41
Fixed some corner cases around empty packages in upb.
...
1. upb now tolerates a present-but-empty package name in a `FileDescriptorProto`.
2. upb now always returns a non-NULL string for `upb_FileDef_Package()`. If the package was empty or missing, the returned string is zero-length. This better matches the proto2 behavior: `proto2::FileDescriptor::package()` always returns a package string, which may be empty.
PiperOrigin-RevId: 460831797
2 years ago
Protobuf Team Bot
46e306bead
Move generator shared support code to common target.
...
PiperOrigin-RevId: 458257330
2 years ago
Protobuf Team Bot
65bde4e75b
upb_Encode() now returns a status value
...
PiperOrigin-RevId: 454740100
2 years ago
Joshua Haberman
12fffeb9c3
Rename CMessage -> Message, to make the change in https://github.com/protocolbuffers/upb/pull/617 work as intended.
...
The previous change did not have the desired effect, because the generated code uses the class named "Message" instead of "CMessage."
There was no real need to use the class "CMessage" instead of "Message." The new name is simpler and will make the previous change work.
PiperOrigin-RevId: 449309343
3 years ago
Joshua Haberman
b034f5d196
Fixed broken test by implementing FieldDescriptor.has_presence.
...
PiperOrigin-RevId: 447124542
3 years ago
Joshua Haberman
ac27e3b317
Remaining fixes to make Python tests pass in google3.
3 years ago
Joshua Haberman
6a94a385f8
Factor out name differences into macros.
3 years ago
Joshua Haberman
0a858bb57a
Factor out name differences into macros.
3 years ago
Joshua Haberman
c56fe27f88
Fix mistake in previous rename: upb_MessageDef_FindFieldByNameWithSize.
3 years ago
Joshua Haberman
1c3d63dc25
Fixed a test by checking for the type of proto.
...
Also labeled a few tests for why we don't pass them.
3 years ago
Joshua Haberman
bb95a18631
Fixed a bug in the enum value map, fixing a few unit tests.
3 years ago
Joshua Haberman
606308c639
Added back missing underscore.
3 years ago
Joshua Haberman
75b6291e40
Renamed upb_FieldType_* -> kUpb_FieldType_*
3 years ago
Joshua Haberman
2bdbfc33e5
Addressed PR comments.
3 years ago
Joshua Haberman
3eeea895dd
Fixed FieldDescriptor test.
3 years ago
Joshua Haberman
0c541f3305
Single encode.
3 years ago
Joshua Haberman
72af9dc0cc
Switch to a single upb_Decode.
3 years ago
Joshua Haberman
499c2cc8b1
upb_extreg, upb_msg
3 years ago
Joshua Haberman
ffdcc46390
Fixed a handful of reference leaks found in a debug build of Python ( #484 )
...
* Fixed some reference leaks.
* Fixed a few reference leaks.
* Fixed a few more memory errors.
* Fixed a few more reference leaks.
* Revert minimal_test.py.
* Re-enable limited API.
* Removed some debugging and spurious changes.
* Addressed PR comments.
3 years ago
Joshua Haberman
1c955f37ce
Mass API rename and clang-reformat ( #485 )
...
* Wave 1: upb_fielddef.
* upb_fielddef itself.
* upb_oneofdef.
* upb_msgdef.
* ExtensionRange.
* upb_enumdef
* upb_enumvaldef
* upb_filedef
* upb_methoddef
* upb_servicedef
* upb_symtab
* upb_defpool_init
* upb_wellknown and upb_syntax_t
* Some constants.
* upb_status
* upb_strview
* upb_arena
* upb.h constants
* reflection
* encode
* JSON decode.
* json encode.
* msg_internal.
* Formatted with clang-format.
* Some naming fixups and comment reformatting.
* More refinements.
* A few more stragglers.
* Fixed PyObject_HEAD with semicolon. Removed TODO entries.
3 years ago
Joshua Haberman
00c106f551
Addressed PR comments.
3 years ago
Joshua Haberman
7a24340a26
Fixed some more tests.
3 years ago
Joshua Haberman
fc725be5bc
Implemented proper unescaping of bytes defaults.
3 years ago
Joshua Haberman
c2209d1a29
Enabled custom options.
3 years ago
Joshua Haberman
e4c88ad35a
Addressed PR comments.
3 years ago
Joshua Haberman
b0f81596be
All tests passing!
3 years ago
Joshua Haberman
4423e917ad
All tests in the repo are passing.
3 years ago
Joshua Haberman
8c5c59a308
Addressed PR comments.
3 years ago
Joshua Haberman
bfc264d098
Moved pointers left and added some comments.
3 years ago
Joshua Haberman
deddc20f0c
Adds implementations for most descriptor objects.
3 years ago
Joshua Haberman
3206b321e1
Added descriptor containers.
3 years ago
Joshua Haberman
cdc9fcd93a
Addressed PR comments.
3 years ago
Joshua Haberman
eec1a45e02
Formatted files with clang-format.
3 years ago
Joshua Haberman
a086aafb6c
Added a minimal test and fixed some bugs.
3 years ago
Joshua Haberman
94ece04552
Initial commit of Python+upb.
3 years ago