mirror of
https://github.com/Ekokumppanit/ystavakylaecard.git
synced 2026-02-13 21:47:08 +00:00
http://getsparks.org/packages/assets/versions/HEAD/show Creates our minified and combined .js and .css files
50 lines
962 B
PHP
Executable File
50 lines
962 B
PHP
Executable File
<?php
|
|
|
|
namespace CoffeeScript;
|
|
|
|
class yy_Slice extends yy_Base
|
|
{
|
|
public $children = array('range');
|
|
|
|
function constructor($range)
|
|
{
|
|
parent::constructor();
|
|
|
|
$this->range = $range;
|
|
|
|
return $this;
|
|
}
|
|
|
|
function compile_node($options)
|
|
{
|
|
$to = $this->range->to;
|
|
$from = $this->range->from;
|
|
|
|
$from_str = $from ? $from->compile($options, LEVEL_PAREN) : '0';
|
|
$compiled = $to ? $to->compile($options, LEVEL_PAREN) : '';
|
|
|
|
if ($to && ! ( ! $this->range->exclusive && intval($compiled) === -1))
|
|
{
|
|
$to_str = ', ';
|
|
|
|
if ($this->range->exclusive)
|
|
{
|
|
$to_str .= $compiled;
|
|
}
|
|
else if (preg_match(SIMPLENUM, $compiled))
|
|
{
|
|
$to_str .= (intval($compiled) + 1);
|
|
}
|
|
else
|
|
{
|
|
$compiled = $to->compile($options, LEVEL_ACCESS);
|
|
$to_str .= "({$compiled} + 1) || 9e9";
|
|
}
|
|
}
|
|
|
|
return ".slice({$from_str}".(isset($to_str) ? $to_str : '').')';
|
|
}
|
|
}
|
|
|
|
?>
|