mirror of
https://github.com/Ekokumppanit/ystavakylaecard.git
synced 2026-02-25 15:51:25 +00:00
Sparks: Assets, 1.5.1
http://getsparks.org/packages/assets/versions/HEAD/show Creates our minified and combined .js and .css files
This commit is contained in:
49
sparks/assets/1.5.1/libraries/coffeescript/yy/Slice.php
Executable file
49
sparks/assets/1.5.1/libraries/coffeescript/yy/Slice.php
Executable file
@@ -0,0 +1,49 @@
|
||||
<?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 : '').')';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user