summaryrefslogtreecommitdiff
path: root/src/ast
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-07-29 12:47:44 +0100
committerJohn Hodge <tpg@mutabah.net>2018-07-29 12:47:44 +0100
commitc971a6fa8375598ecf9c99ee6b086e8cf957f568 (patch)
treef7f431cbac52e6b25d311bedd503b6584c51bd37 /src/ast
parent5d4bf9e96d795623f1b32b2f1f2e57c4f74419fe (diff)
downloadmrust-c971a6fa8375598ecf9c99ee6b086e8cf957f568.tar.gz
All - Initial work on supporting 1.29 as a target version
Diffstat (limited to 'src/ast')
-rw-r--r--src/ast/ast.hpp5
-rw-r--r--src/ast/attrs.hpp1
-rw-r--r--src/ast/path.hpp4
3 files changed, 10 insertions, 0 deletions
diff --git a/src/ast/ast.hpp b/src/ast/ast.hpp
index 0a43cc71..19f0c66b 100644
--- a/src/ast/ast.hpp
+++ b/src/ast/ast.hpp
@@ -8,6 +8,9 @@
#ifndef AST_HPP_INCLUDED
#define AST_HPP_INCLUDED
+#define TARGETVER_1_19 true
+#define TARGETVER_1_29 true
+
#include <string>
#include <vector>
#include <stdexcept>
@@ -44,6 +47,8 @@ enum eItemType
{
ITEM_TRAIT,
ITEM_STRUCT,
+ ITEM_ENUM,
+ ITEM_UNION,
ITEM_FN,
ITEM_STATIC,
};
diff --git a/src/ast/attrs.hpp b/src/ast/attrs.hpp
index 1926e96a..860e75ee 100644
--- a/src/ast/attrs.hpp
+++ b/src/ast/attrs.hpp
@@ -77,6 +77,7 @@ class Attribute
::std::string m_name;
AttributeData m_data;
mutable bool m_is_used;
+ // TODO: Parse as a TT then expand?
public:
Attribute(Span sp, ::std::string name):
m_span(::std::move(sp)),
diff --git a/src/ast/path.hpp b/src/ast/path.hpp
index c2d13d73..2693a070 100644
--- a/src/ast/path.hpp
+++ b/src/ast/path.hpp
@@ -271,6 +271,10 @@ public:
return Path(*this) += x;
}
Path& operator+=(const Path& x);
+ Path& operator+=(PathNode pn) {
+ this->nodes().push_back( mv$(pn) );
+ return *this;
+ }
void append(PathNode node) {
assert( !m_class.is_Invalid() );