summaryrefslogtreecommitdiff
path: root/src/ast
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast')
-rw-r--r--src/ast/macro.hpp7
-rw-r--r--src/ast/path.hpp4
2 files changed, 10 insertions, 1 deletions
diff --git a/src/ast/macro.hpp b/src/ast/macro.hpp
index 4696c732..4804f52b 100644
--- a/src/ast/macro.hpp
+++ b/src/ast/macro.hpp
@@ -3,6 +3,7 @@
#define _AST_MACRO_HPP_
#include "../parse/tokentree.hpp"
+#include <span.hpp>
#include "attrs.hpp"
namespace AST {
@@ -10,6 +11,8 @@ namespace AST {
class MacroInvocation:
public Serialisable
{
+ Span m_span;
+
::AST::MetaItems m_attrs;
::std::string m_macro_name;
::std::string m_ident;
@@ -19,7 +22,8 @@ public:
{
}
- MacroInvocation(MetaItems attrs, ::std::string macro, ::std::string ident, TokenTree input):
+ MacroInvocation(Span span, MetaItems attrs, ::std::string macro, ::std::string ident, TokenTree input):
+ m_span( mv$(span) ),
m_attrs( mv$(attrs) ),
m_macro_name( mv$(macro) ),
m_ident( mv$(ident) ),
@@ -39,6 +43,7 @@ public:
m_input = TokenTree();
}
+ const Span& span() const { return m_span; }
const ::std::string& name() const { return m_macro_name; }
const ::std::string& input_ident() const { return m_ident; }
diff --git a/src/ast/path.hpp b/src/ast/path.hpp
index 1260ece3..4fc08bb1 100644
--- a/src/ast/path.hpp
+++ b/src/ast/path.hpp
@@ -130,6 +130,7 @@ public:
private:
/// The crate defining the root of this path (used for path resolution)
::std::string m_crate;
+ Span m_span;
public:
Class m_class;
@@ -197,6 +198,9 @@ public:
}
+ const Span& span() const {
+ return m_span;
+ }
Class::Tag class_tag() const {
return m_class.tag();
}