# HG changeset patch # User Paul Boddie # Date 1488219535 -3600 # Node ID 1b6f40b2928e42e4f31e6f6bdaee0f59e562756a # Parent 8dd8bb0f0e0b5e6116909e4624cdbbc2f8df8f25 Fixed the reset flag by propagating the reset condition to the translator, forcing all source files to be translated again. diff -r 8dd8bb0f0e0b -r 1b6f40b2928e lplc --- a/lplc Mon Feb 27 19:07:13 2017 +0100 +++ b/lplc Mon Feb 27 19:18:55 2017 +0100 @@ -293,7 +293,7 @@ if timings: now = stopwatch("Generation", now) t = translator.Translator(i, d, o, generated_dir) - t.to_output(debug, gc_sections) + t.to_output(reset, debug, gc_sections) if timings: now = stopwatch("Translation", now) diff -r 8dd8bb0f0e0b -r 1b6f40b2928e translator.py --- a/translator.py Mon Feb 27 19:07:13 2017 +0100 +++ b/translator.py Mon Feb 27 19:18:55 2017 +0100 @@ -47,7 +47,7 @@ self.optimiser = optimiser self.output = output - def to_output(self, debug=False, gc_sections=False): + def to_output(self, reset=False, debug=False, gc_sections=False): "Write a program to the configured output directory." @@ -70,7 +70,9 @@ parts = module.name.split(".") - if parts[0] != "native" and is_newer(module.filename, output_filename): + if parts[0] != "native" and \ + (reset or is_newer(module.filename, output_filename)): + tm = TranslatedModule(module.name, self.importer, self.deducer, self.optimiser) tm.translate(module.filename, output_filename)