summaryrefslogtreecommitdiffstats
path: root/parse.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'parse.cxx')
-rw-r--r--parse.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/parse.cxx b/parse.cxx
index 96d9a5d4..0eba81bb 100644
--- a/parse.cxx
+++ b/parse.cxx
@@ -77,6 +77,16 @@ tt2str(token_type tt)
}
ostream&
+operator << (ostream& o, const source_loc& loc)
+{
+ o << loc.file << ":"
+ << loc.line << ":"
+ << loc.column;
+
+ return o;
+}
+
+ostream&
operator << (ostream& o, const token& t)
{
o << tt2str(t.type);
@@ -93,9 +103,7 @@ operator << (ostream& o, const token& t)
}
o << " at "
- << t.location.file << ":"
- << t.location.line << ":"
- << t.location.column;
+ << t.location;
return o;
}