[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 00c737d 1/6: Ensure that parser issues a diag
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 00c737d 1/6: Ensure that parser issues a diagnostic when insanity detected |
Date: |
Tue, 28 Feb 2017 22:02:58 -0500 (EST) |
branch: master
commit 00c737de694836769d465ccada7750b523b2048a
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Ensure that parser issues a diagnostic when insanity detected
Formerly, the last statement in span() began
if(!current_interval_.insane)
which raised the question "else what?". The answer was that presumably
a diagnostic had been issued. Now, if there had been no diagnostic, one
is issued anyway. All diagnostics are treated as errors, so in effect
this ensures that any insanity detected here is trapped.
---
input_sequence_parser.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/input_sequence_parser.cpp b/input_sequence_parser.cpp
index 9300a1a..e0b82f2 100644
--- a/input_sequence_parser.cpp
+++ b/input_sequence_parser.cpp
@@ -489,7 +489,15 @@ void SequenceParser::span()
mark_diagnostic_context();
}
}
- if(!current_interval_.insane)
+ if(current_interval_.insane)
+ {
+ if(diagnostics_.str().empty())
+ {
+ diagnostics_ << "Internal parser error. ";
+ mark_diagnostic_context();
+ }
+ }
+ else
{
intervals_.push_back(current_interval_);
}
- [lmi-commits] [lmi] master updated (86aacf1 -> b56fb86), Greg Chicares, 2017/02/28
- [lmi-commits] [lmi] master 2afd2fe 3/6: Improve concinnity, Greg Chicares, 2017/02/28
- [lmi-commits] [lmi] master 00c737d 1/6: Ensure that parser issues a diagnostic when insanity detected,
Greg Chicares <=
- [lmi-commits] [lmi] master 4b0c2ee 4/6: Remove an unreachable statement, Greg Chicares, 2017/02/28
- [lmi-commits] [lmi] master b56fb86 6/6: Canonicalize a near-canonical result, Greg Chicares, 2017/02/28
- [lmi-commits] [lmi] master 0d3c75a 5/6: Improve readability, Greg Chicares, 2017/02/28
- [lmi-commits] [lmi] master 3de3cf5 2/6: s12n(c14n), Greg Chicares, 2017/02/28