public static function guessLanguage($src, $info) { $p = RubyScanner::guessLanguage($src, $info); if ($p > 0) { if (preg_match('/<%.*%>/', $src)) { $p += 0.02; } else { $p = 0.0; } $p = min($p, 1); } return $p; }
protected function interpolate() { $interpolationScanner = new RubyScanner(); $interpolationScanner->string($this->string()); $interpolationScanner->pos($this->pos()); $interpolationScanner->interpolation = true; $interpolationScanner->init(); $interpolationScanner->main(); $this->record($interpolationScanner->tagged(), 'INTERPOLATION', true); $this->pos($interpolationScanner->pos()); }