Skip to content

Commit

Permalink
State-based LESS analyzer refs kriswallsmith#758
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAsh committed Nov 5, 2015
1 parent f8fce9e commit fd271d4
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/Assetic/Util/Analyzer/LessAnalyzer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

/*
* This file is part of the Assetic package, an OpenSky project.
*
* (c) 2010-2014 OpenSky Project Inc
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Assetic\Util\Analyzer;

/**
* LESS analyzer
*
* @author Alex Ash <streamprop@gmail.com>
*/
class LessAnalyzer extends CssAnalyzer
{
protected $general = '/^(?<processed>.*?\R*)(?<unprocessed>(?<token>\'|"|\/\*|\/\/)(.*))?$/su';
protected $comment = array(
array(
'begin' => '/*',
'end' => '*/',
'regexp' => '/^(?<processed>\/\*.*?(?<token>\*\/))(?<unprocessed>.*)$/su',
),
array(
'begin' => '//',
'end' => '',
'regexp' => '/^(?<processed>\/\/.*?)(?<token>.{0})(?<unprocessed>\R.*)$/su',
),
);
}

0 comments on commit fd271d4

Please sign in to comment.