Sha256: 45829476265f70096dad15336509d016a9da843713a26cc63e885013b61a5b60

Contents?: true

Size: 1.08 KB

Versions: 10

Compression:

Stored size: 1.08 KB

Contents

<?php

namespace CoffeeScript;

class yy_Arr extends yy_Base
{
  public $children = array('objects');

  function constructor($objs)
  {
    $this->objects = $objs ? $objs : array();

    return $this;
  }

  function assigns($name)
  {
    foreach ($this->objects as $obj)
    {
      if ($obj->assigns($name))
      {
        return TRUE;
      }
    }

    return FALSE;
  }

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

  function filter_implicit_objects()
  {
    return call_user_func_array(array(yy('Call'), __FUNCTION__), func_get_args());
  }
}

?>

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
guard-mthaml-0.4.0 vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Arr.php
guard-mthaml-0.3.1 vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Arr.php
guard-mthaml-0.3.0 vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Arr.php
guard-mthaml-0.2.5 vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Arr.php
guard-mthaml-0.2.4 vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Arr.php
guard-mthaml-0.2.3 vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Arr.php
guard-mthaml-0.2.2 vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Arr.php
guard-mthaml-0.2.1 vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Arr.php
guard-mthaml-0.2.0 vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Arr.php
guard-mthaml-0.1.0 vendor/coffeescript/coffeescript/src/CoffeeScript/yy/Arr.php