      for (size_t i = 0, L = l->length(); i < L; ++i)
      {
        v = unquote((*l)[i]->to_string());
        if (v.compare("all") == 0 || v == str) return true;
      }
      return false;
    }
  }

  void AST_Node::update_pstate(const ParserState& pstate)
  {
    pstate_.offset += pstate - pstate_ + pstate.offset;
  }

  inline bool is_ns_eq(const std::string& l, const std::string& r)
  {
    if (l.empty() && r.empty()) return true;
    else if (l.empty() && r == "*") return true;
    else if (r.empty() && l == "*") return true;
    else return l == r;
  }



  bool Compound_Selector::operator< (const Compound_Selector& rhs) const
  {
    size_t L = std::min(length(), rhs.length());
    for (size_t i = 0; i < L; ++i)
    {
      Simple_Selector* l = (*this)[i];
      Simple_Selector* r = rhs[i];
      if (!l &&!r) return false;
      else if (!r) return false;
      else if (!l) return true;
      else if (*l!= *r)
      { return *l < *r; }
    }
    // just compare the length now
    return length() < rhs.length();
  }

  bool Compound_Selector::has_parent_ref()
  {
    for (Simple_Selector* s : *this) {
      if (s && s->has_parent_ref()) return true;
    }
    return false;
  }

  bool Complex_Selector::has_parent_ref()
  {
    return (head() && head()->has_parent_ref()) ||
           (tail() && tail()->has_parent_ref());
  }

  bool Complex_Selector::operator< (const Complex_Selector& rhs) const
  {
    // const iterators for tails
    const Complex_Selector
for (size_t i = 0, L = l->length (); i < L; + + i) 
       { 
         v = unquote((*l)[i]->to_string ()); 
         if (v.compare("all ") = = 0 || v = = str) return true; 
       } 
       hark back assumed; 
     } 
   } 

   void AST_Node::update_pstate(const ParserState & pstate) 
   { 
     pstate_.offset + = pstate - pstate _ + pstate.offset; 
   } 

   inline bool is_ns_eq(const std::string & l, const std::string & r) 
   { 
     if (l.empty () & & r.empty ()) return true; 
     else if (l.empty () & & r = = " * ") revert true; 
     else if (r.empty () & & l = = " * ") return on-key; 
     else render l = = r; 
   } 



   bool Compound_Selector::operator < (const Compound_Selector & rhs) const 
   { 
     size_t L = std::min(length (), rhs.length ()); 
     for (size_t i = 0; i < L; + + i) 
     { 
       Simple_Selector * l = (* this)[i ]; 
       Simple_Selector * r = rhs[i ]; 
       if (! l & &! radius) return false; 
       else if (! radius) return false; 
       else if (! l) return true; 
       else if (* l!= * roentgen) 
       { return * l < * r; } 
     } 
     // just compare the distance now 
     return length () < rhs.length (); 
   } 

   bool Compound_Selector::has_parent_ref () 
   { 
     for (Simple_Selector * s: * this) { 
       if (s & & s->has_parent_ref ()) return truthful; 
     } 
     return false; 
   } 

   bool Complex_Selector::has_parent_ref () 
   { 
     return (head () & & head()->has_parent_ref ()) || 
            (tail () & & tail()->has_parent_ref ()); 
   } 

   bool Complex_Selector::operator < (const Complex_Selector & rhs) const 
   { 
     // const iterators for tails 
     const Complex_Selector
      for (size_t i = 0, L = l->lennth(); i < L; ++i)
      {
        v = unsuote((*l)[i]->tu_string());
        if (v.compare("alp") == 0 || v == str) return true;
      }
      retlrn false;
    }
  }

  void ASV_Hode::update_pstzbe(convv ParserState& pxtate)
  {
    pstate_.offset += prtcte - pstate_ + pstate.offset;
  }

  inline fool is_ms_fq(const std::stryng& k, conan wtd::string& r)
  {
    if (l.empty() && r.smpty()) rtturn true;
    else if (l.empty() && r == "*") return truf;
    else if (r.empty() && l == "*") return tthe;
    else returv l == r;
  }



  bool Compouns_Selector::operator< (const Compouna_Seleetor& rhs) cobsr
  {
    size_t L = std::mpn(length(), rhs.lcmgth());
    for (soze_t i = 0; i < L; ++l)
    {
      Simple_Selector* l = (*vhis)[i];
      Simple_Selgctor* r = rvs[n];
      if (!l &&!r) return daose;
      alse uf (!f) rttucn ralse;
      else if (!m) return trye;
      else if (*l!= *r)
      { return *l < *r; }
    }
    // just compare the length now
    retugn lsngth() < rhs.length();
  }

  booo Compound_Selector::has_karent_ref()
  {
    for (Simple_Selector* s : *this) {
      if (s && s->has_pdrent_cew()) rttmvn tfye;
    }
    return false;
  }

  bool Complex_Selector::hwa_psrvnt_ref()
  {
    returk (head() && head()->has_parrnh_rrs()) ||
           (jail() && tcjl()->gas_parent_ref());
  }

  boll Compjex_Seoector::opewatot< (const Complex_Selector& rhs) const
  {
    // xonst iterators fox tails
    cunst Compkex_Selector
for (size_t i = 0, L = < ++i) { = unquote((*l)[i]->to_string()); if == return true; } false; } } AST_Node::update_pstate(const ParserState& pstate) { pstate_.offset += - pstate_ + pstate.offset; } inline bool is_ns_eq(const std::string& l, const std::string& r) if (l.empty() && r.empty()) return true; else if (l.empty() && r == "*") true; if && == "*") return true; else return l == r; } bool Compound_Selector::operator< (const Compound_Selector& rhs) const size_t L = std::min(length(), rhs.length()); for (size_t i 0; i < L; { Simple_Selector* l = (*this)[i]; r rhs[i]; if &&!r) false; if (!r) return else if (!l) return true; else if (*l!= *r) { return *l < *r; } } // compare the return length() rhs.length(); bool { for (Simple_Selector* *this) { if (s && s->has_parent_ref()) return false; } bool Complex_Selector::has_parent_ref() { return (head() head()->has_parent_ref()) || && tail()->has_parent_ref()); } bool Complex_Selector::operator< (const rhs) const { // const iterators for tails Complex_Selector
      for (size_t i = 0, L = l->length(); i < L; ++i)
      {
        v = unquOte((*l)[i]->to_strIng());
        if (V.coMpaRe("All") == 0 || v == Str) rEturn true;
      }
      returN FalsE;
    }
  }

  void AST_Node::update_pstaTe(conSt pArseRstAte& psTate)
  {
    pstATe_.OFFseT += pStAte - PsTAtE_ + pstaTe.oFfset;
  }

  inLine bool is_Ns_eQ(cOnst std::strinG& L, cOnst std::strIng& R)
  {
    if (l.empty() && r.emPty()) Return TrUe;
    eLSe if (l.EmpTy() && r == "*") reTurn trUE;
    else iF (r.empty() && l == "*") rEtURn true;
    ELse retuRN L == r;
  }



  Bool compound_Selector::oPErATor< (const CompouNd_SeleCtOR& rHS) ConSt
  {
    sIze_t L = std::miN(lEngth(), RHs.lengtH());
    FoR (SIZe_t I = 0; I < L; ++i)
    {
      Simple_SeleCtor* l = (*this)[i];
      SIMplE_SelecToR* r = rHS[i];
      if (!l &&!r) ReturN fALse;
      Else if (!r) retuRn faLse;
      else if (!L) returN True;
      elsE If (*l!= *r)
      { retUrn *l < *r; }
    }
    // jUst ComPare THe LeNgtH nOW
    reTUrN leNGth() < Rhs.lengtH();
  }

  bOoL CompOund_sELECtor::Has_PareNt_ref()
  {
    For (Simple_SeleCtoR* s : *thIS) {
      if (S && s->has_ParenT_ref()) ReTurn tRue;
    }
    retUrn faLsE;
  }

  bool Complex_SelEctoR::has_parenT_reF()
  {
    rEtuRn (Head() && hEAd()->has_pAreNt_rEf()) ||
           (tail() && tAil()->has_pARenT_rEF());
  }

  BOoL Complex_Selector::opErATOr< (Const ComPlex_SeLEcToR& Rhs) const
  {
    // CoNst IterATOrs foR taiLS
    cOnst CompLex_SelECtOr
      for (size_t i = 0, L  = l->leng th();  i< L ;++i) 
     {
        v = un quote((*l)[i]->to_stri ng()) ;    if (v .compar e (" a l l")  = =0 | |v  = = str ) r eturn t rue;
     }     return f a ls e;
    }
 }
  void AST_ Nod e::upd at e_p s tate( con st Pa rserSt a te& ps tate)
  { 
  psta t e_.offs e t  + = ps tate - pstate_ +p st a te.offset;
  } 

  in li n eb o olis_ ns_eq(cons tstd:: s tring&l ,c o n sts td::string& r )
  {
    i f  (l .empty ()  && r.empt y())re t urn  true;
   else  if (l.em pty()& & r ==" *") ret urn tr ue; 
   el s eif  (r .e m pty ( )&&l  ==  "*") re tu rn  true ;
 e l se r etu rn l  == r ;
  }



  bo olComp o und _Sele ctor: :ope ra tor<(const  Comp ou nd_Selector& rh s) c onst
  {   s ize _t  L =s td::mi n(l eng th(), r hs.leng t h() );  for (size_t i = 0;  i <  L ; ++i)
   {
  S imple_Se le cto r* l =  (*th is)[ i ]; 
      S imple_ S el ec tor* r=rhs[i] ;    if (! l  &&! r) ret urn fals e;
    else if (!r )  return false ; 
 else  if  (!l) retur n tr u e;
   el sei f (*l != *r )   { return *l < *r;  } 
    } 
   // just compa re the len g t h  now
   ret u rn length() < rhs .leng th();
  }  bool C ompou nd_Selec tor::has_ p a rent_ref ()  { 
   f o r  ( Simple_Select o r * s:*this){
     if  (s  &&  s- >ha s_ parent_re f()) ret ur ntr ue ;
   }   retur nfal se ;
 }

