From 5a787f8e5ae51df435f6849c93cc0cbd811afed6 Mon Sep 17 00:00:00 2001 From: CohenArthur Date: Fri, 25 Feb 2022 23:58:50 +0100 Subject: [PATCH] construct: Use type_id() in parser --- src/parser/constructs.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/parser/constructs.rs b/src/parser/constructs.rs index bf77ccfb..277ef47e 100644 --- a/src/parser/constructs.rs +++ b/src/parser/constructs.rs @@ -707,16 +707,16 @@ fn typed_args(input: ParseInput) -> ParseResult> { } // FIXME: This should not return a String -fn multi_type(input: ParseInput) -> ParseResult { +fn multi_type(input: ParseInput) -> ParseResult { // FIXME: Remove with #342 - fn whitespace_plus_id(input: ParseInput) -> ParseResult { - delimited(nom_next, Token::identifier, nom_next)(input) + fn whitespace_plus_type_id(input: ParseInput) -> ParseResult { + delimited(nom_next, type_id, nom_next)(input) } // FIXME: We want to allow generic types here later on - let (input, first_type) = whitespace_plus_id(input)?; + let (input, first_type) = whitespace_plus_type_id(input)?; - let (input, mut types) = many0(preceded(Token::pipe, whitespace_plus_id))(input)?; + let (input, mut types) = many0(preceded(Token::pipe, whitespace_plus_type_id))(input)?; // FIXME: Remove clone once we have a proper MultiType struct to return types.insert(0, first_type.clone()); @@ -733,7 +733,7 @@ fn typed_arg(input: ParseInput) -> ParseResult { let input = next(input); let (input, end_loc) = position(input)?; - let mut dec_arg = DecArg::new(id, TypeId::new(Symbol::from(types))); + let mut dec_arg = DecArg::new(id, types); dec_arg.set_location(SpanTuple::new(input.extra, start_loc, end_loc.into())); Ok((input, dec_arg))