コード例 #1
0
 function compile_node($options)
 {
     if ($this->variable) {
         $this->variable->front = $this->front;
     }
     if ($code = yy_Splat::compile_splatted_array($options, $this->args, TRUE)) {
         return $this->compile_splat($options, $code);
     }
     $args = $this->filter_implicit_objects($this->args);
     $tmp = array();
     foreach ($args as $arg) {
         $tmp[] = $arg->compile($options, LEVEL_LIST);
     }
     $args = implode(', ', $tmp);
     if ($this->is_super()) {
         return $this->super_reference($options) . '.call(this' . ($args ? ', ' . $args : '') . ')';
     } else {
         return ($this->is_new() ? 'new ' : '') . $this->variable->compile($options, LEVEL_ACCESS) . "({$args})";
     }
 }
コード例 #2
0
 function compile_node($options)
 {
     if (!count($options)) {
         return '[]';
     }
     $options['indent'] .= TAB;
     $objs = $this->filter_implicit_objects($this->objects);
     if ($code = yy_Splat::compile_splatted_array($options, $objs)) {
         return $code;
     }
     $code = array();
     foreach ($objs as $obj) {
         $code[] = $obj->compile($options);
     }
     $code = implode(', ', $code);
     if (strpos($code, "\n") !== FALSE) {
         return "[\n{$options['indent']}{$code}\n{$this->tab}]";
     } else {
         return "[{$code}]";
     }
 }