| Total Complexity | 3 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 16.66% |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | class Ini extends GreedyLanguage |
||
| 24 | { |
||
| 25 | /** |
||
| 26 | * Tokenization rules |
||
| 27 | */ |
||
| 28 | public function setupRules() |
||
| 29 | { |
||
| 30 | $this->rules->addMany([ |
||
| 31 | 'comment' => new Rule(new CommentMatcher([';'], [])), |
||
| 32 | 'symbol.section' => new Rule(new RegexMatcher('/(\[.*?])/i')), |
||
| 33 | 'variable' => new Rule(new RegexMatcher('/([\.\w]+)\s*=/i')), |
||
| 34 | 'number' => new Rule(new RegexMatcher('/(-?\d+)/i')), |
||
| 35 | |||
| 36 | 'string' => new Rule(new RegexMatcher('/=\h*(.*?)\R/i')), |
||
| 37 | ]); |
||
| 38 | } |
||
| 39 | |||
| 40 | /** @inheritdoc */ |
||
| 41 | 1 | public function getIdentifier() |
|
| 44 | } |
||
| 45 | |||
| 46 | public static function getMetadata() |
||
| 52 | ]; |
||
| 53 | } |
||
| 55 |