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
8f5eff7c
Commit
8f5eff7c
authored
May 15, 2016
by
Maxime Perrotin
Browse files
Fix range check
Range checks for operator DIV and MINUS were incorrect as reported by Alexandre Esteves
parent
ac30fa51
Changes
1
Hide whitespace changes
Inline
Side-by-side
opengeode/ogParser.py
View file @
8f5eff7c
...
...
@@ -1260,12 +1260,12 @@ def arithmetic_expression(root, context):
'Max'
:
str
(
float
(
left
.
Max
)
*
float
(
right
.
Max
))}
expr
.
exprType
=
type
(
'Mul'
,
(
basic
,),
attrs
)
elif
isinstance
(
expr
,
ogAST
.
ExprMinus
):
attrs
=
{
'Min'
:
str
(
float
(
left
.
Min
)
-
float
(
right
.
M
in
)),
'Max'
:
str
(
float
(
left
.
Max
)
-
float
(
right
.
M
ax
))}
attrs
=
{
'Min'
:
str
(
float
(
left
.
Min
)
-
float
(
right
.
M
ax
)),
'Max'
:
str
(
float
(
left
.
Max
)
-
float
(
right
.
M
in
))}
expr
.
exprType
=
type
(
'Minus'
,
(
basic
,),
attrs
)
elif
isinstance
(
expr
,
ogAST
.
ExprDiv
):
attrs
=
{
'Min'
:
str
(
float
(
left
.
Min
)
/
(
float
(
right
.
M
in
)
or
1
)),
'Max'
:
str
(
float
(
left
.
Max
)
/
(
float
(
right
.
M
ax
)
or
1
))}
attrs
=
{
'Min'
:
str
(
float
(
left
.
Min
)
/
(
float
(
right
.
M
ax
)
or
1
)),
'Max'
:
str
(
float
(
left
.
Max
)
/
(
float
(
right
.
M
in
)
or
1
))}
expr
.
exprType
=
type
(
'Div'
,
(
basic
,),
attrs
)
elif
isinstance
(
expr
,
(
ogAST
.
ExprMod
,
ogAST
.
ExprRem
)):
attrs
=
{
'Min'
:
right
.
Min
,
'Max'
:
right
.
Max
}
...
...
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