Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
c87ec835
Commit
c87ec835
authored
Jun 20, 2014
by
Maxime Perrotin
Browse files
No division by 0 in type checks
parent
8e692deb
Changes
2
Hide whitespace changes
Inline
Side-by-side
ogParser.py
View file @
c87ec835
...
...
@@ -1313,8 +1313,8 @@ def expression(root, context):
'Max'
:
str
(
float
(
left
.
Max
)
-
float
(
right
.
Max
))}
expr
.
exprType
=
type
(
'Minus'
,
(
basic
,),
attrs
)
elif
isinstance
(
expr
,
ogAST
.
ExprDiv
):
attrs
=
{
'Min'
:
str
(
float
(
left
.
Min
)
/
float
(
right
.
Min
)),
'Max'
:
str
(
float
(
left
.
Max
)
/
float
(
right
.
Max
))}
attrs
=
{
'Min'
:
str
(
float
(
left
.
Min
)
/
(
float
(
right
.
Min
)
or
1
)
),
'Max'
:
str
(
float
(
left
.
Max
)
/
(
float
(
right
.
Max
)
or
1
)
)}
expr
.
exprType
=
type
(
'Div'
,
(
basic
,),
attrs
)
elif
isinstance
(
expr
,
(
ogAST
.
ExprMod
,
ogAST
.
ExprRem
)):
attrs
=
{
'Min'
:
right
.
Min
,
'Max'
:
right
.
Max
}
...
...
tests/regression/test13/dataview-uniq.asn
View file @
c87ec835
TASTE-Dataview DEFINITIONS ::=
BEGIN
Int ::= INTEGER(
-100
0..1000)
Int ::= INTEGER(0..1000)
Bool ::= BOOLEAN
Float ::= REAL (
-10000.
0..10000.0)
Float ::= REAL (0..10000.0)
END
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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