redef class ToolContext
# The various registered phases to performs
- # The order in the poset is the dependance of phases
+ # The order in the poset is the dependence of phases
#
# While you can directly modify the poset (nodes and edges),
# it is often simpler to use the constructor in `Phase`
# --disable-phase
var opt_disable_phase = new OptionArray("DEBUG: Disable a specific phase; use `list` to get the list.", "--disable-phase")
+ # --disable-phase
+ var opt_sloppy = new OptionBool("DEBUG: force lazy semantic analysis of the source-code", "--sloppy")
+
redef init
do
super
- option_context.add_option(opt_disable_phase)
+ option_context.add_option(opt_disable_phase, opt_sloppy)
end
redef fun process_options(args)
end
if not found then fatal_error(null, "Error: no phase named `{v}`. Use `list` to list all phases.")
end
+
+ if opt_sloppy.value then semantize_is_lazy = true
end
- fun phases_list: Sequence[Phase]
- do
+ # The list of registered phases in the application order.
+ var phases_list: Sequence[Phase] is lazy do
var phases = self.phases.to_a
self.phases.sort(phases)
return phases
errors_info
end
- fun phase_process_npropdef(phase: Phase, npropdef: APropdef)
+ # Process the given `phase` on the `npropdef`
+ # Called by `run_phases`
+ protected fun phase_process_npropdef(phase: Phase, npropdef: APropdef)
do
phase.process_npropdef(npropdef)
end