Methods
#
U
Constants
Racc_arg = [ racc_action_table, racc_action_check, racc_action_default, racc_action_pointer, racc_goto_table, racc_goto_check, racc_goto_default, racc_goto_pointer, racc_nt_base, racc_reduce_table, racc_token_table, racc_shift_n, racc_reduce_n, racc_use_result_var ]
 
Racc_token_to_s_table = [ "$end", "error", "FUNCTION", "INCLUDES", "DASHMATCH", "LBRACE", "HASH", "PLUS", "GREATER", "S", "STRING", "IDENT", "COMMA", "NUMBER", "PREFIXMATCH", "SUFFIXMATCH", "SUBSTRINGMATCH", "TILDE", "NOT_EQUAL", "SLASH", "DOUBLESLASH", "NOT", "EQUAL", "RPAREN", "LSQUARE", "RSQUARE", "HAS", "\".\"", "\"*\"", "\"|\"", "\":\"", "$start", "selector", "simple_selector_1toN", "prefixless_combinator_selector", "optional_S", "combinator", "simple_selector", "element_name", "hcap_0toN", "function", "pseudo", "attrib", "hcap_1toN", "class", "namespaced_ident", "namespace", "attrib_name", "attrib_val_0or1", "expr", "nth", "attribute_id", "negation", "eql_incl_dash", "negation_arg" ]
 
Racc_debug_parser = false
 
Instance Public methods
_reduce_1(val, _values, result)

reduce 0 omitted

# File lib/nokogiri/css/parser.rb, line 321
def _reduce_1(val, _values, result)
        result = [val.first, val.last].flatten
      
    result
end
_reduce_11(val, _values, result)

reduce 10 omitted

# File lib/nokogiri/css/parser.rb, line 374
def _reduce_11(val, _values, result)
        result = Node.new(:CONDITIONAL_SELECTOR, val)
      
    result
