Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kumir2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kumir
kumir2
Commits
da690d13
Commit
da690d13
authored
Jan 21, 2013
by
Victor Yacovlev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved error underline for loop declaration
parent
572b154e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
src/plugins/kumiranalizer/syntaxanalizer.cpp
src/plugins/kumiranalizer/syntaxanalizer.cpp
+15
-13
No files found.
src/plugins/kumiranalizer/syntaxanalizer.cpp
View file @
da690d13
...
...
@@ -1099,36 +1099,38 @@ void SyntaxAnalizerPrivate::parseLoopBegin(int str)
int
toIndex
=
st
.
data
.
indexOf
(
toLexem
);
int
stepIndex
=
st
.
data
.
indexOf
(
stepLexem
);
QString
err
=
""
;
if
(
fromIndex
!=-
1
&&
forIndex
!=-
1
&&
fromIndex
-
forIndex
==
1
)
{
forLexem
->
error
=
_
(
"No loop variable"
);
return
;
err
=
_
(
"No loop variable"
);
}
if
(
toIndex
!=-
1
&&
fromIndex
>
toIndex
)
{
toLexem
->
error
=
_
(
"'to' earler then 'from'"
);
return
;
err
=
_
(
"'to' earler then 'from'"
);
}
if
(
fromIndex
==-
1
&&
toIndex
!=-
1
)
{
toLexem
->
error
=
_
(
"No 'from' before 'to'"
);
return
;
err
=
_
(
"No 'from' before 'to'"
);
}
if
(
fromIndex
==-
1
&&
toIndex
==-
1
)
{
forLexem
->
error
=
_
(
"No 'from'..'to'.. after variable"
);
return
;
err
=
_
(
"No 'from'..'to'.. after variable"
);
}
if
(
!
fromLexem
)
{
forLexem
->
error
=
_
(
"No loop variable"
);
return
;
err
=
_
(
"No loop variable"
);
}
if
(
!
fromLexem
)
{
forLexem
->
error
=
_
(
"No loop 'from' value"
);
return
;
err
=
_
(
"No loop 'from' value"
);
}
if
(
!
toLexem
)
{
forLexem
->
error
=
_
(
"No loop 'to' value"
);
err
=
_
(
"No loop 'to' value"
);
}
if
(
err
.
length
())
{
for
(
int
i
=
1
;
i
<
st
.
data
.
size
();
i
++
)
{
st
.
data
[
i
]
->
error
=
err
;
}
return
;
}
...
...
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