SPV_FAILED_MATCH error mutes DiagnosticStream.
authorDavid Neto <dneto@google.com>
Wed, 14 Oct 2015 15:31:51 +0000 (11:31 -0400)
committerDavid Neto <dneto@google.com>
Mon, 26 Oct 2015 16:55:33 +0000 (12:55 -0400)
commit51013d15ee86360489309ca0d9c385f8b4e9f871
tree7c56f70614e8fc757abd592af5cc5af51c1de6a3
parentf08c679e9798c7ab3e5ab5d225a3c0e911ccaaf6
SPV_FAILED_MATCH error mutes DiagnosticStream.

The DiagnosticStream will not emit the accumulated message
text if the error is SPV_FAILED_MATCH.

Change various interfaces to accept the intended error
code instead of a boolean "is_optional".  This allows
us to avoid repeating the following type of logic deep
inside helper methods:

  if (is_optional) return SPV_FAILED_MATCH;
  return diagnostic() << " message text ";
source/diagnostic.cpp
source/diagnostic.h
source/text.cpp
source/text_handler.cpp
source/text_handler.h
test/TextLiteral.cpp
test/TextToBinary.cpp