diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
| commit | 967be9e750221ab2ab783f95df79bb26d290a45e (patch) | |
| tree | 6802900a5e975f9f68b169f0f503f040056d6952 /tiger-compiler/src/desugar/tasks.cc | |
Diffstat (limited to 'tiger-compiler/src/desugar/tasks.cc')
| -rw-r--r-- | tiger-compiler/src/desugar/tasks.cc | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tiger-compiler/src/desugar/tasks.cc b/tiger-compiler/src/desugar/tasks.cc new file mode 100644 index 0000000..0b83cb7 --- /dev/null +++ b/tiger-compiler/src/desugar/tasks.cc @@ -0,0 +1,49 @@ +/** + ** \file desugar/tasks.cc + ** \brief Desugar module related tasks' implementation. + **/ + +#include <ast/tasks.hh> +#include <astclone/libastclone.hh> +#include <common.hh> +#include <desugar/libdesugar.hh> +#define DEFINE_TASKS 1 +#include <desugar/tasks.hh> +#undef DEFINE_TASKS + +namespace desugar::tasks +{ + /*-------------. + | Desugaring. | + `-------------*/ + + void desugar() + { + astclone::apply(::desugar::desugar, ast::tasks::the_program, desugar_for_p, + desugar_string_cmp_p); + /// Escape after desugaring if escape was done before + if (escapes::escaped) + escapes::escapes_compute(*ast::tasks::the_program); + } + + void raw_desugar() + { + astclone::apply(::desugar::raw_desugar, ast::tasks::the_program, + desugar_for_p, desugar_string_cmp_p); + } + + /*-----------------------. + | Array bounds checking. | + `-----------------------*/ + + void bounds_checks_add() + { + astclone::apply(::desugar::bounds_checks_add, ast::tasks::the_program); + } + + void raw_bounds_checks_add() + { + astclone::apply(::desugar::raw_bounds_checks_add, ast::tasks::the_program); + } + +} // namespace desugar::tasks |
