<?php
/**
- * lessphp v0.4.0@785ad53840
+ * lessphp v0.4.0@6e8e724fc7
* http://leafo.net/lessphp
*
* LESS css compiler, adapted from http://lesscss.org
protected $sourceParser = null;
protected $sourceLoc = null;
- static public $defaultValue = array("keyword", "");
-
static protected $nextImportId = 0; // uniquely identify imports
// attempts to find the path of an import url, returns null for css files
$mixins = $this->findBlocks($block, $path, $orderedArgs, $keywordArgs);
if ($mixins === null) {
- // fwrite(STDERR,"failed to find block: ".implode(" > ", $path)."\n");
- break; // throw error here??
+ $this->throwError("{$prop[1][0]} is undefined");
}
foreach ($mixins as $mixin) {
if (isset($items[0])) {
return $this->lib_e($items[0]);
}
- return self::$defaultValue;
+ $this->throwError("unrecognised input");
case "string":
$arg[1] = "";
return $arg;
}
$seen[$key] = true;
- $out = $this->reduce($this->get($key, self::$defaultValue));
+ $out = $this->reduce($this->get($key));
$seen[$key] = false;
return $out;
case "list":
// get the highest occurrence entry for a name
- protected function get($name, $default=null) {
+ protected function get($name) {
$current = $this->env;
$isArguments = $name == $this->vPrefix . 'arguments';
}
}
- return $default;
+ $this->throwError("variable $name is undefined");
}
// inject array of unparsed strings into environment as variables
return $this->allParsedFiles;
}
- protected function addParsedFile($file) {
+ public function addParsedFile($file) {
$this->allParsedFiles[realpath($file)] = filemtime($file);
}