MCPcopy Create free account
hub / github.com/WebAssembly/wabt / to_string

Method to_string

src/token.cc:73–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73std::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
90std::string Token::to_string_clamp(size_t max_length) const {
91 std::string s = to_string();

Callers 3

PeekMethod · 0.45
ParseSimdV128ConstMethod · 0.45
ParseConstMethod · 0.45

Calls 5

IsTokenTypeBareFunction · 0.85
GetTokenTypeNameFunction · 0.85
IsTokenTypeRefKindFunction · 0.85
GetRefKindNameMethod · 0.80
GetNameMethod · 0.45

Tested by

no test coverage detected