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/assert/desugar-visitor.hxx | |
Diffstat (limited to 'tiger-compiler/src/assert/desugar-visitor.hxx')
| -rw-r--r-- | tiger-compiler/src/assert/desugar-visitor.hxx | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tiger-compiler/src/assert/desugar-visitor.hxx b/tiger-compiler/src/assert/desugar-visitor.hxx new file mode 100644 index 0000000..9e839c1 --- /dev/null +++ b/tiger-compiler/src/assert/desugar-visitor.hxx @@ -0,0 +1,39 @@ +/** + ** \file assert/desugar-visitor.hxx + ** \brief Implementation of assert::DesugarVisitor (inlined methods). + */ + +#pragma once + +#include <assert/desugar-visitor.hh> + +#include <sstream> +#include <string> + +#include <ast/pretty-printer.hh> + +namespace assert +{ + + inline std::string + DesugarVisitor::get_formatted_assert_cond(const ast::AssertExp& e) + { + std::stringstream stream{}; + ast::PrettyPrinter pretty_printer(stream); + + pretty_printer(e.cond_get()); + + return stream.str(); + } + + inline std::string + DesugarVisitor::get_formatted_location(const ast::Location& loc) + { + std::stringstream stream{}; + + stream << loc; + + return stream.str(); + } + +} |
