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
90020750
Commit
90020750
authored
Apr 03, 2019
by
Maxime Perrotin
Browse files
Refine error/warning level when testing substrings
parent
6316f933
Changes
1
Hide whitespace changes
Inline
Side-by-side
opengeode/ogParser.py
View file @
90020750
...
...
@@ -2176,11 +2176,15 @@ def primary_substring(root, context):
msg
=
(
'Substring start range could be higher than end range'
' ({}>{})'
.
format
(
max0
,
max1
))
warnings
.
append
(
warning
(
root
,
msg
))
if
int
(
min0
)
>
int
(
receiver_bty
.
Max
)
\
or
int
(
max1
)
>
int
(
receiver_bty
.
Max
):
msg
=
'Substring bounds
[
{}
..{}] outside range [{}..{}]'
.
format
(
min0
,
max1
,
receiver_bty
.
M
in
,
receiver_bty
.
Max
)
if
int
(
min0
)
>
int
(
receiver_bty
.
Max
)
:
# real error: range starts with a clearly out of range value
msg
=
'Substring
left
bounds
(
{}
) bigger than index higher bound '
\
'({})'
.
format
(
m
in
0
,
receiver_bty
.
Max
)
errors
.
append
(
error
(
root
,
msg
))
if
int
(
max1
)
>
int
(
receiver_bty
.
Max
):
msg
=
'Substring right bound ({}) bigger than index higher bound '
\
'({})'
.
format
(
max1
,
receiver_bty
.
Max
)
warnings
.
append
(
warning
(
root
,
msg
))
else
:
msg
=
'Substring can only be applied to types SequenceOf or String'
errors
.
append
(
error
(
root
,
msg
))
...
...
Write
Preview
Markdown
is supported
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