Skip to content

Commit

Permalink
Cleanup and README.
Browse files Browse the repository at this point in the history
  • Loading branch information
eerimoq committed Aug 6, 2020
1 parent 5abbd05 commit 83dc963
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Known limitations:

- Public imports are not implemented.

- Optional fields (added in protobuf 3.12) are not implemented.

Project homepage: https://github.com/eerimoq/pbtools

Documentation: https://pbtools.readthedocs.io
Expand Down
5 changes: 2 additions & 3 deletions pbtools/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ def __init__(self, tokens, namespace):
self.enums = []
self.messages = []
self.oneofs = []
self.maps = []
self.namespace = namespace

for item in tokens[3]:
Expand All @@ -414,13 +413,13 @@ def __init__(self, tokens, namespace):
elif kind == 'oneof':
self.oneofs.append(Oneof(item, sub_namespace))
elif kind == 'map':
self._load_map_field(item, sub_namespace)
self._load_map(item, sub_namespace)
elif kind in ['reserved', ';']:
pass
else:
raise InternalError(kind)

def _load_map_field(self, tokens, sub_namespace):
def _load_map(self, tokens, sub_namespace):
key_type = tokens[2]
value_type = load_message_type(tokens[4])[-1]
name = tokens[6]
Expand Down

0 comments on commit 83dc963

Please sign in to comment.