Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat \t as whitespace #557

Merged
merged 1 commit into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions rosidl_adapter/rosidl_adapter/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,9 @@ def parse_message_string(pkg_name, msg_name, message_string):
for line in lines:
line = line.rstrip()

# replace tabs with spaces
line = line.replace('\t', ' ')

# ignore empty lines
if not line:
# file-level comments stop at the first empty line
Expand Down
2 changes: 1 addition & 1 deletion rosidl_adapter/test/test_parse_message_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_parse_message_file():
try:
filename = os.path.join(path, 'Foo.msg')
with open(filename, 'w') as handle:
handle.write('bool foo')
handle.write('bool \tfoo')
msg_spec = parse_message_file('pkg', filename)

assert len(msg_spec.fields) == 1
Expand Down