From 70caebd582ffbd61ff0066911d80fb6afd960bdd Mon Sep 17 00:00:00 2001 From: murphy Date: Tue, 14 Apr 2009 04:03:40 +0000 Subject: New: *Python Scanner* (feature #41) * Based on pygment's implementation. * The goal is to highlight both Python 2 and 3. ** print and exec will need special treatment. * Still needs work; see TODOs in the code. * Example files: PLEAC, pygments. ** The pygments.unistring code has very long lines which bother TextMate, so I put this one in a separate file. * Rating: 1 / 5 stars, "Poor support", because of problems with numeric literals. * Added .py, .pyw and .py3 to FileType. Else: * Sorted lines in FileType::TypeFromExt. --- lib/coderay/helpers/file_type.rb | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'lib/coderay/helpers') diff --git a/lib/coderay/helpers/file_type.rb b/lib/coderay/helpers/file_type.rb index 3c5979a..7f472d6 100644 --- a/lib/coderay/helpers/file_type.rb +++ b/lib/coderay/helpers/file_type.rb @@ -81,30 +81,33 @@ module FileType end TypeFromExt = { - 'rb' => :ruby, - 'rbw' => :ruby, - 'rake' => :ruby, - 'mab' => :ruby, - 'cpp' => :c, 'c' => :c, - 'gvy' => :groovy, + 'cpp' => :c, + 'css' => :css, + 'diff' => :diff, 'groovy' => :groovy, + 'gvy' => :groovy, 'h' => :c, + 'htm' => :html, + 'html' => :html, + 'html.erb' => :rhtml, 'java' => :java, 'js' => :java_script, 'json' => :json, - 'diff' => :diff, + 'mab' => :ruby, 'patch' => :diff, - 'css' => :css, - 'xml' => :xml, - 'htm' => :html, - 'html' => :html, - 'xhtml' => :xhtml, + 'py' => :python, + 'py3' => :python, + 'pyw' => :python, + 'rake' => :ruby, 'raydebug' => :debug, + 'rb' => :ruby, + 'rbw' => :ruby, 'rhtml' => :rhtml, - 'html.erb' => :rhtml, - 'ss' => :scheme, 'sch' => :scheme, + 'ss' => :scheme, + 'xhtml' => :xhtml, + 'xml' => :xml, 'yaml' => :yaml, 'yml' => :yaml, } -- cgit v1.2.1