summaryrefslogtreecommitdiff
path: root/lib/coderay/helpers
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2009-04-14 04:03:40 +0000
committermurphy <murphy@rubychan.de>2009-04-14 04:03:40 +0000
commit70caebd582ffbd61ff0066911d80fb6afd960bdd (patch)
tree4d8c01f8e13b83b8610d83979824547fec580a95 /lib/coderay/helpers
parentd0e95e2cb7e1d7336a850178bb27ab98bc5b4ef0 (diff)
downloadcoderay-70caebd582ffbd61ff0066911d80fb6afd960bdd.tar.gz
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.
Diffstat (limited to 'lib/coderay/helpers')
-rw-r--r--lib/coderay/helpers/file_type.rb31
1 files changed, 17 insertions, 14 deletions
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,
}