Chris@909: module CodeRay Chris@909: Chris@909: # A Hash of all known token kinds and their associated CSS classes. Chris@909: TokenKinds = Hash.new do |h, k| Chris@909: warn 'Undefined Token kind: %p' % [k] if $CODERAY_DEBUG Chris@909: false Chris@909: end Chris@909: Chris@909: # speedup Chris@909: TokenKinds.compare_by_identity if TokenKinds.respond_to? :compare_by_identity Chris@909: Chris@909: TokenKinds.update( # :nodoc: Chris@909: :annotation => 'annotation', Chris@909: :attribute_name => 'attribute-name', Chris@909: :attribute_value => 'attribute-value', Chris@909: :binary => 'bin', Chris@909: :char => 'char', Chris@909: :class => 'class', Chris@909: :class_variable => 'class-variable', Chris@909: :color => 'color', Chris@909: :comment => 'comment', Chris@909: :complex => 'complex', Chris@909: :constant => 'constant', Chris@909: :content => 'content', Chris@909: :debug => 'debug', Chris@909: :decorator => 'decorator', Chris@909: :definition => 'definition', Chris@909: :delimiter => 'delimiter', Chris@909: :directive => 'directive', Chris@909: :doc => 'doc', Chris@909: :doctype => 'doctype', Chris@909: :doc_string => 'doc-string', Chris@909: :entity => 'entity', Chris@909: :error => 'error', Chris@909: :escape => 'escape', Chris@909: :exception => 'exception', Chris@909: :filename => 'filename', Chris@909: :float => 'float', Chris@909: :function => 'function', Chris@909: :global_variable => 'global-variable', Chris@909: :hex => 'hex', Chris@909: :imaginary => 'imaginary', Chris@909: :important => 'important', Chris@909: :include => 'include', Chris@909: :inline => 'inline', Chris@909: :inline_delimiter => 'inline-delimiter', Chris@909: :instance_variable => 'instance-variable', Chris@909: :integer => 'integer', Chris@909: :key => 'key', Chris@909: :keyword => 'keyword', Chris@909: :label => 'label', Chris@909: :local_variable => 'local-variable', Chris@909: :modifier => 'modifier', Chris@909: :namespace => 'namespace', Chris@909: :octal => 'octal', Chris@909: :predefined => 'predefined', Chris@909: :predefined_constant => 'predefined-constant', Chris@909: :predefined_type => 'predefined-type', Chris@909: :preprocessor => 'preprocessor', Chris@909: :pseudo_class => 'pseudo-class', Chris@909: :regexp => 'regexp', Chris@909: :reserved => 'reserved', Chris@909: :shell => 'shell', Chris@909: :string => 'string', Chris@909: :symbol => 'symbol', Chris@909: :tag => 'tag', Chris@909: :type => 'type', Chris@909: :value => 'value', Chris@909: :variable => 'variable', Chris@909: Chris@909: :change => 'change', Chris@909: :delete => 'delete', Chris@909: :head => 'head', Chris@909: :insert => 'insert', Chris@909: Chris@909: :eyecatcher => 'eyecatcher', Chris@909: Chris@909: :ident => false, Chris@909: :operator => false, Chris@909: Chris@909: :space => false, Chris@909: :plain => false Chris@909: ) Chris@909: Chris@909: TokenKinds[:method] = TokenKinds[:function] Chris@909: TokenKinds[:escape] = TokenKinds[:delimiter] Chris@909: TokenKinds[:docstring] = TokenKinds[:comment] Chris@909: Chris@909: TokenKinds.freeze Chris@909: end