Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
525ca570
Commit
525ca570
authored
Sep 07, 2017
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix matching operators
parent
780eebc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
16 deletions
+12
-16
cell/model/FormulaObjects/parserFormula.js
cell/model/FormulaObjects/parserFormula.js
+12
-16
No files found.
cell/model/FormulaObjects/parserFormula.js
View file @
525ca570
...
@@ -5776,18 +5776,17 @@ function parseNum( str ) {
...
@@ -5776,18 +5776,17 @@ function parseNum( str ) {
return
!
isNaN
(
str
);
return
!
isNaN
(
str
);
}
}
var
matchingOperators
=
new
RegExp
(
"
^
*[<=> ]+
*
"
);
var
matchingOperators
=
new
RegExp
(
"
^
(=|<>|<=|>=|<|>).
*
"
);
function
matchingValue
(
oVal
)
{
function
matchingValue
(
oVal
)
{
var
res
;
var
res
;
if
(
cElementType
.
string
===
oVal
.
type
)
{
if
(
cElementType
.
string
===
oVal
.
type
)
{
var
search
,
op
;
var
search
,
op
;
var
val
=
oVal
.
getValue
();
var
val
=
oVal
.
getValue
();
var
match
=
val
.
match
(
matchingOperators
);
var
match
=
val
.
match
(
matchingOperators
);
if
(
match
)
{
if
(
match
)
{
search
=
val
.
substr
(
match
[
0
].
length
);
search
=
val
.
substr
(
match
[
1
].
length
);
op
=
match
[
0
].
replace
(
/
\s
/g
,
""
);
op
=
match
[
1
].
replace
(
/
\s
/g
,
""
);
}
else
{
}
else
{
search
=
val
;
search
=
val
;
op
=
null
;
op
=
null
;
...
@@ -5801,15 +5800,16 @@ function parseNum( str ) {
...
@@ -5801,15 +5800,16 @@ function parseNum( str ) {
return
res
;
return
res
;
}
}
function
matching
(
x
,
matchingInfo
)
{
function
matching
(
x
,
matchingInfo
)
{
var
y
=
matchingInfo
.
val
;
var
y
=
matchingInfo
.
val
;
var
operator
=
matchingInfo
.
op
;
var
operator
=
matchingInfo
.
op
;
var
res
=
false
,
rS
;
var
res
=
false
,
rS
;
if
(
cElementType
.
string
===
y
.
type
)
{
if
(
cElementType
.
string
===
y
.
type
)
{
if
(
cElementType
.
number
===
y
.
type
&&
(
'
<
'
===
operator
||
'
>
'
===
operator
||
'
<=
'
===
operator
||
'
>=
'
===
operator
))
{
if
(
cElementType
.
number
===
y
.
type
&&
(
'
<
'
===
operator
||
'
>
'
===
operator
||
'
<=
'
===
operator
||
'
>=
'
===
operator
))
{
var
_funcVal
=
_func
[
x
.
type
][
y
.
type
](
x
,
y
,
operator
);
var
_funcVal
=
_func
[
x
.
type
][
y
.
type
](
x
,
y
,
operator
);
if
(
cElementType
.
error
===
_funcVal
.
type
)
{
if
(
cElementType
.
error
===
_funcVal
.
type
)
{
return
false
;
return
false
;
}
}
return
_funcVal
.
toBool
();
return
_funcVal
.
toBool
();
...
@@ -5833,7 +5833,7 @@ function parseNum( str ) {
...
@@ -5833,7 +5833,7 @@ function parseNum( str ) {
res
=
rS
;
res
=
rS
;
break
;
break
;
}
}
}
else
if
(
cElementType
.
number
===
y
.
type
)
{
}
else
if
(
cElementType
.
number
===
y
.
type
)
{
rS
=
(
x
.
type
===
y
.
type
);
rS
=
(
x
.
type
===
y
.
type
);
switch
(
operator
)
{
switch
(
operator
)
{
case
"
<>
"
:
case
"
<>
"
:
...
@@ -5853,18 +5853,14 @@ function parseNum( str ) {
...
@@ -5853,18 +5853,14 @@ function parseNum( str ) {
break
;
break
;
case
"
=
"
:
case
"
=
"
:
default
:
default
:
if
(
cElementType
.
string
===
x
.
type
)
{
if
(
cElementType
.
string
===
x
.
type
)
{
x
=
x
.
tocNumber
();
x
=
x
.
tocNumber
();
}
}
res
=
(
x
.
value
===
y
.
value
);
res
=
(
x
.
value
===
y
.
value
);
break
;
break
;
}
}
}
else
if
(
cElementType
.
bool
===
y
.
type
)
{
}
else
if
(
cElementType
.
bool
===
y
.
type
||
cElementType
.
error
===
y
.
type
)
{
if
(
y
.
type
===
x
.
type
&&
x
.
value
===
y
.
value
){
if
(
y
.
type
===
x
.
type
&&
x
.
value
===
y
.
value
)
{
res
=
true
;
}
}
else
if
(
cElementType
.
error
===
y
.
type
)
{
if
(
y
.
type
===
x
.
type
&&
x
.
value
===
y
.
value
){
res
=
true
;
res
=
true
;
}
}
}
}
...
...
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