From 71807c0777fec57d8c1814bb85b9e20ec68f4945 Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 22 Apr 2024 17:02:53 -0400 Subject: [PATCH] Clean up --- dust-lang/src/parser.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/dust-lang/src/parser.rs b/dust-lang/src/parser.rs index a2a3f5f..7d3559a 100644 --- a/dust-lang/src/parser.rs +++ b/dust-lang/src/parser.rs @@ -322,20 +322,18 @@ pub fn parser<'src>( just(Token::Control(Control::DoubleColon)), ); - let map_atom = choice(( + let map_index = choice(( map.clone(), structure_instance.clone(), identifier_expression.clone(), - )); - - let map_index = map_atom - .then_ignore(just(Token::Control(Control::Dot))) - .then(positioned_identifier.clone()) - .map_with(|(expression, identifier), state| { - Expression::MapIndex( - Box::new(MapIndex::new(expression, identifier)).with_position(state.span()), - ) - }); + )) + .then_ignore(just(Token::Control(Control::Dot))) + .then(positioned_identifier.clone()) + .map_with(|(expression, identifier), state| { + Expression::MapIndex( + Box::new(MapIndex::new(expression, identifier)).with_position(state.span()), + ) + }); let atom = choice(( map_index.clone(),