2015-03-25 19:10:09 -04:00
|
|
|
# test syntax errors for uPy-specific decorators
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
|
2015-03-25 19:10:09 -04:00
|
|
|
def test_syntax(code):
|
|
|
|
try:
|
|
|
|
exec(code)
|
|
|
|
except SyntaxError:
|
|
|
|
print("SyntaxError")
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
|
2015-03-25 19:10:09 -04:00
|
|
|
# invalid micropython decorators
|
|
|
|
test_syntax("@micropython.a\ndef f(): pass")
|
|
|
|
test_syntax("@micropython.a.b\ndef f(): pass")
|