for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Highlighter
*
* Copyright (C) 2016, Some right reserved.
* @author Kacper "Kadet" Donat <[email protected]>
* Contact with author:
* Xmpp: [email protected]
* E-mail: [email protected]
* From Kadet with love.
*/
namespace Kadet\Highlighter\Language\Css;
use Kadet\Highlighter\Matcher\RegexMatcher;
use Kadet\Highlighter\Parser\Rule;
class Scss extends PreProcessor
{
* Tokenization rules
public function setupRules()
parent::setupRules();
$this->rules->remove('symbol.selector.tag');
$this->rules->add('symbol.selector.tag', new Rule(new RegexMatcher('/(?>[\s{};]|^)(?=(\w+)[^;}]*\{)/m'), [
'context' => ['!symbol', '!string', '!number']
]));
$this->rules->add('variable', new Rule(new RegexMatcher('/(\$[\w-]+)/'), ['context' => $this->everywhere()]));
}
public function getIdentifier()
return 'scss';
public static function getMetadata()
return [
'name' => ['scss'],
'mime' => ['text/x-scss'],
'extension' => ['*.scss']
];