end
_reduce_12(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 380
def _reduce_12(val, _values, result)
        result = Node.new(:CONDITIONAL_SELECTOR, val)
      
    result
end
_reduce_13(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 386
def _reduce_13(val, _values, result)
        result = Node.new(:CONDITIONAL_SELECTOR,
          [Node.new(:ELEMENT_NAME, ['*']), val.first]
        )
      
    result
end
_reduce_14(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 394
def _reduce_14(val, _values, result)
        result = Node.new(val.first, [nil, val.last])
      
    result
end
_reduce_15(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 400
def _reduce_15(val, _values, result)
        result = Node.new(val[1], [val.first, val.last])
      
    result
end
_reduce_16(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 406
def _reduce_16(val, _values, result)
        result = Node.new(:DESCENDANT_SELECTOR, [val.first, val.last])
      
    result
end
_reduce_18(val, _values, result)

reduce 17 omitted

# File lib/nokogiri/css/parser.rb, line 414
def _reduce_18(val, _values, result)
 result = Node.new(:CLASS_CONDITION, [unescape_css_identifier(val[1])]) 
    result
end
_reduce_2(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 327
def _reduce_2(val, _values, result)
 result = val.flatten 
    result
end
_reduce_20(val, _values, result)

reduce 19 omitted

# File lib/nokogiri/css/parser.rb, line 421
def _reduce_20(val, _values, result)
 result = Node.new(:ELEMENT_NAME, val) 
    result
end
_reduce_21(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 426
def _reduce_21(val, _values, result)
        result = Node.new(:ELEMENT_NAME,
          [[val.first, val.last].compact.join(':')]
        )
      
    result
end
_reduce_22(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 434
def _reduce_22(val, _values, result)
        name = @namespaces.key?('xmlns') ? "xmlns:#{val.first}" : val.first
        result = Node.new(:ELEMENT_NAME, [name])
      
    result
end
_reduce_23(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 441
def _reduce_23(val, _values, result)
 result = val[0] 
    result
end
_reduce_25(val, _values, result)

reduce 24 omitted

# File lib/nokogiri/css/parser.rb, line 448
def _reduce_25(val, _values, result)
        result = Node.new(:ATTRIBUTE_CONDITION,
          [val[1]] + (val[2] || [])
        )
      
    result
end
_reduce_26(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 456
def _reduce_26(val, _values, result)
        result = Node.new(:ATTRIBUTE_CONDITION,
          [val[1]] + (val[2] || [])
        )
      
    result
end
_reduce_27(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 464
def _reduce_27(val, _values, result)
        # Non standard, but hpricot supports it.
        result = Node.new(:PSEUDO_CLASS,
          [Node.new(:FUNCTION, ['nth-child(', val[1]])]
        )
      
    result
end
_reduce_28(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 473
def _reduce_28(val, _values, result)
        result = Node.new(:ELEMENT_NAME,
          [[val.first, val.last].compact.join(':')]
        )
      
    result
end
_reduce_29(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 481
def _reduce_29(val, _values, result)
        # Default namespace is not applied to attributes.
        # So we don't add prefix "xmlns:" as in namespaced_ident.
        result = Node.new(:ELEMENT_NAME, [val.first])
      
    result
end
_reduce_3(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 332
def _reduce_3(val, _values, result)
 result = [val.last].flatten 
    result
end
_reduce_30(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 489
def _reduce_30(val, _values, result)
        result = Node.new(:FUNCTION, [val.first.strip])
      
    result
end
_reduce_31(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 495
def _reduce_31(val, _values, result)
        result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
      
    result
end
_reduce_32(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 501
def _reduce_32(val, _values, result)
        result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
      
    result
end
_reduce_33(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 507
def _reduce_33(val, _values, result)
        result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
      
    result
end
_reduce_34(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 513
def _reduce_34(val, _values, result)
        result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
      
    result
end
_reduce_35(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 519
def _reduce_35(val, _values, result)
 result = [val.first, val.last] 
    result
end
_reduce_36(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 524
def _reduce_36(val, _values, result)
 result = [val.first, val.last] 
    result
end
_reduce_37(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 529
def _reduce_37(val, _values, result)
 result = [val.first, val.last] 
    result
end
_reduce_4(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 337
def _reduce_4(val, _values, result)
 result = :DIRECT_ADJACENT_SELECTOR 
    result
end
_reduce_40(val, _values, result)

reduce 39 omitted

# File lib/nokogiri/css/parser.rb, line 538
def _reduce_40(val, _values, result)
        case val[0]
        when 'even'
          result = Node.new(:NTH, ['2','n','+','0'])
        when 'odd'
          result = Node.new(:NTH, ['2','n','+','1'])
        when 'n'
          result = Node.new(:NTH, ['1','n','+','0'])
        else
          # This is not CSS standard.  It allows us to support this:
          # assert_xpath("//a[foo(., @href)]", @parser.parse('a:foo(@href)'))
          # assert_xpath("//a[foo(., @a, b)]", @parser.parse('a:foo(@a, b)'))
          # assert_xpath("//a[foo(., a, 10)]", @parser.parse('a:foo(a, 10)'))
          result = val
        end
      
    result
end
_reduce_41(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 557
def _reduce_41(val, _values, result)
        if val[1] == 'n'
          result = Node.new(:NTH, val)
        else
          raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
        end
      
    result
end
_reduce_42(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 567
def _reduce_42(val, _values, result)
               # n+3, -n+3
        if val[0] == 'n'
          val.unshift("1")
          result = Node.new(:NTH, val)
        elsif val[0] == '-n'
          val[0] = 'n'
          val.unshift("-1")
          result = Node.new(:NTH, val)
        else
          raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
        end
      
    result
end
_reduce_43(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 583
def _reduce_43(val, _values, result)
                    # 5n, -5n, 10n-1
        n = val[1]
        if n[0, 2] == 'n-'
          val[1] = 'n'
          val << "-"
          # b is contained in n as n is the string "n-b"
          val << n[2, n.size]
          result = Node.new(:NTH, val)
        elsif n == 'n'
          val << "+"
          val << "0"
          result = Node.new(:NTH, val)
        else
          raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
        end
      
    result
end
_reduce_44(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 603
def _reduce_44(val, _values, result)
        result = Node.new(:PSEUDO_CLASS, [val[1]])
      
    result
end
_reduce_45(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 609
def _reduce_45(val, _values, result)
 result = Node.new(:PSEUDO_CLASS, [val[1]]) 
    result
end
_reduce_48(val, _values, result)

reduce 47 omitted

# File lib/nokogiri/css/parser.rb, line 618
def _reduce_48(val, _values, result)
        result = Node.new(:COMBINATOR, val)
      
    result
end
_reduce_49(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 624
def _reduce_49(val, _values, result)
        result = Node.new(:COMBINATOR, val)
      
    result
end
_reduce_5(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 342
def _reduce_5(val, _values, result)
 result = :CHILD_SELECTOR 
    result
end
_reduce_50(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 630
def _reduce_50(val, _values, result)
        result = Node.new(:COMBINATOR, val)
      
    result
end
_reduce_51(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 636
def _reduce_51(val, _values, result)
        result = Node.new(:COMBINATOR, val)
      
    result
end
_reduce_52(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 642
def _reduce_52(val, _values, result)
        result = Node.new(:COMBINATOR, val)
      
    result
end
_reduce_58(val, _values, result)

reduce 57 omitted

# File lib/nokogiri/css/parser.rb, line 658
def _reduce_58(val, _values, result)
 result = Node.new(:ID, [unescape_css_identifier(val.first)]) 
    result
end
_reduce_59(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 663
def _reduce_59(val, _values, result)
 result = [val.first, val[1]] 
    result
end
_reduce_6(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 347
def _reduce_6(val, _values, result)
 result = :FOLLOWING_SELECTOR 
    result
end
_reduce_60(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 668
def _reduce_60(val, _values, result)
 result = [val.first, val[1]] 
    result
end
_reduce_62(val, _values, result)

reduce 61 omitted

# File lib/nokogiri/css/parser.rb, line 675
def _reduce_62(val, _values, result)
 result = :equal 
    result
end
_reduce_63(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 680
def _reduce_63(val, _values, result)
 result = :prefix_match 
    result
end
_reduce_64(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 685
def _reduce_64(val, _values, result)
 result = :suffix_match 
    result
end
_reduce_65(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 690
def _reduce_65(val, _values, result)
 result = :substring_match 
    result
end
_reduce_66(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 695
def _reduce_66(val, _values, result)
 result = :not_equal 
    result
end
_reduce_67(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 700
def _reduce_67(val, _values, result)
 result = :includes 
    result
end
_reduce_68(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 705
def _reduce_68(val, _values, result)
 result = :dash_match 
    result
end
_reduce_69(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 710
def _reduce_69(val, _values, result)
        result = Node.new(:NOT, [val[1]])
      
    result
end
_reduce_7(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 352
def _reduce_7(val, _values, result)
 result = :DESCENDANT_SELECTOR 
    result
end
_reduce_8(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 357
def _reduce_8(val, _values, result)
 result = :CHILD_SELECTOR 
    result
end
_reduce_9(val, _values, result)
# File lib/nokogiri/css/parser.rb, line 362
def _reduce_9(val, _values, result)
        result =  if val[1].nil?
                    val.first
                  else
                    Node.new(:CONDITIONAL_SELECTOR, [val.first, val[1]])
                  end
      
    result
end
_reduce_none(val, _values, result)

reduce 74 omitted

# File lib/nokogiri/css/parser.rb, line 726
def _reduce_none(val, _values, result)
  val[0]
end
unescape_css_identifier(identifier)
# File lib/nokogiri/css/parser.rb, line 17
def unescape_css_identifier(identifier)
  identifier.gsub(/\(?:([^0-9a-fA-F])|([0-9a-fA-F]{1,6})\s?)/){ |m| $1 || [$2.hex].pack('U') }
end