src/eval.cc
// With rule broken into
//   <before_term> <term> <after_term>
// parses <before_term> into Symbol instances until encountering ':'
// Returns the remainder of <before_term>.
With rule broken into
  
parses  into Symbol instances until encountering ':'
Returns the remainder of .
With rule broken into parses into Symbol instances until encountering ' : ' Returns the remainder of .
static StringPiece ParseRuleTargets(const Loc& loc,
                                    const StringPiece& before_term,
                                    vector<Symbol>* targets,
                                    bool* is_pattern_rule) {
  size_t pos = before_term.find(':');
  if (pos == string::npos) {
    ERROR_LOC(loc, "*** missing separator.");
  }
  StringPiece targets_string = before_term.substr(0, pos);
  size_t pattern_rule_count = 0;
  for (auto const& word : WordScanner(targets_string)) {
    StringPiece target = TrimLeadingCurdir(word);
    targets->push_back(Intern(target));
    if (Rule::IsPatternRule(target)) {
      ++pattern_rule_count;
    }
  }
  if (pattern_rule_count && (pattern_rule_count != targets->size())) {
    ERROR_LOC(loc, "*** mixed implicit and normal rules: deprecated syntax");
  }
  *is_pattern_rule = pattern_rule_count;
  return before_term.substr(pos + 1);
}
static StringPiece ParseRuleTargets ( const Loc & loc , const StringPiece & before_term , vector < Symbol > * targets , bool * is_pattern_rule ) { size_t pos = before_term . find ( ' ' ) ; if ( pos == string :: npos ) { ERROR_LOC ( loc , " " ) ; } StringPiece targets_string = before_term . substr ( 0 , pos ) ; size_t pattern_rule_count = 0 ; for ( auto const & word : WordScanner ( targets_string ) ) { StringPiece target = TrimLeadingCurdir ( word ) ; targets -> push_back ( Intern ( target ) ) ; if ( Rule :: IsPatternRule ( target ) ) { ++ pattern_rule_count ; } } if ( pattern_rule_count && ( pattern_rule_count != targets -> size ( ) ) ) { ERROR_LOC ( loc , " " ) ; } * is_pattern_rule = pattern_rule_count ; return before_term . substr ( pos + 1 ) ; }
With rule broken into
<before_term> <term> <after_term>
parses <before_term> into Symbol instances until encountering ':'
Returns the remainder of <before_term>.
With rule broken into <before_term > <term > <after_term > parses <before_term > into Symbol instances until encountering ' : ' Returns the remainder of <before_term > .
// Check consistency: either all outputs are patterns or none.