node_modules/gulp-sass/node_modules/node-sass/src/libsass/src/parser.cpp
// parse one value for a list
parse one value for a list
parse one value for a list
Expression* Parser::parse_value()
  {
    lex< css_comments >(false);
    if (lex< ampersand >())
    {
      return SASS_MEMORY_NEW(ctx.mem, Parent_Selector, pstate); }
    if (lex< kwd_important >())
    { return SASS_MEMORY_NEW(ctx.mem, String_Constant, pstate, "!important"); }
    if (const char* stop = peek< value_schema >())
    { return parse_value_schema(stop); }
    if (lex< quoted_string >())
    { return parse_string(); }
    if (lex< kwd_true >())
    { return SASS_MEMORY_NEW(ctx.mem, Boolean, pstate, true); }
    if (lex< kwd_false >())
    { return SASS_MEMORY_NEW(ctx.mem, Boolean, pstate, false); }
    if (lex< kwd_null >())
    { return SASS_MEMORY_NEW(ctx.mem, Null, pstate); }
    if (lex< identifier >()) {
      return SASS_MEMORY_NEW(ctx.mem, String_Constant, pstate, lexed);
    }
    if (lex< percentage >())
    { return SASS_MEMORY_NEW(ctx.mem, Textual, pstate, Textual::PERCENTAGE, lexed); }
    if (lex< sequence < alternatives< hex, hex0 >, negate < exactly<'-'> > > >())
    { return SASS_MEMORY_NEW(ctx.mem, Textual, pstate, Textual::HEX, lexed); }
    if (lex< sequence < exactly <'#'>, identifier > >())
    { return SASS_MEMORY_NEW(ctx.mem, String_Quoted, pstate, lexed); }
    if (lex< sequence< dimension, optional< sequence< exactly<'-'>, negate< digit > > > > >())
    { return SASS_MEMORY_NEW(ctx.mem, Textual, pstate, Textual::DIMENSION, lexed); }
    if (lex< sequence< static_component, one_plus< strict_identifier > > >())
    { return SASS_MEMORY_NEW(ctx.mem, String_Constant, pstate, lexed); }
    if (lex< number >())
    { return SASS_MEMORY_NEW(ctx.mem, Textual, pstate, Textual::NUMBER, lexed); }
    if (lex< variable >())
    { return SASS_MEMORY_NEW(ctx.mem, Variable, pstate, Util::normalize_underscores(lexed)); }
    if (lex< sequence< exactly<'%'>, optional< percentage > > >())
    { return SASS_MEMORY_NEW(ctx.mem, String_Constant, pstate, lexed); }
    error("error reading values after " + lexed.to_string(), pstate);
    return 0;
  }
Expression * Parser :: parse_value ( ) { lex < css_comments > ( false ) ; if ( lex < ampersand > ( ) ) { return SASS_MEMORY_NEW ( ctx . mem , Parent_Selector , pstate ) ; } if ( lex < kwd_important > ( ) ) { return SASS_MEMORY_NEW ( ctx . mem , String_Constant , pstate , " " ) ; } if ( const char * stop = peek < value_schema > ( ) ) { return parse_value_schema ( stop ) ; } if ( lex < quoted_string > ( ) ) { return parse_string ( ) ; } if ( lex < kwd_true > ( ) ) { return SASS_MEMORY_NEW ( ctx . mem , Boolean , pstate , true ) ; } if ( lex < kwd_false > ( ) ) { return SASS_MEMORY_NEW ( ctx . mem , Boolean , pstate , false ) ; } if ( lex < kwd_null > ( ) ) { return SASS_MEMORY_NEW ( ctx . mem , Null , pstate ) ; } if ( lex < identifier > ( ) ) { return SASS_MEMORY_NEW ( ctx . mem , String_Constant , pstate , lexed ) ; } if ( lex < percentage > ( ) ) { return SASS_MEMORY_NEW ( ctx . mem , Textual , pstate , Textual :: PERCENTAGE , lexed ) ; } if ( lex < sequence < alternatives < hex , hex0 > , negate < exactly < ' ' > > > > ( ) ) { return SASS_MEMORY_NEW ( ctx . mem , Textual , pstate , Textual :: HEX , lexed ) ; } if ( lex < sequence < exactly < ' ' > , identifier > > ( ) ) { return SASS_MEMORY_NEW ( ctx . mem , String_Quoted , pstate , lexed ) ; } if ( lex < sequence < dimension , optional < sequence < exactly < ' ' > , negate < digit > > > > > ( ) ) { return SASS_MEMORY_NEW ( ctx . mem , Textual , pstate , Textual :: DIMENSION , lexed ) ; } if ( lex < sequence < static_component , one_plus < strict_identifier > > > ( ) ) { return SASS_MEMORY_NEW ( ctx . mem , String_Constant , pstate , lexed ) ; } if ( lex < number > ( ) ) { return SASS_MEMORY_NEW ( ctx . mem , Textual , pstate , Textual :: NUMBER , lexed ) ; } if ( lex < variable > ( ) ) { return SASS_MEMORY_NEW ( ctx . mem , Variable , pstate , Util :: normalize_underscores ( lexed ) ) ; } if ( lex < sequence < exactly < ' ' > , optional < percentage > > > ( ) ) { return SASS_MEMORY_NEW ( ctx . mem , String_Constant , pstate , lexed ) ; } error ( " " + lexed . to_string ( ) , pstate ) ; return 0 ; }
parse one value for a list
parse one value for a list
// string may be interpolated // match hex number first because 0x000 looks like a number followed by an indentifier // also handle the 10em- foo special case // Special case handling for `%` proceeding an interpolant. // unreachable statement