Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Commit 355be90

Browse files
author
Shammamah Hossain
committed
Add regexpMatch parameter for relational operators.
1 parent fafa9c9 commit 355be90

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

src/dash-table/syntax-tree/lexeme/relational.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ export const contains: IUnboundedLexeme = R.merge({
5757
op.toString().indexOf(exp.toString()) !== -1
5858
),
5959
subType: RelationalOperator.Contains,
60-
regexp: /^((contains)(?:\s|$))/i
60+
regexp: /^((contains)(?:\s|$))/i,
61+
regexpMatch: 2
6162
}, LEXEME_BASE);
6263

6364
export const equal: IUnboundedLexeme = R.merge({
@@ -67,19 +68,22 @@ export const equal: IUnboundedLexeme = R.merge({
6768
op === exp
6869
),
6970
subType: RelationalOperator.Equal,
70-
regexp: /^(=|(eq)(?:\s|$))/i
71+
regexp: /^(=|(eq)(?:\s|$))/i,
72+
regexpMatch: 2
7173
}, LEXEME_BASE);
7274

7375
export const greaterOrEqual: IUnboundedLexeme = R.merge({
7476
evaluate: relationalEvaluator(([op, exp]) => op >= exp),
7577
subType: RelationalOperator.GreaterOrEqual,
76-
regexp: /^(>=|(ge)(?:\s|$))/i
78+
regexp: /^(>=|(ge)(?:\s|$))/i,
79+
regexpMatch: 2
7780
}, LEXEME_BASE);
7881

7982
export const greaterThan: IUnboundedLexeme = R.merge({
8083
evaluate: relationalEvaluator(([op, exp]) => op > exp),
8184
subType: RelationalOperator.GreaterThan,
82-
regexp: /^(>|(gt)(?:\s|$))/i
85+
regexp: /^(>|(gt)(?:\s|$))/i,
86+
regexpMatch: 2
8387
}, LEXEME_BASE);
8488

8589
const DATE_OPTIONS: IDateValidation = {
@@ -100,23 +104,27 @@ export const dateStartsWith: IUnboundedLexeme = R.merge({
100104
normalizedOp.indexOf(normalizedExp) === 0;
101105
}),
102106
subType: RelationalOperator.DateStartsWith,
103-
regexp: /^((datestartswith)(?:\s|$))/i
107+
regexp: /^((datestartswith)(?:\s|$))/i,
108+
regexpMatch: 2
104109
}, LEXEME_BASE);
105110

106111
export const lessOrEqual: IUnboundedLexeme = R.merge({
107112
evaluate: relationalEvaluator(([op, exp]) => op <= exp),
108113
subType: RelationalOperator.LessOrEqual,
109-
regexp: /^(<=|(le)(?:\s|$))/i
114+
regexp: /^(<=|(le)(?:\s|$))/i,
115+
regexpMatch: 2
110116
}, LEXEME_BASE);
111117

112118
export const lessThan: IUnboundedLexeme = R.merge({
113119
evaluate: relationalEvaluator(([op, exp]) => op < exp),
114120
subType: RelationalOperator.LessThan,
115-
regexp: /^(<|(lt)(?:\s|$))/i
121+
regexp: /^(<|(lt)(?:\s|$))/i,
122+
regexpMatch: 2
116123
}, LEXEME_BASE);
117124

118125
export const notEqual: IUnboundedLexeme = R.merge({
119126
evaluate: relationalEvaluator(([op, exp]) => op !== exp),
120127
subType: RelationalOperator.NotEqual,
121-
regexp: /^(!=|(ne)(?:\s|$))/i
128+
regexp: /^(!=|(ne)(?:\s|$))/i,
129+
regexpMatch: 2
122130
}, LEXEME_BASE);

0 commit comments

Comments
 (0)