MCPcopy Create free account
hub / github.com/covscript/covscript / dump

Method dump

sources/compiler/compiler.cpp:44–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42 };
43
44 bool token_value::dump(std::ostream &o) const
45 {
46 o << "< Value = ";
47 if (mVal.is_type_of<cs::string>()) {
48 o << "\"";
49 const cs::string &str = mVal.const_val<cs::string>();
50 for (auto ch : str) {
51 if (escape_char.count(ch) > 0)
52 o << '\\' << escape_char.at(ch);
53 else
54 o << ch;
55 }
56 o << "\"";
57 }
58 else if (mVal.is_type_of<char>()) {
59 o << "\'";
60 char ch = mVal.const_val<char>();
61 if (escape_char.count(ch) > 0)
62 o << '\\' << escape_char.at(ch);
63 else
64 o << ch;
65 o << "\'";
66 }
67 else
68 o << mVal.to_string();
69 o << ">";
70 return true;
71 }
72
73 bool token_signal::dump(std::ostream &o) const
74 {

Callers 1

dump_exprMethod · 0.45

Calls 2

to_stringMethod · 0.45
rootMethod · 0.45

Tested by

no test coverage detected