diff options
author | John Hodge <tpg@mutabah.net> | 2016-02-25 13:52:39 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-02-25 13:52:39 +0800 |
commit | beaad85791e078f9128fbab3f5758e001340a6a8 (patch) | |
tree | 9b0cbe4843faad00799f5fda8d6923ba21bb3421 /src/ast/pattern.hpp | |
parent | a735e91e2f1ff8c688e9f8403860f8ef5bd74606 (diff) | |
download | mrust-beaad85791e078f9128fbab3f5758e001340a6a8.tar.gz |
Heaps more parse fixes against the rustc tests
Diffstat (limited to 'src/ast/pattern.hpp')
-rw-r--r-- | src/ast/pattern.hpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ast/pattern.hpp b/src/ast/pattern.hpp index 6cd78e91..ce4844f9 100644 --- a/src/ast/pattern.hpp +++ b/src/ast/pattern.hpp @@ -28,7 +28,8 @@ public: (Value, (unique_ptr<ExprNode> start; unique_ptr<ExprNode> end;) ), (Tuple, (::std::vector<Pattern> sub_patterns;) ), (StructTuple, (Path path; ::std::vector<Pattern> sub_patterns;) ), - (Struct, (Path path; ::std::vector< ::std::pair< ::std::string,Pattern> > sub_patterns;) ) + (Struct, (Path path; ::std::vector< ::std::pair< ::std::string,Pattern> > sub_patterns;) ), + (Slice, (::std::vector<Pattern> leading; ::std::string extra_bind; ::std::vector<Pattern> trailing;) ) ); private: ::std::string m_binding; @@ -93,6 +94,11 @@ public: Pattern(TagStruct, Path path, ::std::vector< ::std::pair< ::std::string,Pattern> > sub_patterns): m_data( Data::make_Struct( { ::std::move(path), ::std::move(sub_patterns) } ) ) {} + + struct TagSlice {}; + Pattern(TagSlice): + m_data( Data::make_Slice( {} ) ) + {} // Mutators void set_bind(::std::string name, bool is_ref, bool is_mut) { |