private function parseTokens(TokenStream $tokens, AstNode $ast): void
    {
        $parsingPath = $ast->type === AstNodeTypes::PATH;
        $currNode = $ast;

        while (($token = $tokens->getCurrent()) !== null) {
            switch ($token->type) {
                case TokenTypes::T_TEXT:
                    $this->parseText($tokens, $currNode);
                    break;
                case TokenTypes::T_NUMBER:
                    // Since we handle a number inside of variables elsewhere, we'll just treat this as text
                    $this->parseText($tokens, $currNode);
                    break;
                case TokenTypes::T_VARIABLE:
                    $this->parseVariable($tokens, $currNode);
                    break;
                case TokenTypes::T_PUNCTUATION:
                    $this->parsePunctuation($tokens, $currNode, $parsingPath);
                    break;
                case TokenTypes::T_QUOTED_STRING:
                    // Since we handle a quoted string inside of variables elsewhere, we'll just treat this as text
                    $this->parseText($tokens, $currNode);
                    break;
            }
        }
    }