summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/expand/mod.cpp9
-rw-r--r--src/include/span.hpp6
-rw-r--r--src/main.cpp1
-rw-r--r--src/span.cpp9
-rw-r--r--src/types.hpp5
5 files changed, 20 insertions, 10 deletions
diff --git a/src/expand/mod.cpp b/src/expand/mod.cpp
index 928151a6..2f936f1f 100644
--- a/src/expand/mod.cpp
+++ b/src/expand/mod.cpp
@@ -179,7 +179,7 @@ void Expand_Type(bool is_early, ::AST::Crate& crate, LList<const AST::Module*> m
(Primitive,
),
(Function,
- TODO(ty.span(), "Expand function type");
+ TODO(ty.span(), "Expand function type " << ty);
),
(Tuple,
for(auto& st : e.inner_types)
@@ -454,7 +454,8 @@ void Expand_Mod(bool is_early, ::AST::Crate& crate, LList<const AST::Module*> mo
DEBUG("- " << i.name << " :: " << i.data.attrs);
::AST::Path path = modpath + i.name;
- Expand_Attrs(i.data.attrs, stage_pre(is_early), crate, path, mod, i.data);
+ auto attrs = mv$(i.data.attrs);
+ Expand_Attrs(attrs, stage_pre(is_early), crate, path, mod, i.data);
TU_MATCH(::AST::Item, (i.data), (e),
(None,
@@ -494,7 +495,9 @@ void Expand_Mod(bool is_early, ::AST::Crate& crate, LList<const AST::Module*> mo
)
)
- Expand_Attrs(i.data.attrs, stage_post(is_early), crate, path, mod, i.data);
+ Expand_Attrs(attrs, stage_post(is_early), crate, path, mod, i.data);
+ if( i.data.attrs.m_items.size() == 0 )
+ i.data.attrs = mv$(attrs);
}
DEBUG("Impls");
diff --git a/src/include/span.hpp b/src/include/span.hpp
index 0a1033e4..e5dd8ccc 100644
--- a/src/include/span.hpp
+++ b/src/include/span.hpp
@@ -44,11 +44,7 @@ struct Span
{}
Span(const Span& x);
Span(const Position& position);
- Span():
- filename("")/*,
- start_line(0), start_ofs(0),
- end_line(0), end_ofs(0) // */
- {}
+ Span();
void bug(::std::function<void(::std::ostream&)> msg) const;
void error(ErrorType tag, ::std::function<void(::std::ostream&)> msg) const;
diff --git a/src/main.cpp b/src/main.cpp
index 28477657..a2a6f26f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -52,6 +52,7 @@ struct ProgramParams
template <typename Rv, typename Fcn>
Rv CompilePhase(const char *name, Fcn f) {
+ ::std::cout << name << ": V V V" << ::std::endl;
g_cur_phase = name;
auto rv = f();
g_cur_phase = "";
diff --git a/src/span.cpp b/src/span.cpp
index 5216976d..763bb748 100644
--- a/src/span.cpp
+++ b/src/span.cpp
@@ -9,6 +9,7 @@
#include <iostream>
#include <span.hpp>
#include <parse/lex.hpp>
+#include <common.hpp>
Span::Span(const Span& x):
filename(x.filename),
@@ -26,6 +27,14 @@ Span::Span(const Position& pos):
end_ofs(pos.ofs)
{
}
+Span::Span():
+ filename("")/*,
+ start_line(0), start_ofs(0),
+ end_line(0), end_ofs(0) // */
+{
+ //DEBUG("Empty span");
+ //filename = FMT(":" << __builtin_return_address(0));
+}
void Span::bug(::std::function<void(::std::ostream&)> msg) const
{
diff --git a/src/types.hpp b/src/types.hpp
index 2b9f4a86..6bdfb9a7 100644
--- a/src/types.hpp
+++ b/src/types.hpp
@@ -108,9 +108,10 @@ public:
TypeData m_data;
TypeRef(TypeRef&& other) noexcept:
- //m_span( mv$(other.m_span) ),
m_data( mv$(other.m_data) )
- {}
+ {
+ m_span = mv$(other.m_span);
+ }
TypeRef(const TypeRef& other);
TypeRef& operator=(TypeRef&& other) {