diff --git a/spec/compiler/helpers/stream_methods.cc b/spec/compiler/helpers/stream_methods.cc index 397494d7..f1f003b9 100644 --- a/spec/compiler/helpers/stream_methods.cc +++ b/spec/compiler/helpers/stream_methods.cc @@ -73,13 +73,13 @@ ostream &operator<<(ostream &stream, const ParseAction &action) { case ParseActionTypeAccept: return stream << string("#"); case ParseActionTypeShift: - return stream << (string("#"); + return stream << string("#"; case ParseActionTypeShiftExtra: return stream << string("#"); + return stream << "#"; case ParseActionTypeReduce: return stream << ("#"); @@ -109,6 +109,10 @@ ostream &operator<<(ostream &stream, const ProductionStep &step) { return stream << string("(production_step symbol:") << step.symbol << string(" precedence:") << to_string(step.precedence) << ")"; } +ostream &operator<<(ostream &stream, const PrecedenceRange &range) { + return stream << string("{") << to_string(range.min) << string(", ") << to_string(range.max) << string("}"); +} + namespace build_tables { ostream &operator<<(ostream &stream, const LexItem &item) { diff --git a/spec/compiler/helpers/stream_methods.h b/spec/compiler/helpers/stream_methods.h index 6ed890c3..cd132a03 100644 --- a/spec/compiler/helpers/stream_methods.h +++ b/spec/compiler/helpers/stream_methods.h @@ -95,6 +95,7 @@ class LexAction; class ParseAction; class ParseState; struct ProductionStep; +struct PrecedenceRange; ostream &operator<<(ostream &, const Grammar &); ostream &operator<<(ostream &, const GrammarError &); @@ -106,6 +107,7 @@ ostream &operator<<(ostream &, const LexAction &); ostream &operator<<(ostream &, const ParseAction &); ostream &operator<<(ostream &, const ParseState &); ostream &operator<<(ostream &, const ProductionStep &); +ostream &operator<<(ostream &, const PrecedenceRange &); namespace build_tables {