/** * Uses the current value of $this->count to show line and line number * * @param type $msg X * * @return void */ protected function throwError($msg = null) { if ($this->sourceLoc >= 0) { $this->sourceParser->throwError($msg, $this->sourceLoc); } throw new exception($msg); }
/** * Constructor * * @param [type] $lessc [description] * @param string $sourceName [description] */ public function __construct($lessc, $sourceName = null) { $this->eatWhiteDefault = true; // Reference to less needed for vPrefix, mPrefix, and parentSelector $this->lessc = $lessc; // Name used for error messages $this->sourceName = $sourceName; $this->writeComments = false; if (!self::$operatorString) { self::$operatorString = '(' . implode('|', array_map(array('F0FLess', 'preg_quote'), array_keys(self::$precedence))) . ')'; $commentSingle = F0FLess::preg_quote(self::$commentSingle); $commentMultiLeft = F0FLess::preg_quote(self::$commentMultiLeft); $commentMultiRight = F0FLess::preg_quote(self::$commentMultiRight); self::$commentMulti = $commentMultiLeft . '.*?' . $commentMultiRight; self::$whitePattern = '/' . $commentSingle . '[^\\n]*\\s*|(' . self::$commentMulti . ')\\s*|\\s+/Ais'; } }