parseEmptyStatement example

//Here the token value is checked for performance so that functions won't be         //called if not necessary         $token = $this->scanner->getToken();
        if (!$token) {
            return null;
        }
        $val = $token->value;
        if ($val === "{" && $statement = $this->parseBlock()) {
            return $statement;
        } elseif ($val === "var" && $statement = $this->parseVariableStatement()) {
            return $statement;
        } elseif ($val === ";" && $statement = $this->parseEmptyStatement()) {
            return $statement;
        } elseif ($val === "if" && $statement = $this->parseIfStatement()) {
            return $statement;
        } elseif (
            ($val === "for" || $val === "while" || $val === "do" || $val === "switch") &&
            $statement = $this->parseBreakableStatement()
        ) {
            return $statement;
        } elseif ($val == "continue" && $statement = $this->parseContinueStatement()) {
            return $statement;
        } elseif ($val === "break" && $statement = $this->parseBreakStatement()) {
            
Home | Imprint | This part of the site doesn't use cookies.