Sha256: 4adacc0560a46825ef5105a81d86ddd805ea1c612d59f2df99446bb23b3e6a68

Contents?: true

Size: 1.88 KB

Versions: 29

Compression:

Stored size: 1.88 KB

Contents

module Nokogiri
module CSS
class Tokenizer

macro
  nl        \n|\r\n|\r|\f
  w         [\s]*
  nonascii  [^\0-\177]
  num       -?([0-9]+|[0-9]*\.[0-9]+)
  unicode   \\[0-9A-Fa-f]{1,6}(\r\n|[\s])?

  escape    {unicode}|\\[^\n\r\f0-9A-Fa-f]
  nmchar    [_A-Za-z0-9-]|{nonascii}|{escape}
  nmstart   [_A-Za-z]|{nonascii}|{escape}
  ident     [-@]?({nmstart})({nmchar})*
  name      ({nmchar})+
  string1   "([^\n\r\f"]|{nl}|{nonascii}|{escape})*"
  string2   '([^\n\r\f']|{nl}|{nonascii}|{escape})*'
  string    {string1}|{string2}

rule

# [:state]  pattern  [actions]

            has\({w}         { [:HAS, text] }
            {ident}\({w}     { [:FUNCTION, text] }
            {ident}          { [:IDENT, text] }
            \#{name}         { [:HASH, text] }
            {w}~={w}         { [:INCLUDES, text] }
            {w}\|={w}        { [:DASHMATCH, text] }
            {w}\^={w}        { [:PREFIXMATCH, text] }
            {w}\$={w}        { [:SUFFIXMATCH, text] }
            {w}\*={w}        { [:SUBSTRINGMATCH, text] }
            {w}!={w}         { [:NOT_EQUAL, text] }
            {w}={w}          { [:EQUAL, text] }
            {w}\)            { [:RPAREN, text] }
            {w}\[{w}         { [:LSQUARE, text] }
            {w}\]            { [:RSQUARE, text] }
            {w}\+{w}         { [:PLUS, text] }
            {w}>{w}          { [:GREATER, text] }
            {w},{w}          { [:COMMA, text] }
            {w}~{w}          { [:TILDE, text] }
            \:not\({w}       { [:NOT, text] }
            {num}            { [:NUMBER, text] }
            {w}\/\/{w}       { [:DOUBLESLASH, text] }
            {w}\/{w}         { [:SLASH, text] }
            
            U\+[0-9a-f?]{1,6}(-[0-9a-f]{1,6})?  {[:UNICODE_RANGE, text] }
            
            [\s]+            { [:S, text] }
            {string}         { [:STRING, text] }
            .                { [text, text] }
end
end
end

Version data entries

29 entries across 29 versions & 9 rubygems

Version Path
radiant-1.0.0 ruby-debug/ruby/1.8/gems/nokogiri-1.5.0/lib/nokogiri/css/tokenizer.rex
iisconfig-0.0.1.pre2 build/bundler/ruby/1.9.1/gems/nokogiri-1.5.0-x86-mingw32/lib/nokogiri/css/tokenizer.rex
iisconfig-0.0.1.pre1 build/bundler/ruby/1.9.1/gems/nokogiri-1.5.0-x86-mingw32/lib/nokogiri/css/tokenizer.rex
domo-0.0.5 vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.0/lib/nokogiri/css/tokenizer.rex
horseman-0.0.4 vendor/ruby/1.9.1/gems/nokogiri-1.5.0/lib/nokogiri/css/tokenizer.rex
horseman-0.0.3 vendor/ruby/1.9.1/gems/nokogiri-1.5.0/lib/nokogiri/css/tokenizer.rex
horseman-0.0.2 vendor/ruby/1.9.1/gems/nokogiri-1.5.0/lib/nokogiri/css/tokenizer.rex
nokogiri-maven-1.5.0-java lib/nokogiri/css/tokenizer.rex
nokogiri-maglev--1.5.0.1 lib/nokogiri/css/tokenizer.rex
nokogiri-1.5.0-java lib/nokogiri/css/tokenizer.rex
nokogiri-1.5.0-x86-mingw32 lib/nokogiri/css/tokenizer.rex
nokogiri-1.5.0-x86-mswin32-60 lib/nokogiri/css/tokenizer.rex
nokogiri-1.5.0 lib/nokogiri/css/tokenizer.rex
nokogiri-1.4.7-java lib/nokogiri/css/tokenizer.rex
nokogiri-1.4.7-x86-mingw32 lib/nokogiri/css/tokenizer.rex
nokogiri-1.4.7-x86-mswin32-60 lib/nokogiri/css/tokenizer.rex
nokogiri-1.4.7 lib/nokogiri/css/tokenizer.rex
search_biomodel-1.0.0 search_biomodel/ruby/1.8/gems/nokogiri-1.4.6/lib/nokogiri/css/tokenizer.rex
nokogiri-1.4.6 lib/nokogiri/css/tokenizer.rex
nokogiri-1.4.6-java lib/nokogiri/css/tokenizer.rex