node_modules/gulp-sass/node_modules/node-sass/src/libsass/src/parser.cpp
// parse a list of complex selectors
// this is the main entry point for most
parse a list of complex selectors
this is the main entry point for most
parse a list of complex selectors this is the main entry point for most
Selector_List* Parser::parse_selector_list(bool in_root)
  {
    bool reloop = true;
    bool had_linefeed = false;
    Complex_Selector* sel = 0;
    To_String to_string(&ctx);
    Selector_List* group = SASS_MEMORY_NEW(ctx.mem, Selector_List, pstate);
    group->media_block(last_media_block);
    do {
      reloop = false;
      had_linefeed = had_linefeed || peek_newline();
      if (peek_css< class_char < selector_list_delims > >())
        break; 
      sel = parse_complex_selector(in_root);
      if (!sel) return group;
      sel->has_line_feed(had_linefeed);
      had_linefeed = false;
      while (peek_css< exactly<','> >())
      {
        lex< css_comments >(false);
        reloop = lex< exactly<','> >() != 0;
        had_linefeed = had_linefeed || peek_newline();
      }
      (*group) << sel;
    }
    while (reloop);
    while (lex_css< kwd_optional >()) {
      group->is_optional(true);
    }
    group->update_pstate(pstate);
    if (sel) sel->last()->has_line_break(false);
    return group;
  }
Selector_List * Parser :: parse_selector_list ( bool in_root ) { bool reloop = true ; bool had_linefeed = false ; Complex_Selector * sel = 0 ; To_String to_string ( & ctx ) ; Selector_List * group = SASS_MEMORY_NEW ( ctx . mem , Selector_List , pstate ) ; group -> media_block ( last_media_block ) ; do { reloop = false ; had_linefeed = had_linefeed || peek_newline ( ) ; if ( peek_css < class_char < selector_list_delims > > ( ) ) break ; sel = parse_complex_selector ( in_root ) ; if ( ! sel ) return group ; sel -> has_line_feed ( had_linefeed ) ; had_linefeed = false ; while ( peek_css < exactly < ' ' > > ( ) ) { lex < css_comments > ( false ) ; reloop = lex < exactly < ' ' > > ( ) != 0 ; had_linefeed = had_linefeed || peek_newline ( ) ; } ( * group ) << sel ; } while ( reloop ) ; while ( lex_css < kwd_optional > ( ) ) { group -> is_optional ( true ) ; } group -> update_pstate ( pstate ) ; if ( sel ) sel -> last ( ) -> has_line_break ( false ) ; return group ; }
parse a list of complex selectors
this is the main entry point for most
parse a list of complex selectors this is the main entry point for most
// in case there are superfluous commas at the end // now parse the complex selector // consume everything up and including the comma speparator // remember line break (also between some commas) // remember line break (also between some commas) // update for end position