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
0280477b
Commit
0280477b
authored
Jul 30, 2017
by
Maxime Perrotin
Browse files
Proper fix for range check in arrays
parent
bdbad150
Changes
1
Hide whitespace changes
Inline
Side-by-side
opengeode/ogParser.py
View file @
0280477b
...
...
@@ -1651,13 +1651,13 @@ def primary_index(root, context):
if
not
is_integer
(
idx_bty
):
errors
.
append
(
error
(
root
,
'Index is not an integer'
))
else
:
if
float
(
idx_bty
.
Max
)
>
float
(
r_max
):
if
float
(
idx_bty
.
Max
)
>
=
float
(
r_max
):
errors
.
append
(
error
(
root
,
'Index range [{id1} .. {id2}] '
'outside of range [{r1} .. {r2}]'
.
format
(
id1
=
idx_bty
.
Min
,
id2
=
idx_bty
.
Max
,
r1
=
int
(
r_min
)
+
1
,
r2
=
int
(
r_max
)
+
1
)))
r1
=
max
(
0
,
int
(
r_min
)
-
1
)
,
r2
=
int
(
r_max
)
-
1
)))
elif
float
(
idx_bty
.
Min
)
>
float
(
r_min
):
warnings
.
append
(
warning
(
root
,
'Index higher than range min value'
))
...
...
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