Skip to content

Commit 13459be

Browse files
committed
removed rtrim
1 parent 07974fc commit 13459be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Parse/Lexer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,9 @@ protected function lexData(): void
119119
$this->pushToken(TokenType::TextData, $textBeforeToken);
120120
$this->moveCursor($text.$position[0]);
121121

122-
switch (rtrim($this->positions[$this->position][0], LexerOptions::WhitespaceTrim->value)) {
122+
switch ($this->positions[$this->position][0]) {
123123
case LexerOptions::TagBlockStart->value:
124+
case LexerOptions::TagBlockStart->value.LexerOptions::WhitespaceTrim->value:
124125
// {% comment %}
125126
if (preg_match(LexerOptions::blockCommentStartRegex(), $this->source, $matches, offset: $this->cursor) === 1) {
126127
$this->moveCursor($matches[0]);
@@ -133,6 +134,7 @@ protected function lexData(): void
133134
$this->currentVarBlockLine = $this->lineNumber;
134135
break;
135136
case LexerOptions::TagVariableStart->value:
137+
case LexerOptions::TagVariableStart->value.LexerOptions::WhitespaceTrim->value:
136138
$this->pushToken(TokenType::VariableStart);
137139
$this->pushState(LexerState::Variable);
138140
$this->currentVarBlockLine = $this->lineNumber;

0 commit comments

Comments
 (0)