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 ) {
return
!
isNaN
(
str
);
}
var
matchingOperators
=
new
RegExp
(
"
^
*[<=> ]+
*
"
);
var
matchingOperators
=
new
RegExp
(
"
^
(=|<>|<=|>=|<|>).
*
"
);
function
matchingValue
(
oVal
)
{
var
res
;
if
(
cElementType
.
string
===
oVal
.
type
)
{
if
(
cElementType
.
string
===
oVal
.
type
)
{
var
search
,
op
;
var
val
=
oVal
.
getValue
();
var
match
=
val
.
match
(
matchingOperators
);
if
(
match
)
{
search
=
val
.
substr
(
match
[
0
].
length
);
op
=
match
[
0
].
replace
(
/
\s
/g
,
""
);
search
=
val
.
substr
(
match
[
1
].
length
);
op
=
match
[
1
].
replace
(
/
\s
/g
,
""
);
}
else
{
search
=
val
;
op
=
null
;
...
...
@@ -5801,15 +5800,16 @@ function parseNum( str ) {
return
res
;
}
function
matching
(
x
,
matchingInfo
)
{
var
y
=
matchingInfo
.
val
;
var
operator
=
matchingInfo
.
op
;
var
res
=
false
,
rS
;
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
);
if
(
cElementType
.
error
===
_funcVal
.
type
)
{
if
(
cElementType
.
error
===
_funcVal
.
type
)
{
return
false
;
}
return
_funcVal
.
toBool
();
...
...
@@ -5833,7 +5833,7 @@ function parseNum( str ) {
res
=
rS
;
break
;
}
}
else
if
(
cElementType
.
number
===
y
.
type
)
{
}
else
if
(
cElementType
.
number
===
y
.
type
)
{
rS
=
(
x
.
type
===
y
.
type
);
switch
(
operator
)
{
case
"
<>
"
:
...
...
@@ -5853,18 +5853,14 @@ function parseNum( str ) {
break
;
case
"
=
"
:
default
:
if
(
cElementType
.
string
===
x
.
type
)
{
if
(
cElementType
.
string
===
x
.
type
)
{
x
=
x
.
tocNumber
();
}
res
=
(
x
.
value
===
y
.
value
);
break
;
}
}
else
if
(
cElementType
.
bool
===
y
.
type
)
{
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
){
}
else
if
(
cElementType
.
bool
===
y
.
type
||
cElementType
.
error
===
y
.
type
)
{
if
(
y
.
type
===
x
.
type
&&
x
.
value
===
y
.
value
)
{
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