diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-08-15 20:20:18 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-08-15 20:20:18 +0000 |
commit | 889d50089d4d98db83ba5617b526da50107be661 (patch) | |
tree | d9bed99952fddce716e6d7acf189603358bb2021 /vendor/plugins/coderay-0.7.6.227/lib/coderay/token_classes.rb | |
parent | a5849ee044837be589e9aae554cf99a394b9b9af (diff) | |
download | redmine-889d50089d4d98db83ba5617b526da50107be661.tar.gz redmine-889d50089d4d98db83ba5617b526da50107be661.zip |
Added syntax highlightment for repository files (using CodeRay).
Supported languages: c, ruby, rhtml, yaml, html, xml.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@644 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'vendor/plugins/coderay-0.7.6.227/lib/coderay/token_classes.rb')
-rw-r--r-- | vendor/plugins/coderay-0.7.6.227/lib/coderay/token_classes.rb | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/vendor/plugins/coderay-0.7.6.227/lib/coderay/token_classes.rb b/vendor/plugins/coderay-0.7.6.227/lib/coderay/token_classes.rb new file mode 100644 index 000000000..d0de855a2 --- /dev/null +++ b/vendor/plugins/coderay-0.7.6.227/lib/coderay/token_classes.rb @@ -0,0 +1,71 @@ +module CodeRay + class Tokens + ClassOfKind = Hash.new do |h, k| + h[k] = k.to_s + end + ClassOfKind.update with = { + :attribute_name => 'an', + :attribute_name_fat => 'af', + :attribute_value => 'av', + :attribute_value_fat => 'aw', + :bin => 'bi', + :char => 'ch', + :class => 'cl', + :class_variable => 'cv', + :color => 'cr', + :comment => 'c', + :constant => 'co', + :content => 'k', + :definition => 'df', + :delimiter => 'dl', + :directive => 'di', + :doc => 'do', + :doc_string => 'ds', + :entity => 'en', + :error => 'er', + :escape => 'e', + :exception => 'ex', + :float => 'fl', + :function => 'fu', + :global_variable => 'gv', + :hex => 'hx', + :include => 'ic', + :inline => 'il', + :inline_delimiter => 'idl', + :instance_variable => 'iv', + :integer => 'i', + :interpreted => 'in', + :label => 'la', + :local_variable => 'lv', + :modifier => 'mod', + :oct => 'oc', + :operator_fat => 'of', + :pre_constant => 'pc', + :pre_type => 'pt', + :predefined => 'pd', + :preprocessor => 'pp', + :regexp => 'rx', + :reserved => 'r', + :shell => 'sh', + :string => 's', + :symbol => 'sy', + :tag => 'ta', + :tag_fat => 'tf', + :tag_special => 'ts', + :type => 'ty', + :variable => 'v', + :xml_text => 'xt', + + :ident => :NO_HIGHLIGHT, # 'id' + #:operator => 'op', + :operator => :NO_HIGHLIGHT, # 'op' + :space => :NO_HIGHLIGHT, # 'sp' + :plain => :NO_HIGHLIGHT, + } + ClassOfKind[:procedure] = ClassOfKind[:method] = ClassOfKind[:function] + ClassOfKind[:open] = ClassOfKind[:close] = ClassOfKind[:delimiter] + ClassOfKind[:nesting_delimiter] = ClassOfKind[:delimiter] + ClassOfKind[:escape] = ClassOfKind[:delimiter] + #ClassOfKind.default = ClassOfKind[:error] or raise 'no class found for :error!' + end +end
\ No newline at end of file |