tuple struct

This commit is contained in:
greg 2020-03-13 22:52:20 -07:00
parent ad0434007b
commit 67b98c47fc

View File

@ -265,7 +265,14 @@ fn simple_pattern(text: &str) -> ParseResult<Pattern> {
}
fn tuple_struct_pattern(text: &str) -> ParseResult<Pattern> {
unimplemented!()
let p = tuple((
qualified_name,
delimited(ws(tag("(")),
separated_nonempty_list(ws(tag(",")), ws(pattern)),
ws(tag(")"))
)
));
map(p, |(name, patterns)| Pattern::TupleStruct(name, patterns))(text)
}
fn record_pattern(text: &str) -> ParseResult<Pattern> {