Skip to content

Commit

Permalink
fix: bring back expression eol operator continuation
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Apr 5, 2022
1 parent a3122dd commit 9e8ebcf
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/states/EXPRESSION.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,8 @@ export const EXPRESSION: StateDefinition<ExpressionMeta> = {
!expression.groupStack.length &&
(expression.terminatedByWhitespace || expression.terminatedByEOL)
) {
this.exitState();

// TODO: eventually it'd be good to allow multi line expressions.
// This currently has a number of edge cases and likely can only be solved by
// converting the expression state to avoid the look ahead/behind regexp pattern and instead
// check characters as is goes.
// if (checkForOperators(this, expression)) this.forward = 1;
if (checkForOperators(this, expression)) this.forward = 1;
else this.exitState();
}
},

Expand Down Expand Up @@ -238,9 +233,10 @@ function checkForOperators(parser: Parser, expression: ExpressionMeta) {
return false;
}

const pattern = parser.isConcise
? conciseOperatorPattern
: htmlOperatorPattern;
const pattern =
parser.isConcise || expression.terminatedByEOL
? conciseOperatorPattern
: htmlOperatorPattern;
pattern.lastIndex = parser.pos;
const matches = pattern.exec(parser.data);

Expand Down

0 comments on commit 9e8ebcf

Please sign in to comment.