2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit db4caa01 authored by eckhart's avatar eckhart
Browse files

compile.Compiler.method_name: assert for proper node names ('\w+$')

parent 73c9aa65
...@@ -150,6 +150,7 @@ class Compiler: ...@@ -150,6 +150,7 @@ class Compiler:
>>> Compiler.method_name('expression') >>> Compiler.method_name('expression')
'on_expression' 'on_expression'
""" """
assert re.match(r'\w+$', node_name)
return 'on_' + node_name return 'on_' + node_name
def compile_children(self, node: Node) -> StrictResultType: def compile_children(self, node: Node) -> StrictResultType:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment