Commit fc0c0961 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add missing case in rename_everything

when flattening model, the access to fields was not properly prefixed
for variables declared in substates
parent ca6ccd36
......@@ -141,6 +141,9 @@ The background pattern was downloaded from www.subtlepatterns.com
Changelog
=========
2.0.4 (03/2018)
- Fix issue with variable prefix in nested states (in generated code)
2.0.3 (03/2018)
- Optimize calls to asn1scc
- Fix paste error when input symbol is selected
......
......@@ -1729,13 +1729,14 @@ def _prim_substring(prim):
@expression.register(ogAST.PrimSelector)
def _prim_selector(prim):
''' Selector (field access with '!' separation) '''
''' Selector (field access with '!' or '.' separation) '''
stmts, ada_string, local_decl = [], '', []
receiver = prim.value[0]
field_name = prim.value[1]
receiver_stms, receiver_string, receiver_decl = expression(receiver)
ada_string = receiver_string
stmts.extend(receiver_stms)
local_decl.extend(receiver_decl)
......
......@@ -531,6 +531,12 @@ def _rename_substring(ast, from_name, to_name):
rename_everything(each, from_name, to_name)
@rename_everything.register(ogAST.PrimSelector)
def _rename_primselector(ast, from_name, to_name):
''' Rename variable name in field access (a.b.c) '''
rename_everything(ast.value[0], from_name, to_name)
@rename_everything.register(ogAST.PrimVariable)
def _rename_path(ast, from_name, to_name):
''' Ultimate seek point for the renaming: primary path/variables '''
......
......@@ -139,7 +139,7 @@ except ImportError:
__all__ = ['opengeode', 'SDL_Scene', 'SDL_View', 'parse']
__version__ = '2.0.3'
__version__ = '2.0.4'
if hasattr(sys, 'frozen'):
# Detect if we are running on Windows (py2exe-generated)
......
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