| 1 | <?php |
||
| 22 | class Ini extends Language |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * Tokenization rules |
||
| 26 | * |
||
| 27 | * @return \Kadet\Highlighter\Parser\Rule[]|\Kadet\Highlighter\Parser\Rule[][] |
||
| 28 | */ |
||
| 29 | public function setupRules() |
||
| 30 | { |
||
| 31 | $this->rules->addMany([ |
||
| 32 | 'comment' => new Rule(new CommentMatcher([';'], [])), |
||
| 33 | 'symbol.section' => new Rule(new RegexMatcher('/(\[[\.\w]+\])/i')), |
||
| 34 | 'variable' => new Rule(new RegexMatcher('/([\.\w]+)\s*=/i')), |
||
| 35 | 'number' => new Rule(new RegexMatcher('/(-?\d+)/i')), |
||
| 36 | |||
| 37 | 'string' => new Rule(new RegexMatcher('/=\h*(.*)/i')), |
||
| 38 | ]); |
||
| 39 | } |
||
| 40 | |||
| 41 | /** @inheritdoc */ |
||
| 42 | public function getIdentifier() |
||
| 46 | } |
||
| 47 |