You are here

private function JSParser::Variables in Advanced CSS/JS Aggregation 6

Same name and namespace in other branches
  1. 8.4 advagg_js_minify/jsminplus.inc \JSParser::Variables()
  2. 8.2 advagg_js_minify/jsminplus.inc \JSParser::Variables()
  3. 8.3 advagg_js_minify/jsminplus.inc \JSParser::Variables()
  4. 7.2 advagg_js_compress/jsminplus.inc \JSParser::Variables()
  5. 7 advagg_js_compress/jsminplus.inc \JSParser::Variables()
1 call to JSParser::Variables()
JSParser::Statement in advagg_js_compress/jsminplus.inc

File

advagg_js_compress/jsminplus.inc, line 1262

Class

JSParser

Code

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;
}