This repository was archived by the owner on Jun 4, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 73
Add spaces to regex for relational operators. #612
Merged
Merged
Changes from 7 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
5a333c4
Add spaces to regex for relational operators.
5f2d050
Add and adjust tests for relational operators.
f29e9bc
Merge branch 'dev' into text-comparison-operators
ddb903d
Add spaces to remaining relational operators.
96ba2b2
Add test for symbol-based operators that aren't followed by a space.
83f46b6
Merge branch 'dev' into text-comparison-operators
8da1189
Update src/dash-table/syntax-tree/lexeme/relational.ts
f312326
Add space to regex for notEqual.
d5a39c1
Add support for incomplete queries.
c2a906b
Add CHANGELOG entry.
fe9fae7
Add unit tests.
1018bb5
Update tests/cypress/tests/unit/query_syntactic_tree_test.ts
aae4907
Trim filter values.
6140a88
Ensure that trailing space does not get captured.
fafa9c9
Revert "Trim filter values."
355be90
Add regexpMatch parameter for relational operators.
f558618
Replace non-capturing group with positive lookahead.
78016ef
Merge branch 'dev' into text-comparison-operators
4a831fa
Update relational.ts
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ export const contains: IUnboundedLexeme = R.merge({ | |
op.toString().indexOf(exp.toString()) !== -1 | ||
), | ||
subType: RelationalOperator.Contains, | ||
regexp: /^(contains)/i | ||
regexp: /^(contains(\s|$))/i | ||
}, LEXEME_BASE); | ||
|
||
export const equal: IUnboundedLexeme = R.merge({ | ||
|
@@ -67,19 +67,19 @@ export const equal: IUnboundedLexeme = R.merge({ | |
op === exp | ||
), | ||
subType: RelationalOperator.Equal, | ||
regexp: /^(=|eq)/i | ||
regexp: /^(=|eq\s)/i | ||
}, LEXEME_BASE); | ||
|
||
export const greaterOrEqual: IUnboundedLexeme = R.merge({ | ||
evaluate: relationalEvaluator(([op, exp]) => op >= exp), | ||
subType: RelationalOperator.GreaterOrEqual, | ||
regexp: /^(>=|ge)/i | ||
regexp: /^(>=|ge\s)/i | ||
}, LEXEME_BASE); | ||
|
||
export const greaterThan: IUnboundedLexeme = R.merge({ | ||
evaluate: relationalEvaluator(([op, exp]) => op > exp), | ||
subType: RelationalOperator.GreaterThan, | ||
regexp: /^(>|gt)/i | ||
regexp: /^(>|gt\s)/i | ||
}, LEXEME_BASE); | ||
|
||
const DATE_OPTIONS: IDateValidation = { | ||
|
@@ -100,23 +100,23 @@ export const dateStartsWith: IUnboundedLexeme = R.merge({ | |
normalizedOp.indexOf(normalizedExp) === 0; | ||
}), | ||
subType: RelationalOperator.DateStartsWith, | ||
regexp: /^(datestartswith)/i | ||
regexp: /^(datestartswith\s)/i | ||
}, LEXEME_BASE); | ||
|
||
export const lessOrEqual: IUnboundedLexeme = R.merge({ | ||
evaluate: relationalEvaluator(([op, exp]) => op <= exp), | ||
subType: RelationalOperator.LessOrEqual, | ||
regexp: /^(<=|le)/i | ||
regexp: /^(<=|le\s)/i | ||
}, LEXEME_BASE); | ||
|
||
export const lessThan: IUnboundedLexeme = R.merge({ | ||
evaluate: relationalEvaluator(([op, exp]) => op < exp), | ||
subType: RelationalOperator.LessThan, | ||
regexp: /^(<|lt)/i | ||
regexp: /^(<|lt\s)/i | ||
}, LEXEME_BASE); | ||
|
||
export const notEqual: IUnboundedLexeme = R.merge({ | ||
evaluate: relationalEvaluator(([op, exp]) => op !== exp), | ||
subType: RelationalOperator.NotEqual, | ||
regexp: /^(!=|ne)/i | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
}, LEXEME_BASE); | ||
}, LEXEME_BASE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the other ones :)