summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/assert/tasks.hh
diff options
context:
space:
mode:
Diffstat (limited to 'tiger-compiler/src/assert/tasks.hh')
-rw-r--r--tiger-compiler/src/assert/tasks.hh59
1 files changed, 59 insertions, 0 deletions
diff --git a/tiger-compiler/src/assert/tasks.hh b/tiger-compiler/src/assert/tasks.hh
new file mode 100644
index 0000000..7f062de
--- /dev/null
+++ b/tiger-compiler/src/assert/tasks.hh
@@ -0,0 +1,59 @@
+/**
+ ** \file assert/tasks.hh
+ ** \brief Assert module related tasks.
+ */
+
+#pragma once
+
+#include <task/libtask.hh>
+
+// The tasks of the assert module
+namespace assert::tasks
+{
+ TASK_GROUP("Assert");
+
+ // Enable assert extensions.
+ BOOLEAN_TASK_DECLARE("assert",
+ "enable assert extensions",
+ enable_assert_extensions_p,
+ "");
+
+ // Parse the input file, allowing assertions.
+ TASK_DECLARE("assert-parse",
+ "parse a file, allowing assertions",
+ parse,
+ "assert parse");
+
+ // Bind the parsed file, allowing assertions.
+ TASK_DECLARE("assert-bindings-compute",
+ "bind the name uses to their definitions, allowing assertions",
+ bind,
+ "assert-parse");
+
+ // Check for type violation, allowing assertions.
+ TASK_DECLARE("assert-types-compute",
+ "check for type violations, allowing assertions",
+ types_compute,
+ "assert-bindings-compute");
+
+ // Perform a renaming, before desugaring assertions.
+ TASK_DECLARE("assert-rename",
+ "rename identifiers to unique names, allowing assertions",
+ rename,
+ "assert-bindings-compute");
+
+ // Remove syntactic sugar from the Ast.
+ TASK_DECLARE("assert-desugar",
+ "remove assertions constructs from the program",
+ desugar,
+ "assert-rename assert-types-compute");
+
+ // Remove syntactic sugar from the Ast without recomputing
+ // bindings nor types.
+ TASK_DECLARE("raw-assert-desugar",
+ "remove assertions constructs from the program "
+ "without recomputing bindings nor types",
+ raw_desugar,
+ "assert-rename assert-types-compute");
+
+} // namespace assert::tasks