node_modules/gulp-sass/node_modules/node-sass/src/libsass/src/parser.cpp
// this parses interpolation outside other strings
// means the result must not be quoted again later
this parses interpolation outside other strings
means the result must not be quoted again later
this parses interpolation outside other strings means the result must not be quoted again later
String* Parser::parse_identifier_schema()
  {
    Token id(lexed);
    const char* i = id.begin;
    const char* p = find_first_in_interval< exactly<hash_lbrace> >(id.begin, id.end);
    if (!p) {
      return SASS_MEMORY_NEW(ctx.mem, String_Constant, pstate, std::string(id.begin, id.end));
    }
    String_Schema* schema = SASS_MEMORY_NEW(ctx.mem, String_Schema, pstate);
    while (i < id.end) {
      p = find_first_in_interval< exactly<hash_lbrace> >(i, id.end);
      if (p) {
        if (i < p) {
          const char* o = position; position = i;
          *schema << parse_value_schema(p);
          position = o;
        }
        if (peek < sequence < optional_spaces, exactly<rbrace> > >(p+2)) { position = p;
          css_error("Invalid CSS", " after ", ": expected expression (e.g. 1px, bold), was ");
        }
        const char* j = skip_over_scopes< exactly<hash_lbrace>, exactly<rbrace> >(p+2, id.end); 
        if (j) {
          Expression* interp_node = Parser::from_token(Token(p+2, j), ctx, pstate).parse_list();
          interp_node->is_interpolant(true);
          (*schema) << interp_node;
          schema->has_interpolants(true);
          i = j;
        }
        else {
          error("unterminated interpolant inside interpolated identifier " + id.to_string(), pstate);
        }
      }
      else { 
        if (i < end) {
          const char* o = position; position = i;
          *schema << parse_value_schema(id.end);
          position = o;
        }
        break;
      }
    }
    return schema;
  }
String * Parser :: parse_identifier_schema ( ) { Token id ( lexed ) ; const char * i = id . begin ; const char * p = find_first_in_interval < exactly < hash_lbrace > > ( id . begin , id . end ) ; if ( ! p ) { return SASS_MEMORY_NEW ( ctx . mem , String_Constant , pstate , std :: string ( id . begin , id . end ) ) ; } String_Schema * schema = SASS_MEMORY_NEW ( ctx . mem , String_Schema , pstate ) ; while ( i < id . end ) { p = find_first_in_interval < exactly < hash_lbrace > > ( i , id . end ) ; if ( p ) { if ( i < p ) { const char * o = position ; position = i ; * schema << parse_value_schema ( p ) ; position = o ; } if ( peek < sequence < optional_spaces , exactly < rbrace > > > ( p + 2 ) ) { position = p ; css_error ( " " , " " , " " ) ; } const char * j = skip_over_scopes < exactly < hash_lbrace > , exactly < rbrace > > ( p + 2 , id . end ) ; if ( j ) { Expression * interp_node = Parser :: from_token ( Token ( p + 2 , j ) , ctx , pstate ) . parse_list ( ) ; interp_node -> is_interpolant ( true ) ; ( * schema ) << interp_node ; schema -> has_interpolants ( true ) ; i = j ; } else { error ( " " + id . to_string ( ) , pstate ) ; } } else { if ( i < end ) { const char * o = position ; position = i ; * schema << parse_value_schema ( id . end ) ; position = o ; } break ; } } return schema ; }
this parses interpolation outside other strings
means the result must not be quoted again later
this parses interpolation outside other strings means the result must not be quoted again later
// see if there any interpolants // accumulate the preceding segment if it's nonempty // we need to skip anything inside strings // create a new target in parser/prelexer // find the closing brace // parse the interpolant and accumulate it // throw an error if the interpolant is unterminated // no interpolants left; add the last segment if nonempty