From 89cbc42094817f5399d5d2c27fde7726a72ba838 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Tue, 23 Jul 2019 22:18:39 +0100 Subject: [PATCH] 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. --- pform.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pform.cc b/pform.cc index 2467044e6..5940616ed 100644 --- a/pform.cc +++ b/pform.cc @@ -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;