'{' name+ '}'
| 2158 | |
| 2159 | // '{' name+ '}' |
| 2160 | bool HloParserImpl::ParseInstructionNames( |
| 2161 | std::vector<HloInstruction*>* instructions) { |
| 2162 | if (!ParseToken(TokKind::kLbrace, |
| 2163 | "expects '{' at the beginning of instruction name list")) { |
| 2164 | return false; |
| 2165 | } |
| 2166 | LocTy loc = lexer_.GetLoc(); |
| 2167 | do { |
| 2168 | std::string name; |
| 2169 | if (!ParseName(&name)) { |
| 2170 | return Error(loc, "expects a instruction name"); |
| 2171 | } |
| 2172 | std::pair<HloInstruction*, LocTy>* instr = FindInstruction(name); |
| 2173 | if (!instr) { |
| 2174 | return TokenError(StrFormat("instruction '%s' is not defined", name)); |
| 2175 | } |
| 2176 | instructions->push_back(instr->first); |
| 2177 | } while (EatIfPresent(TokKind::kComma)); |
| 2178 | |
| 2179 | return ParseToken(TokKind::kRbrace, |
| 2180 | "expects '}' at the end of instruction name list"); |
| 2181 | } |
| 2182 | |
| 2183 | bool HloParserImpl::SetValueInLiteral(LocTy loc, int64 value, int64 index, |
| 2184 | Literal* literal) { |
nothing calls this directly
no test coverage detected