Skip to content
Snippets Groups Projects
Commit a2efd6a7 authored by Cam Saül's avatar Cam Saül
Browse files

Merge pull request #2686 from metabase/dont-require-spaces-between-operators-in-expressions

Don't require spaces between operators & fields in expressions
parents fe32a06f d1835763
No related branches found
No related tags found
No related merge requests found
......@@ -134,6 +134,12 @@ function tokenizeExpression(expressionString) {
currentToken.value += c;
}
// Replace operators in expressionString making sure the operators have exactly one space before and after
VALID_OPERATORS.forEach(function(operator) {
let regex = new RegExp("\\s*[\\" + operator + "]\\s*");
expressionString = expressionString.replace(regex, ' ' + operator + ' ');
});
for (; i < expressionString.length; i++) {
let c = expressionString.charAt(i);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment