Ejemplo n.º 1
0
 protected function parse(Tokens $tokens)
 {
     $tokens = $this->benchmark(function () use($tokens) {
         return $this->_language->parse($tokens);
     }, $this->_times['parsing']);
     $this->_counts['after'] = count($tokens);
     if ($this->wants('tree-after')) {
         $this->_tree($tokens, 'after parsing', true);
     }
     return $tokens;
 }
Ejemplo n.º 2
0
 public function highlight($source, Language $language, FormatterInterface $formatter = null)
 {
     $formatter = $formatter ?: $this->getDefaultFormatter();
     return $formatter->format($language->parse($source));
 }