Pretty print THIS_TOKEN and SUPER_TOKEN
Internally the special THIS_TOKEN("@") and SUPER_TOKEN("#") are used
to represent the special `this` and `super` keywords in a component
name.
When printing an identifier replace the tokens with their keywords.
This generates nicer error and debug messages.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
862b118098
commit
7188f7b210
|
|
@ -87,6 +87,11 @@ ostream& operator<< (ostream&out, const index_component_t&that)
|
||||||
|
|
||||||
ostream& operator<< (ostream&out, const name_component_t&that)
|
ostream& operator<< (ostream&out, const name_component_t&that)
|
||||||
{
|
{
|
||||||
|
if (that.name == THIS_TOKEN)
|
||||||
|
out << "this";
|
||||||
|
else if (that.name == SUPER_TOKEN)
|
||||||
|
out << "super";
|
||||||
|
else
|
||||||
out << that.name.str();
|
out << that.name.str();
|
||||||
|
|
||||||
typedef std::list<index_component_t>::const_iterator index_it_t;
|
typedef std::list<index_component_t>::const_iterator index_it_t;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue