summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2013-06-11 02:32:37 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2013-06-11 02:32:37 +0200
commite23f69fb58787578b3f9894a8b77722d290d8092 (patch)
treec298574f7d97d2fe3ee07806851264181583c066
parent40b9083a1b51e2a531811d7f7359400aa359e82d (diff)
parent4eb4324c6fb20b9b5e7f73f17bc21e4a17fd3073 (diff)
downloadcoderay-e23f69fb58787578b3f9894a8b77722d290d8092.tar.gz
Merge remote-tracking branch 'noprompt/master' into css-token-kinds
Conflicts: etc/todo/scanners/css.rb
-rw-r--r--lib/coderay/scanners/css.rb10
-rwxr-xr-xlib/coderay/token_kinds.rb1
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/coderay/scanners/css.rb b/lib/coderay/scanners/css.rb
index 003eed6..22c6bfc 100644
--- a/lib/coderay/scanners/css.rb
+++ b/lib/coderay/scanners/css.rb
@@ -7,8 +7,8 @@ module Scanners
KINDS_NOT_LOC = [
:comment,
- :class, :pseudo_class, :type,
- :constant, :directive,
+ :class, :pseudo_class, :tag,
+ :id, :directive,
:key, :value, :operator, :color, :float, :string,
:error, :important,
] # :nodoc:
@@ -64,13 +64,13 @@ module Scanners
elsif case states.last
when :initial, :media
if match = scan(/(?>#{RE::Ident})(?!\()|\*/ox)
- encoder.text_token match, :type
+ encoder.text_token match, :tag
next
elsif match = scan(RE::Class)
encoder.text_token match, :class
next
elsif match = scan(RE::Id)
- encoder.text_token match, :constant
+ encoder.text_token match, :id
next
elsif match = scan(RE::PseudoClass)
encoder.text_token match, :pseudo_class
@@ -99,7 +99,7 @@ module Scanners
when :media_before_name
if match = scan(RE::Ident)
- encoder.text_token match, :type
+ encoder.text_token match, :tag
states[-1] = :media_after_name
next
end
diff --git a/lib/coderay/token_kinds.rb b/lib/coderay/token_kinds.rb
index 8db8530..bd8fd6c 100755
--- a/lib/coderay/token_kinds.rb
+++ b/lib/coderay/token_kinds.rb
@@ -39,6 +39,7 @@ module CodeRay
:function => 'function',
:global_variable => 'global-variable',
:hex => 'hex',
+ :id => 'id',
:imaginary => 'imaginary',
:important => 'important',
:include => 'include',