From 433f060a5b584ab31ef388de646e917f3ef40424 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Fri, 30 Oct 2015 10:45:46 -0700 Subject: [PATCH] Fix stream overloads for inspecting PrecedenceRange and ParseItem --- spec/compiler/helpers/stream_methods.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/compiler/helpers/stream_methods.cc b/spec/compiler/helpers/stream_methods.cc index fe25d822..d794a256 100644 --- a/spec/compiler/helpers/stream_methods.cc +++ b/spec/compiler/helpers/stream_methods.cc @@ -110,7 +110,10 @@ ostream &operator<<(ostream &stream, const ProductionStep &step) { } ostream &operator<<(ostream &stream, const PrecedenceRange &range) { - return stream << string("{") << to_string(range.min) << string(", ") << to_string(range.max) << string("}"); + if (range.empty) + return stream << string("{empty}"); + else + return stream << string("{") << to_string(range.min) << string(", ") << to_string(range.max) << string("}"); } namespace build_tables { @@ -126,7 +129,7 @@ ostream &operator<<(ostream &stream, const LexItemSet &item_set) { ostream &operator<<(ostream &stream, const ParseItem &item) { return stream << string("(item variable:") << to_string(item.variable_index) - << string(" production:") << to_string((size_t)&item.production % 1000) + << string(" production:") << to_string((size_t)item.production % 1000) << string(" step:") << to_string(item.step_index) << string(")"); }