Skip to content

Commit 9e8ebcf

Browse files
committed
fix: bring back expression eol operator continuation
1 parent a3122dd commit 9e8ebcf

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

src/states/EXPRESSION.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,8 @@ export const EXPRESSION: StateDefinition<ExpressionMeta> = {
136136
!expression.groupStack.length &&
137137
(expression.terminatedByWhitespace || expression.terminatedByEOL)
138138
) {
139-
this.exitState();
140-
141-
// TODO: eventually it'd be good to allow multi line expressions.
142-
// This currently has a number of edge cases and likely can only be solved by
143-
// converting the expression state to avoid the look ahead/behind regexp pattern and instead
144-
// check characters as is goes.
145-
// if (checkForOperators(this, expression)) this.forward = 1;
139+
if (checkForOperators(this, expression)) this.forward = 1;
140+
else this.exitState();
146141
}
147142
},
148143

@@ -238,9 +233,10 @@ function checkForOperators(parser: Parser, expression: ExpressionMeta) {
238233
return false;
239234
}
240235

241-
const pattern = parser.isConcise
242-
? conciseOperatorPattern
243-
: htmlOperatorPattern;
236+
const pattern =
237+
parser.isConcise || expression.terminatedByEOL
238+
? conciseOperatorPattern
239+
: htmlOperatorPattern;
244240
pattern.lastIndex = parser.pos;
245241
const matches = pattern.exec(parser.data);
246242

0 commit comments

Comments
 (0)