Sha256: fce774ae7e46ca6398ac8eddbeedaa6aa1b8478741913b440c7220d26cca9254

Contents?: true

Size: 792 Bytes

Versions: 10

Compression:

Stored size: 792 Bytes

Contents

<?php

namespace CoffeeScript;

class yy_Parens extends yy_Base
{
  public $children = array('body');

  function constructor($body)
  {
    $this->body = $body;

    return $this;
  }

  function compile_node($options = array())
  {
    $expr = $this->body->unwrap();

    if ($expr instanceof yy_Value && $expr->is_atomic())
    {
      $expr->front = $this->front;
      return $expr->compile($options);
    }

    $code = $expr->compile($options, LEVEL_PAREN);

    $bare = $options['level'] < LEVEL_OP && ($expr instanceof yy_Op || $expr instanceof yy_Call ||
      ($expr instanceof yy_For && $expr->returns));

    return $bare ? $code : "({$code})";
  }

  function is_complex()
  {
    return $this->body->is_complex();
  }

  function unwrap()
  {
    return $this->body;
  }
}

?>

Version data entries

10 entries across 10 versions & 1 rubygems

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