diff options
author | John Hodge <tpg@mutabah.net> | 2016-03-20 12:29:44 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-03-20 12:29:44 +0800 |
commit | b79e71e5f11e14516f13ea2f8437d5deaa10e653 (patch) | |
tree | 3097c0251c83e32e4e673a840f5708110a8adc4c /src/ast/ast.hpp | |
parent | 0ee80748a3dcb97f308e9b0b71c22d28868d12cf (diff) | |
download | mrust-b79e71e5f11e14516f13ea2f8437d5deaa10e653.tar.gz |
Tagged Union - Rework to remove indirection
Diffstat (limited to 'src/ast/ast.hpp')
-rw-r--r-- | src/ast/ast.hpp | 59 |
1 files changed, 22 insertions, 37 deletions
diff --git a/src/ast/ast.hpp b/src/ast/ast.hpp index 886766ff..fd72552a 100644 --- a/src/ast/ast.hpp +++ b/src/ast/ast.hpp @@ -227,15 +227,15 @@ public: TAGGED_UNION_EX(EnumVariantData, (: public Serialisable), Value,
(
- (Value, (
+ (Value, struct {
::AST::Expr m_value;
- )),
- (Tuple, (
+ }),
+ (Tuple, struct {
::std::vector<TypeRef> m_sub_types;
- )),
- (Struct, (
+ }),
+ (Struct, struct {
::std::vector<StructItem> m_fields;
- ))
+ })
),
(), (),
(
@@ -319,12 +319,12 @@ public: TAGGED_UNION_EX(StructData, (: public Serialisable), Struct,
(
- (Tuple, (
+ (Tuple, struct {
::std::vector<TupleItem> ents;
- )),
- (Struct, (
+ }),
+ (Struct, struct {
::std::vector<StructItem> ents;
- ))
+ })
),
(),(),
(
@@ -593,34 +593,19 @@ private: TAGGED_UNION_EX(Item, (: public Serialisable), None,
(
- (None, (
- )),
- (Module, (
- Module e;
- )),
- (Crate, (
+ (None, struct {} ),
+ (Module, Module),
+ (Crate, struct {
::std::string name;
- )),
-
- (Type, (
- TypeAlias e;
- )),
- (Struct, (
- Struct e;
- )),
- (Enum, (
- Enum e;
- )),
- (Trait, (
- Trait e;
- )),
-
- (Function, (
- Function e;
- )),
- (Static, (
- Static e;
- ))
+ }),
+
+ (Type, TypeAlias),
+ (Struct, Struct),
+ (Enum, Enum),
+ (Trait, Trait),
+
+ (Function, Function),
+ (Static, Static)
),
(, attrs(mv$(x.attrs))), (attrs = mv$(x.attrs);),
|