diff options
author | John Hodge <tpg@mutabah.net> | 2016-05-26 11:04:04 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-05-26 11:04:04 +0800 |
commit | 81d89041e8500d9f6dfab9c55aee76967a5233f1 (patch) | |
tree | 26452d9973421d917921548e1b2b63950a6ca52b /src/hir/hir.cpp | |
parent | dd7680bc0d53f02e4b96b2b3896ebea16742c9bb (diff) | |
download | mrust-81d89041e8500d9f6dfab9c55aee76967a5233f1.tar.gz |
HIR Cosnt Eval - Initial work, hits TODOs
Diffstat (limited to 'src/hir/hir.cpp')
-rw-r--r-- | src/hir/hir.cpp | 30 |
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; + } +} |