Sha256: 4e70059a4d54358bf118b08315e01d9328d36677a907f84c620a1844a1d64ed6

Contents?: true

Size: 1.89 KB

Versions: 13

Compression:

Stored size: 1.89 KB

Contents

module Nokogiri
module CSS
class GeneratedTokenizer < GeneratedParser

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

  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]

            {ident}\(\s*     { [: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\t\r\n\f]+    { [:S, text] }
            {string}         { [:STRING, text] }
            .                { [text, text] }
end
end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
nokogiri-1.3.0-x86-mingw32 lib/nokogiri/css/tokenizer.rex
nokogiri-1.2.1-java lib/nokogiri/css/tokenizer.rex
nokogiri-1.2.2-java lib/nokogiri/css/tokenizer.rex
nokogiri-1.2.1 lib/nokogiri/css/tokenizer.rex
nokogiri-1.2.1-x86-mswin32-60 lib/nokogiri/css/tokenizer.rex
nokogiri-1.2.2 lib/nokogiri/css/tokenizer.rex
nokogiri-1.2.2-x86-mswin32-60 lib/nokogiri/css/tokenizer.rex
nokogiri-1.3.0-java lib/nokogiri/css/tokenizer.rex
nokogiri-1.2.3 lib/nokogiri/css/tokenizer.rex
nokogiri-1.2.3-java lib/nokogiri/css/tokenizer.rex
nokogiri-1.2.3-x86-mswin32-60 lib/nokogiri/css/tokenizer.rex
nokogiri-1.3.0 lib/nokogiri/css/tokenizer.rex
nokogiri-1.3.0-x86-mswin32 lib/nokogiri/css/tokenizer.rex