JSParser::Variables PHP Méthode

Variables() private méthode

private Variables ( $x )
    private function Variables($x)
    {
        $n = new JSNode($this->t);
        do {
            $this->t->mustMatch(TOKEN_IDENTIFIER);
            $n2 = new JSNode($this->t);
            $n2->name = $n2->value;
            if ($this->t->match(OP_ASSIGN)) {
                if ($this->t->currentToken()->assignOp) {
                    throw $this->t->newSyntaxError('Invalid variable initialization');
                }
                $n2->initializer = $this->Expression($x, OP_COMMA);
            }
            $n2->readOnly = $n->type == KEYWORD_CONST;
            $n->addNode($n2);
            array_push($x->varDecls, $n2);
        } while ($this->t->match(OP_COMMA));
        return $n;
    }