Sha256: 721a048c949fed9ef6d48231dac9402acc135abd7eddc45e791eb4ba748f4402

Contents?: true

Size: 1.89 KB

Versions: 156

Compression:

Stored size: 1.89 KB

Contents

module Nokogiri
module CSS
class Tokenizer # :nodoc:

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}            { [: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

156 entries across 149 versions & 15 rubygems

Version Path
daslabs-0.12.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/lib/nokogiri/css/tokenizer.rex
daslabs-0.11.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/lib/nokogiri/css/tokenizer.rex
tdiary-5.0.9 vendor/bundle/gems/nokogiri-1.8.2/lib/nokogiri/css/tokenizer.rex
tdiary-5.0.8 vendor/bundle/gems/nokogiri-1.8.2/lib/nokogiri/css/tokenizer.rex
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/nokogiri-1.8.2/lib/nokogiri/css/tokenizer.rex
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/nokogiri-1.8.1/lib/nokogiri/css/tokenizer.rex
daslabs-0.10.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/lib/nokogiri/css/tokenizer.rex
daslabs-0.9.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/lib/nokogiri/css/tokenizer.rex
daslabs-0.8.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/lib/nokogiri/css/tokenizer.rex
daslabs-0.7.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/lib/nokogiri/css/tokenizer.rex
daslabs-0.6.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/lib/nokogiri/css/tokenizer.rex
daslabs-0.5.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/lib/nokogiri/css/tokenizer.rex
daslabs-0.4.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/lib/nokogiri/css/tokenizer.rex
nokogiri-1.8.2 lib/nokogiri/css/tokenizer.rex
nokogiri-1.8.2-x86-mingw32 lib/nokogiri/css/tokenizer.rex
nokogiri-1.8.2-x64-mingw32 lib/nokogiri/css/tokenizer.rex
nokogiri-1.8.2-java lib/nokogiri/css/tokenizer.rex
tdiary-5.0.7 vendor/bundle/gems/nokogiri-1.8.1/lib/nokogiri/css/tokenizer.rex
pract6-0.1.0 .gem/ruby/2.3.0/gems/nokogiri-1.8.1/lib/nokogiri/css/tokenizer.rex
tdiary-5.0.6 vendor/bundle/gems/nokogiri-1.8.1/lib/nokogiri/css/tokenizer.rex