You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a c++ project where we use a lcm message with a variable named 'pass'. There is no problem, but now we wanne use this messages with python too, but cant use them because of reserved language keywords.
"""LCM type definitionsThis file automatically generated by lcm.DO NOT MODIFY BY HAND!!!!"""try:
importcStringIO.StringIOasBytesIOexceptImportError:
fromioimportBytesIOimportstructclassexample_t(object):
__slots__= ["name", "pass"]
__typenames__= ["string", "boolean"]
__dimensions__= [None, None]
def__init__(self):
self.name=""self.pass=False
...
But because of the reserved keyword, its not a valid python file:
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
Type "copyright", "credits" or "license"for more information.
IPython 5.8.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.%quickref -> Quick reference.help -> Python's own help system.
object? -> Details about 'object', use 'object??'for extra details.
In [1]: from example_t import example_t
File "example_t.py", line 21
self.pass = False
^
SyntaxError: invalid syntax
In [2]:
Maybe lcm-gen could check for keywords of supported languages before it translates it.
Kind regards
The text was updated successfully, but these errors were encountered:
We have a c++ project where we use a lcm message with a variable named 'pass'. There is no problem, but now we wanne use this messages with python too, but cant use them because of reserved language keywords.
eg.: example_t.lcm
lcm-gen generates a python class without failure
But because of the reserved keyword, its not a valid python file:
Maybe lcm-gen could check for keywords of supported languages before it translates it.
Kind regards
The text was updated successfully, but these errors were encountered: