aboutsummaryrefslogtreecommitdiff
path: root/crates/mbe/src
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-06-17 16:37:14 +0100
committerLukas Wirth <[email protected]>2021-06-17 16:37:14 +0100
commit95c8c65139c10e4de44367fead8dff88511e6d46 (patch)
tree4326d46ee282c133123f3a08aaee7d640f007050 /crates/mbe/src
parentc82a9141abe6b6cbf5b55710dc8a315a3839081b (diff)
Nest all the or-patterns!
Diffstat (limited to 'crates/mbe/src')
-rw-r--r--crates/mbe/src/expander/matcher.rs22
1 files changed, 3 insertions, 19 deletions
diff --git a/crates/mbe/src/expander/matcher.rs b/crates/mbe/src/expander/matcher.rs
index c2a9a38c9..b4f2fe9a4 100644
--- a/crates/mbe/src/expander/matcher.rs
+++ b/crates/mbe/src/expander/matcher.rs
@@ -804,33 +804,17 @@ impl<'a> TtIter<'a> {
804 }; 804 };
805 805
806 match (punct.char, second, third) { 806 match (punct.char, second, third) {
807 ('.', '.', Some('.')) 807 ('.', '.', Some('.' | '=')) | ('<', '<', Some('=')) | ('>', '>', Some('=')) => {
808 | ('.', '.', Some('='))
809 | ('<', '<', Some('='))
810 | ('>', '>', Some('=')) => {
811 let tt2 = self.next().unwrap().clone(); 808 let tt2 = self.next().unwrap().clone();
812 let tt3 = self.next().unwrap().clone(); 809 let tt3 = self.next().unwrap().clone();
813 Ok(tt::Subtree { delimiter: None, token_trees: vec![tt, tt2, tt3] }.into()) 810 Ok(tt::Subtree { delimiter: None, token_trees: vec![tt, tt2, tt3] }.into())
814 } 811 }
815 ('-', '=', _) 812 ('-' | '!' | '*' | '/' | '&' | '%' | '^' | '+' | '<' | '=' | '>' | '|', '=', _)
816 | ('-', '>', _) 813 | ('-' | '=' | '>', '>', _)
817 | (':', ':', _) 814 | (':', ':', _)
818 | ('!', '=', _)
819 | ('.', '.', _) 815 | ('.', '.', _)
820 | ('*', '=', _)
821 | ('/', '=', _)
822 | ('&', '&', _) 816 | ('&', '&', _)
823 | ('&', '=', _)
824 | ('%', '=', _)
825 | ('^', '=', _)
826 | ('+', '=', _)
827 | ('<', '<', _) 817 | ('<', '<', _)
828 | ('<', '=', _)
829 | ('=', '=', _)
830 | ('=', '>', _)
831 | ('>', '=', _)
832 | ('>', '>', _)
833 | ('|', '=', _)
834 | ('|', '|', _) => { 818 | ('|', '|', _) => {
835 let tt2 = self.next().unwrap().clone(); 819 let tt2 = self.next().unwrap().clone();
836 Ok(tt::Subtree { delimiter: None, token_trees: vec![tt, tt2] }.into()) 820 Ok(tt::Subtree { delimiter: None, token_trees: vec![tt, tt2] }.into())