From 82cf0185c36faf81dbdf7e64843bdfc5b4df1b21 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 31 Jan 2019 10:33:11 +0300 Subject: add repeats to ast --- crates/ra_hir/src/macros/mbe.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'crates/ra_hir/src/macros') diff --git a/crates/ra_hir/src/macros/mbe.rs b/crates/ra_hir/src/macros/mbe.rs index 2d7965b62..1408ed511 100644 --- a/crates/ra_hir/src/macros/mbe.rs +++ b/crates/ra_hir/src/macros/mbe.rs @@ -14,6 +14,7 @@ struct Rule { enum TokenTree { Leaf(Leaf), Subtree(Subtree), + Repeat(Repeat), } enum Leaf { @@ -35,6 +36,17 @@ enum Delimiter { None, } +struct Repeat { + subtree: Subtree, + kind: RepeatKind, +} + +enum RepeatKind { + ZeroOrMore, + OneOrMore, + ZeroOrOne, +} + struct Literal { text: SmolStr, } -- cgit v1.2.3