From 54b4040a8e46c4104e228264fa57b44d17e245c9 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Thu, 6 Feb 2025 13:59:50 +0100 Subject: all current tests passing --- src/Lexer/Lexer.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/Lexer/Lexer.php') 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; } -- cgit v1.2.3