summaryrefslogtreecommitdiff
path: root/src/ast
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast')
-rw-r--r--src/ast/ast.hpp5
-rw-r--r--src/ast/expr.hpp5
-rw-r--r--src/ast/path.hpp5
3 files changed, 11 insertions, 4 deletions
diff --git a/src/ast/ast.hpp b/src/ast/ast.hpp
index 5cf1dee2..1cfae202 100644
--- a/src/ast/ast.hpp
+++ b/src/ast/ast.hpp
@@ -170,6 +170,7 @@ public:
const ::std::string& name() const { return m_name; }
const ::std::string& string() const { return m_str_val; }
bool has_sub_items() const { return m_sub_items.m_items.size() > 0; }
+ const MetaItems& items() const { return m_sub_items; }
MetaItems& items() { return m_sub_items; }
friend ::std::ostream& operator<<(::std::ostream& os, const MetaItem& x) {
@@ -454,9 +455,11 @@ public:
m_fields( move(fields) )
{}
- const TypeParams& params() const { return m_params; }
+ const MetaItems& attrs() const { return m_attrs; }
+ const TypeParams& params() const { return m_params; }
const ::std::vector<StructItem>& fields() const { return m_fields; }
+ MetaItems& attrs() { return m_attrs; }
TypeParams& params() { return m_params; }
::std::vector<StructItem>& fields() { return m_fields; }
diff --git a/src/ast/expr.hpp b/src/ast/expr.hpp
index 663beae0..45f6e3c9 100644
--- a/src/ast/expr.hpp
+++ b/src/ast/expr.hpp
@@ -208,7 +208,7 @@ struct ExprNode_CallMethod:
::std::vector<unique_ptr<ExprNode>> m_args;
ExprNode_CallMethod() {}
- ExprNode_CallMethod(unique_ptr<ExprNode>&& obj, PathNode&& method, ::std::vector<unique_ptr<ExprNode>>&& args):
+ ExprNode_CallMethod(unique_ptr<ExprNode> obj, PathNode method, ::std::vector<unique_ptr<ExprNode>> args):
m_val( move(obj) ),
m_method( move(method) ),
m_args( move(args) )
@@ -479,7 +479,7 @@ struct ExprNode_Field:
::std::string m_name;
ExprNode_Field() {}
- ExprNode_Field(::std::unique_ptr<ExprNode>&& obj, ::std::string&& name):
+ ExprNode_Field(::std::unique_ptr<ExprNode>&& obj, ::std::string name):
m_obj( ::std::move(obj) ),
m_name( ::std::move(name) )
{
@@ -723,6 +723,7 @@ public:
SERIALISABLE_PROTOTYPES();
};
+typedef ::std::unique_ptr<AST::ExprNode> ExprNodeP;
}
#endif
diff --git a/src/ast/path.hpp b/src/ast/path.hpp
index a2ca316b..390271fe 100644
--- a/src/ast/path.hpp
+++ b/src/ast/path.hpp
@@ -180,7 +180,10 @@ public:
struct TagLocal {};
Path(TagLocal, ::std::string name):
m_class(LOCAL),
- m_nodes({PathNode(name, {})})
+ m_nodes({PathNode( ::std::move(name), {} )})
+ {}
+ Path(::std::string name):
+ Path(TagLocal(), ::std::move(name))
{}
struct TagSuper {};
Path(TagSuper):