Output::~Output ()
{
- source.emit (types, max_fill);
- header.emit (types);
+ if (!warn.error ())
+ {
+ source.emit (types, max_fill);
+ header.emit (types);
+ }
}
void output_state_goto_sub (std::ostream & o, uint32_t ind, uint32_t start_label, int cMin, int cMax)
Warn::Warn ()
: mask ()
- , error (false)
+ , error_accuml (false)
{
for (uint32_t i = 0; i < TYPES; ++i)
{
}
}
-uint32_t Warn::error_code () const
+bool Warn::error () const
{
- return error;
+ return error_accuml;
}
void Warn::set (type_t t, option_t o)
{
if (mask[EMPTY_CHARACTER_CLASS] & ERROR)
{
- error = true;
+ error_accuml = true;
}
warning (names[EMPTY_CHARACTER_CLASS], "empty character class at line %u", line);
}
{
if (mask[EMPTY_RULE] & ERROR)
{
- error = true;
+ error_accuml = true;
}
warning (names[EMPTY_RULE], "empty rule at line %u", line);
}
{
if (mask[NAKED_DEFAULT] & ERROR)
{
- error = true;
+ error_accuml = true;
}
std::ostringstream s;
for (uint32_t i = 0; i < stray_cunits.size (); ++i)
static const uint8_t ERROR;
static const char * names [TYPES];
uint8_t mask[TYPES];
- bool error;
+ bool error_accuml;
public:
Warn ();
- uint32_t error_code () const;
+ bool error () const;
void set (type_t t, option_t o);
void set_all (option_t o);
void empty_class (uint32_t line);
Scanner scanner (input, output.source);
parse (scanner, output);
- return warn.error_code ();
+ return warn.error () ? 1 : 0;
}