Reset parser tracking variables when starting a new compilation unit.

This fixes the problem reported in GitHub issue #254, where if the
parser aborted on one compilation unit, spurious errors were reported
for the next compilation unit.
This commit is contained in:
Martin Whitaker 2019-07-23 22:18:39 +01:00
parent acdd78db7d
commit 89cbc42094
1 changed files with 4 additions and 0 deletions

View File

@ -3704,6 +3704,10 @@ int pform_parse(const char*path)
unit->set_lineno(1);
pform_units.push_back(unit);
pform_cur_module.clear();
pform_cur_generate = 0;
pform_cur_modport = 0;
pform_set_timescale(def_ts_units, def_ts_prec, 0, 0);
allow_timeunit_decl = true;