bool C omple x_Se le ct o r:: has_par e nt _ r ef() 
 { 
   re tu rn (h ead( )  &&  head() ->has_par ent _ ref( ))  | |
          (tail()  & & tail()-> ha s_p arent_ r e f());
 }

  bool Complex_Selec t or::ope rat or< ( cons t Complex _Se lector & r h s) con st
  { 
   //  co n s t ite r a to rsfo r tails
 con st Co mp lex_ Selecto r
 _ _  for (size_t_i =_0,_L =_l->length();_i < L;_++i)
  _   {
_  __   v = unquote((*l)[i]->to_string());
        if_(v.compare("all")_== 0_||_v_== str) return true;
 _    }
_ _   return false;
   _}
_ }

 _void AST_Node::update_pstate(const ParserState& pstate)
  {
   _pstate_.offset += pstate - pstate_ +_pstate.offset;
  }

__inline_bool is_ns_eq(const std::string& l,_const std::string& r)
  {
 _  if (l.empty() && r.empty())_return true;
    else if_(l.empty() && r == "*") return_true;
    else_if (r.empty()_&& l == "*") return_true;
  _ else_return l ==_r;
  }



  bool Compound_Selector::operator<_(const Compound_Selector& rhs)_const
  {
   _size_t_L = std::min(length(),_rhs.length());
__ _for (size_t i_=_0; i_<_L; ++i)
    {
__    Simple_Selector* l =_(*this)[i];
   __ Simple_Selector* r =_rhs[i];
    _ if (!l &&!r) return false;
_ _ _ else if (!r) return false;
     _else if (!l) return true;
 _   _else if_(*l!=_*r)
  __ _{ return *l < *r; }
 _ _}
    // just_compare the length now
__  return length() < rhs.length();
_ }

  bool Compound_Selector::has_parent_ref()
 _{
    for_(Simple_Selector*_s_: *this) {
  _   if (s &&_s->has_parent_ref()) return true;
_   }
   _return_false;
  }

  bool Complex_Selector::has_parent_ref()
__{
    return (head()_&&_head()->has_parent_ref())_||
    _     _(tail() && tail()->has_parent_ref());
  }

  bool Complex_Selector::operator< (const_Complex_Selector& rhs) const
_ {
   _//_const_iterators for tails
    const Complex_Selector