summaryrefslogtreecommitdiff
path: root/src/Lexer/Lexer.php
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2025-02-06 13:59:50 +0100
committerDaniel Weipert <git@mail.dweipert.de>2025-02-06 13:59:50 +0100
commit54b4040a8e46c4104e228264fa57b44d17e245c9 (patch)
tree938f077f1343ee018476bd1cf68924f9181143f1 /src/Lexer/Lexer.php
parent7667162a20ebdedac14de88260df018b961548d4 (diff)
all current tests passing
Diffstat (limited to 'src/Lexer/Lexer.php')
-rw-r--r--src/Lexer/Lexer.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/Lexer/Lexer.php b/src/Lexer/Lexer.php
index bb2a809..98ac5e2 100644
--- a/src/Lexer/Lexer.php
+++ b/src/Lexer/Lexer.php
@@ -27,7 +27,7 @@ class Lexer
"(", ")",
"[", "]",
"{", "}",
- "$", ".",
+ ".",
];
$lastPosition = -1;
@@ -238,6 +238,18 @@ class Lexer
}
}
+ // pipe placeholder
+ else if ($currentChar == "$") {
+ $output[] = new Token(
+ TokenType::PipePlaceholder,
+ $currentChar,
+ $currentChar,
+ $this->line,
+ $startColumn,
+ );
+ $this->advance(1);
+ }
+
// single char tokens
else if (in_array($currentChar, $singleCharTokens)) {
$output[] = new Token(
@@ -489,5 +501,6 @@ enum TokenType {
case Operator;
case Assign;
case Pipe;
+ case PipePlaceholder;
case EndOfFile;
}