Follow-up from "handle comments within IDL structs"
Motivation
Today rosbags
errors-out when trying to parse an IDL file that has a comment //
within a stuct like the one below.
Example IDL file
module my_msgs {
module msg {
struct Msg {
// comment
uint8 value;
};
};
};
Removing the // comment
from the struct above allows rosbags
to parse the IDL file just fine.
Error message
Trying to parse the above IDL with rosbags
you get:
File "/usr/local/lib/python3.8/dist-packages/rosbags/typesys/idl.py", line 603, in get_types_from_idl
return parse_message_definition(VisitorIDL(), text)
File "/usr/local/lib/python3.8/dist-packages/rosbags/typesys/base.py", line 72, in parse_message_definition
raise TypesysError(f'Could not parse: {text!r}') from err
rosbags.typesys.base.TypesysError: Could not parse: 'module my_msgs {\n module msg {\n struct Msg {\n // comment\n uint8 value;\n };\n };\n};\n'
Acceptance Criteria
-
rosbags
can support parsing IDL files with//
comments inside of structs
Edited by Evan Flynn