diff options
Diffstat (limited to 'src/hir')
-rw-r--r-- | src/hir/hir.cpp | 3 | ||||
-rw-r--r-- | src/hir/hir.hpp | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/hir/hir.cpp b/src/hir/hir.cpp index 4ff909aa..3b69e7c2 100644 --- a/src/hir/hir.cpp +++ b/src/hir/hir.cpp @@ -21,6 +21,9 @@ namespace HIR { (Float, os << e; ), + (BorrowOf, + os << "&" << e; + ), (String, os << "\"" << e << "\""; ) diff --git a/src/hir/hir.hpp b/src/hir/hir.hpp index d7650c7e..2eaf508d 100644 --- a/src/hir/hir.hpp +++ b/src/hir/hir.hpp @@ -46,6 +46,7 @@ TAGGED_UNION(Literal, Invalid, (List, ::std::vector<Literal>), // TODO: Have a variant for repetition lists (Integer, uint64_t), (Float, double), + (BorrowOf, ::HIR::SimplePath), // String = &'static str or &[u8; N] (String, ::std::string) ); @@ -369,6 +370,9 @@ public: return ::HIR::SimplePath(); } } + const char* get_name() const { + return name ? name : ""; + } ItemPath operator+(const ::std::string& name) const { return ItemPath(*this, name.c_str()); |