diff --git a/proto/ei-scanner b/proto/ei-scanner index 4aefd0a..11edb85 100755 --- a/proto/ei-scanner +++ b/proto/ei-scanner @@ -92,6 +92,10 @@ class Argument: For an argument referenced by another argument of type "new_id", this field points to the other argument that references this argument. """ + allow_null: bool = attr.ib(default=False) + """ + For an argument of type string, specify if the argument may be NULL. + """ @property def signature(self) -> str: @@ -137,6 +141,7 @@ class Argument: summary: str = "", enum: Optional["Enum"] = None, interface: Optional["Interface"] = None, + allow_null: bool = False, ) -> "Argument": return cls( name=name, @@ -144,6 +149,7 @@ class Argument: summary=summary, enum=enum, interface=interface, + allow_null=allow_null, ) @@ -709,12 +715,15 @@ class ProtocolParser(xml.sax.handler.ContentHandler): f"Failed to find enum '{intf.name}.{enum_name}'", self.location, ) + + allow_null = attrs.get("allow-null", "false") == "true" arg = Argument.create( name=name, protocol_type=proto_type, summary=summary, enum=enum, interface=interface, + allow_null=allow_null, ) self.current_message.add_argument(arg) if proto_type == "new_id":