Module: CodeRay::Scanners::CSS::RE

Defined in:
lib/coderay/scanners/css.rb

Overview

:nodoc:

Constant Summary collapse

Hex =

:nodoc:

/[0-9a-fA-F]/
Unicode =

differs from standard because it allows uppercase hex too

/\\#{Hex}{1,6}\b/
Escape =
/#{Unicode}|\\[^\n0-9a-fA-F]/
NMChar =
/[-_a-zA-Z0-9]/
NMStart =
/[_a-zA-Z]/
String1 =

TODO: buggy regexp

/"(?:[^\n\\"]+|\\\n|#{Escape})*"?/
String2 =

TODO: buggy regexp

/'(?:[^\n\\']+|\\\n|#{Escape})*'?/
String =
/#{String1}|#{String2}/
HexColor =
/#(?:#{Hex}{6}|#{Hex}{3})/
Num =
/-?(?:[0-9]*\.[0-9]+|[0-9]+)n?/
Name =
/#{NMChar}+/
Ident =
/-?#{NMStart}#{NMChar}*/
AtKeyword =
/@#{Ident}/
Percentage =
/#{Num}%/
Unit =
Regexp.union(*(reldimensions + absdimensions + %w[s dpi dppx deg]))
Dimension =
/#{Num}#{Unit}/
Function =
/(?:url|alpha|attr|counters?)\((?:[^)\n]|\\\))*\)?/
Id =
/(?!#{HexColor}\b(?!-))##{Name}/
Class =
/\.#{Name}/
PseudoClass =
/::?#{Ident}/
AttributeSelector =
/\[[^\]]*\]?/