Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
56885c2f
Commit
56885c2f
authored
Jul 31, 2014
by
Maxime Perrotin
Browse files
Parser/Clipboard fix
parent
17c47925
Changes
2
Hide whitespace changes
Inline
Side-by-side
Clipboard.py
View file @
56885c2f
...
...
@@ -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
]
...
...
ogParser.py
View file @
56885c2f
...
...
@@ -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
()]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment