Skip to content

Commit

Permalink
Set the proto3 option by default if file specifies proto3 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
PetteriAimonen committed Oct 23, 2016
1 parent 6e22ecd commit f866af7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions generator/nanopb_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,6 +1356,9 @@ def get_nanopb_suboptions(subdesc, options, name):
Globals.matched_namemasks.add(namemask)
new_options.MergeFrom(options)

if hasattr(subdesc, 'syntax') and subdesc.syntax == "proto3":
new_options.proto3 = True

# Handle options defined in .proto
if isinstance(subdesc.options, descriptor.FieldOptions):
ext_type = nanopb_pb2.nanopb
Expand Down

0 comments on commit f866af7

Please sign in to comment.