summaryrefslogtreecommitdiff
path: root/src/hir/hir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/hir/hir.cpp')
-rw-r--r--src/hir/hir.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/hir/hir.cpp b/src/hir/hir.cpp
new file mode 100644
index 00000000..5b9401f5
--- /dev/null
+++ b/src/hir/hir.cpp
@@ -0,0 +1,30 @@
+/*
+ */
+#include "hir.hpp"
+
+namespace HIR {
+ ::std::ostream& operator<<(::std::ostream& os, const ::HIR::Literal& v)
+ {
+ TU_MATCH(::HIR::Literal, (v), (e),
+ (Invalid,
+ os << "!";
+ ),
+ (List,
+ os << "[";
+ for(const auto& val : e)
+ os << " " << val << ",";
+ os << " ]";
+ ),
+ (Integer,
+ os << e;
+ ),
+ (Float,
+ os << e;
+ ),
+ (String,
+ os << "\"" << e << "\"";
+ )
+ )
+ return os;
+ }
+}