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

fix escape sequences #89

Merged
merged 1 commit into from
Jan 16, 2020
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
4 changes: 2 additions & 2 deletions src/genmsg/names.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def package_resource_name(name):
# NAME VALIDATORS

#ascii char followed by (alphanumeric, _, /)
RESOURCE_NAME_LEGAL_CHARS_P = re.compile('^[A-Za-z][\w_\/]*$')
RESOURCE_NAME_LEGAL_CHARS_P = re.compile(r'^[A-Za-z][\w_\/]*$')
def is_legal_resource_name(name):
"""
Check if name is a legal ROS name for filesystem resources
Expand All @@ -131,7 +131,7 @@ def is_legal_resource_name(name):
# '//' check makes sure there isn't double-slashes
return m is not None and m.group(0) == name and not '//' in name

BASE_RESOURCE_NAME_LEGAL_CHARS_P = re.compile('^[A-Za-z][\w_]*$') #ascii char followed by (alphanumeric, _)
BASE_RESOURCE_NAME_LEGAL_CHARS_P = re.compile(r'^[A-Za-z][\w_]*$') #ascii char followed by (alphanumeric, _)
def is_legal_resource_base_name(name):
"""
Validates that name is a legal resource base name. A base name has
Expand Down
2 changes: 1 addition & 1 deletion test/test_genmsg_msgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def sub_test_MsgSpec(types, names, constants, text, full_name, has_header):

# types and names mismatch
try:
MsgSpec(['int32', 'int32'], ['intval'], [], 'int32 intval\int32 y', 'x/Mismatch')
MsgSpec(['int32', 'int32'], ['intval'], [], 'int32 intval\nint32 y', 'x/Mismatch')
assert False, "types and names must align"
except: pass

Expand Down