Sha256: 8478fffd633b2ab3563295e952676e8c4757b20c036054d1c223edd150eea6dc

Contents?: true

Size: 1.9 KB

Versions: 383

Compression:

Stored size: 1.9 KB

Contents

module Nokogiri
module CSS
# :nodoc: all
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})*(?<!\\)(?:\\{2})*"
  string2   '([^\n\r\f']|{nl}|{nonascii}|{escape})*(?<!\\)(?:\\{2})*'
  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

383 entries across 381 versions & 11 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/nokogiri-1.16.6-x86_64-linux/lib/nokogiri/css/tokenizer.rex
nokogiri-1.15.7-x86-mingw32 lib/nokogiri/css/tokenizer.rex
nokogiri-1.15.7-x86-linux lib/nokogiri/css/tokenizer.rex
nokogiri-1.15.7-x86_64-linux lib/nokogiri/css/tokenizer.rex
nokogiri-1.15.7-x86_64-darwin lib/nokogiri/css/tokenizer.rex
nokogiri-1.15.7-x64-mingw-ucrt lib/nokogiri/css/tokenizer.rex
nokogiri-1.15.7-x64-mingw32 lib/nokogiri/css/tokenizer.rex
nokogiri-1.15.7-java lib/nokogiri/css/tokenizer.rex
nokogiri-1.15.7 lib/nokogiri/css/tokenizer.rex
nokogiri-1.15.7-arm-linux lib/nokogiri/css/tokenizer.rex
nokogiri-1.15.7-arm64-darwin lib/nokogiri/css/tokenizer.rex
nokogiri-1.15.7-aarch64-linux lib/nokogiri/css/tokenizer.rex
nokogiri-1.16.8-x86-mingw32 lib/nokogiri/css/tokenizer.rex
nokogiri-1.16.8-x86-linux lib/nokogiri/css/tokenizer.rex
nokogiri-1.16.8-x86_64-linux lib/nokogiri/css/tokenizer.rex
nokogiri-1.16.8-x86_64-darwin lib/nokogiri/css/tokenizer.rex
nokogiri-1.16.8-x64-mingw-ucrt lib/nokogiri/css/tokenizer.rex
nokogiri-1.16.8-x64-mingw32 lib/nokogiri/css/tokenizer.rex
nokogiri-1.16.8-java lib/nokogiri/css/tokenizer.rex
nokogiri-1.16.8 lib/nokogiri/css/tokenizer.rex