node_modules/gulp-sass/node_modules/node-sass/src/libsass/src/parser.cpp
/* main entry point to parse root block */
main entry point to parse root block
main entry point to parse root block
Block* Parser::parse()
  {
    bool is_root = false;
    Block* root = SASS_MEMORY_NEW(ctx.mem, Block, pstate, 0, true);
    read_bom();
    if (ctx.queue.size() == 1) {
      is_root = true;
      Import* pre = SASS_MEMORY_NEW(ctx.mem, Import, pstate);
      std::string load_path(ctx.queue[0].load_path);
      do_import(load_path, pre, ctx.c_headers, false);
      ctx.head_imports = ctx.queue.size() - 1;
      if (!pre->urls().empty()) (*root) << pre;
      if (!pre->files().empty()) {
        for (size_t i = 0, S = pre->files().size(); i < S; ++i) {
          (*root) << SASS_MEMORY_NEW(ctx.mem, Import_Stub, pstate, pre->files()[i]);
        }
      }
    }
    block_stack.push_back(root);
     parse_block_nodes(is_root);
    block_stack.pop_back();
    root->update_pstate(pstate);
    if (position != end) {
      css_error("Invalid CSS", " after ", ": expected selector or at-rule, was ");
    }
    return root;
  }
Block * Parser :: parse ( ) { bool is_root = false ; Block * root = SASS_MEMORY_NEW ( ctx . mem , Block , pstate , 0 , true ) ; read_bom ( ) ; if ( ctx . queue . size ( ) == 1 ) { is_root = true ; Import * pre = SASS_MEMORY_NEW ( ctx . mem , Import , pstate ) ; std :: string load_path ( ctx . queue [ 0 ] . load_path ) ; do_import ( load_path , pre , ctx . c_headers , false ) ; ctx . head_imports = ctx . queue . size ( ) - 1 ; if ( ! pre -> urls ( ) . empty ( ) ) ( * root ) << pre ; if ( ! pre -> files ( ) . empty ( ) ) { for ( size_t i = 0 , S = pre -> files ( ) . size ( ) ; i < S ; ++ i ) { ( * root ) << SASS_MEMORY_NEW ( ctx . mem , Import_Stub , pstate , pre -> files ( ) [ i ] ) ; } } } block_stack . push_back ( root ) ; parse_block_nodes ( is_root ) ; block_stack . pop_back ( ) ; root -> update_pstate ( pstate ) ; if ( position != end ) { css_error ( " " , " " , " " ) ; } return root ; }
main entry point to parse root block
main entry point to parse root block
/* bool rv = */ // update for end position