for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Highlighter
*
* Copyright (C) 2015, 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;
use Kadet\Highlighter\Matcher\CommentMatcher;
use Kadet\Highlighter\Matcher\RegexMatcher;
use Kadet\Highlighter\Parser\Rule;
class Ini extends Language
{
/** @inheritdoc */
public function getRules()
return [
'comment' => new Rule(new CommentMatcher([';'], [])),
'symbol.section' => new Rule(new RegexMatcher('/(\[[\.\w]+\])/i')),
'variable' => new Rule(new RegexMatcher('/([\.\w]+)\s*=/i')),
'number' => new Rule(new RegexMatcher('/(-?\d+)/i')),
'string' => new Rule(new RegexMatcher('/=\h*(.*)/i')),
];
}
public function getIdentifier()
return 'ini';