Commit 56885c2f authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Parser/Clipboard fix

parent 17c47925
......@@ -69,11 +69,9 @@ def copy_branch(top_level_item):
nextstate=False, recursive=True))
item_ast, terminators = top_level_item.get_ast(pr_text)
LOG.debug('COPY ' + str(item_ast))
# Set absolute (scene) coordinates of top level item
scene_pos = top_level_item.scenePos()
item_ast.abs_x = scene_pos.x()
item_ast.abs_y = scene_pos.y()
if not item_ast:
LOG.error('ERROR - copy failed')
return
branch = [item_ast]
......
......@@ -1503,14 +1503,18 @@ def selector_expression(root, context):
warnings.extend(receiver_warn)
field_name = root.children[1].text.replace('_', '-').lower()
for n, f in receiver_bty.Children.viewitems():
if n.lower() == field_name:
node.exprType = f.type
break
else:
msg = 'Field "{}" not found in expression {}'.format(field_name)
errors.append(error(root, msg))
try:
for n, f in receiver_bty.Children.viewitems():
if n.lower() == field_name:
node.exprType = f.type
break
else:
msg = 'Field "{}" not found in expression {}'.format(field_name)
errors.append(error(root, msg))
except AttributeError:
# When parsing for syntax or copy-paste, receiver_bty may
# not be found
pass
node.value = [receiver, field_name.replace('-', '_').lower()]
......
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