private function loadAndCheckVarPositions(): array
    {
        $varPositions = $this->findAllVariablePositions();

        if (!$varPositions) {
            throw (new CodeError(
                static::CODE_TAG_MISSING_VARIABLES,
                self::MESSAGE_TAG_MISSING_VARIABLES,
                $this->stackPos
            ))->setToken($this->token);
        }

        $this->varTokens = array_filter($this->tokens, function (array $token) use ($varPositions): bool {
            return in_array($token['pointer'], $varPositions, true);
        });

        return $varPositions;
    }