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
635dd6ab
Commit
635dd6ab
authored
Jan 21, 2013
by
Victor Yacovlev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed complex bool parsing
parent
3fda5c4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
src/plugins/kumiranalizer/syntaxanalizer.cpp
src/plugins/kumiranalizer/syntaxanalizer.cpp
+23
-1
No files found.
src/plugins/kumiranalizer/syntaxanalizer.cpp
View file @
635dd6ab
...
@@ -3110,6 +3110,26 @@ enum BlockType {
...
@@ -3110,6 +3110,26 @@ enum BlockType {
#define IS_OPERATOR(x) (x & LxTypeOperator || x==LxOperGreaterOrEqual || x==LxSecOr || x==LxSecAnd || x==LxPriAssign
/* || x==LxSecNot */
)
#define IS_OPERATOR(x) (x & LxTypeOperator || x==LxOperGreaterOrEqual || x==LxSecOr || x==LxSecAnd || x==LxPriAssign
/* || x==LxSecNot */
)
inline
bool
hasBoolOpBefore
(
const
QList
<
SubexpressionElement
>
&
alist
,
int
no
)
{
for
(
int
i
=
no
-
1
;
i
>=
0
;
i
--
)
{
if
(
alist
[
i
].
o
)
{
const
LexemType
t
=
alist
[
i
].
o
->
type
;
if
(
t
==
LxOperBoolEqual
||
t
==
LxOperBoolNotEqual
||
t
==
LxSecAnd
||
t
==
LxSecOr
||
t
==
LxSecNot
)
{
return
true
;
}
}
}
return
false
;
}
AST
::
Expression
*
SyntaxAnalizerPrivate
::
parseExpression
(
AST
::
Expression
*
SyntaxAnalizerPrivate
::
parseExpression
(
QList
<
Lexem
*>
lexems
QList
<
Lexem
*>
lexems
,
const
AST
::
Module
*
mod
,
const
AST
::
Module
*
mod
...
@@ -3540,12 +3560,14 @@ AST::Expression * SyntaxAnalizerPrivate::parseExpression(
...
@@ -3540,12 +3560,14 @@ AST::Expression * SyntaxAnalizerPrivate::parseExpression(
if
(
el
.
o
&&
(
el
.
o
->
type
==
LxOperEqual
||
el
.
o
->
type
==
LxOperNotEqual
)
)
{
if
(
el
.
o
&&
(
el
.
o
->
type
==
LxOperEqual
||
el
.
o
->
type
==
LxOperNotEqual
)
)
{
bool
isBooleanComparision
=
bool
isBooleanComparision
=
i
>
0
&&
subexpression
[
i
-
1
].
e
&&
subexpression
[
i
-
1
].
e
->
baseType
.
kind
==
AST
::
TypeBoolean
i
>
0
&&
subexpression
[
i
-
1
].
e
&&
subexpression
[
i
-
1
].
e
->
baseType
.
kind
==
AST
::
TypeBoolean
// ||
// i>0 && hasBoolOpBefore(subexpression, i)
||
||
i
<
subexpression
.
size
()
-
1
&&
subexpression
[
i
+
1
].
e
&&
subexpression
[
i
+
1
].
e
->
baseType
.
kind
==
AST
::
TypeBoolean
i
<
subexpression
.
size
()
-
1
&&
subexpression
[
i
+
1
].
e
&&
subexpression
[
i
+
1
].
e
->
baseType
.
kind
==
AST
::
TypeBoolean
||
||
i
<
subexpression
.
size
()
-
1
&&
subexpression
[
i
+
1
].
o
&&
subexpression
[
i
+
1
].
o
->
type
==
LxSecNot
;
i
<
subexpression
.
size
()
-
1
&&
subexpression
[
i
+
1
].
o
&&
subexpression
[
i
+
1
].
o
->
type
==
LxSecNot
;
if
(
isBooleanComparision
)
{
if
(
isBooleanComparision
)
{
if
(
el
.
o
->
type
=
LxOperEqual
)
if
(
el
.
o
->
type
=
=
LxOperEqual
)
el
.
o
->
type
=
LxOperBoolEqual
;
el
.
o
->
type
=
LxOperBoolEqual
;
else
else
el
.
o
->
type
=
LxOperBoolNotEqual
;
el
.
o
->
type
=
LxOperBoolNotEqual
;
...
...
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