node_modules/gulp-sass/node_modules/node-sass/src/libsass/src/parser.cpp
// parse expression valid for operations
// called from parse_relation
// called from parse_for_directive
// called from parse_media_expression
// parse addition and subtraction operations
parse expression valid for operations
called from parse_relation
called from parse_for_directive
called from parse_media_expression
parse addition and subtraction operations
parse expression valid for operations called from parse_relation called from parse_for_directive called from parse_media_expression parse addition and subtraction operations
Expression* Parser::parse_expression()
  {
    Expression* lhs = parse_operators();
    if (!(peek< exactly<'+'> >(position) ||
          (peek< no_spaces >(position) && peek< sequence< negate< unsigned_number >, exactly<'-'>, negate< space > > >(position)) ||
          (peek< sequence< negate< unsigned_number >, exactly<'-'>, negate< unsigned_number > > >(position))) ||
          peek< identifier >(position))
    { return lhs; }
    std::vector<Expression*> operands;
    std::vector<Sass_OP> operators;
    while (lex< exactly<'+'> >() || lex< sequence< negate< digit >, exactly<'-'> > >()) {
      operators.push_back(lexed.to_string() == "+" ? Sass_OP::ADD : Sass_OP::SUB);
      operands.push_back(parse_operators());
    }
    if (operands.size() == 0) return lhs;
    return fold_operands(lhs, operands, operators);
  }
Expression * Parser :: parse_expression ( ) { Expression * lhs = parse_operators ( ) ; if ( ! ( peek < exactly < ' ' > > ( position ) || ( peek < no_spaces > ( position ) && peek < sequence < negate < unsigned_number > , exactly < ' ' > , negate < space > > > ( position ) ) || ( peek < sequence < negate < unsigned_number > , exactly < ' ' > , negate < unsigned_number > > > ( position ) ) ) || peek < identifier > ( position ) ) { return lhs ; } std :: vector < Expression * > operands ; std :: vector < Sass_OP > operators ; while ( lex < exactly < ' ' > > ( ) || lex < sequence < negate < digit > , exactly < ' ' > > > ( ) ) { operators . push_back ( lexed . to_string ( ) == " " ? Sass_OP :: ADD : Sass_OP :: SUB ) ; operands . push_back ( parse_operators ( ) ) ; } if ( operands . size ( ) == 0 ) return lhs ; return fold_operands ( lhs , operands , operators ) ; }
parse expression valid for operations
called from parse_relation
called from parse_for_directive
called from parse_media_expression
parse addition and subtraction operations
parse expression valid for operations called from parse_relation called from parse_for_directive called from parse_media_expression parse addition and subtraction operations
// if it's a singleton, return it (don't wrap it) // condition is a bit misterious, but some combinations should not be counted as operations