| 71 | } |
| 72 | |
| 73 | std::string Token::to_string() const { |
| 74 | if (IsTokenTypeBare(token_type_)) { |
| 75 | return GetTokenTypeName(token_type_); |
| 76 | } else if (HasLiteral()) { |
| 77 | return std::string(literal_.text); |
| 78 | } else if (HasOpcode()) { |
| 79 | return opcode_.GetName(); |
| 80 | } else if (HasText()) { |
| 81 | return std::string(text_); |
| 82 | } else if (IsTokenTypeRefKind(token_type_)) { |
| 83 | return type_.GetRefKindName(); |
| 84 | } else { |
| 85 | assert(HasType()); |
| 86 | return type_.GetName(); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | std::string Token::to_string_clamp(size_t max_length) const { |
| 91 | std::string s = to_string(); |
no test coverage detected