diff --git a/parser/src/parser/expression.rs b/parser/src/parser/expression.rs index c7d977a490..7fdb919966 100644 --- a/parser/src/parser/expression.rs +++ b/parser/src/parser/expression.rs @@ -386,10 +386,10 @@ impl ParserContext<'_> { } /// - /// Returns a [`SpreadOrExpression`] AST node if the next tokens represent an + /// Returns a [`SpreadOrExpression`] AST node if the next tokens represent a /// spread or expression. /// - /// This method should only be called in the context of an array access expression. + /// This method should only be called in the context of an array construction expression. /// pub fn parse_spread_or_expression(&mut self) -> Result { Ok(if self.eat(Token::DotDotDot).is_some() { @@ -416,8 +416,8 @@ impl ParserContext<'_> { } /// - /// Returns an [`Expression`] AST node if the next tokens represent an - /// tuple initialization expression. + /// Returns an [`Expression`] AST node if the next tokens represent a + /// tuple initialization expression or an affine group literal. /// pub fn parse_tuple_expression(&mut self, span: &Span) -> Result { if let Some((left, right, span)) = self.eat_group_partial().transpose()? { diff --git a/parser/src/parser/file.rs b/parser/src/parser/file.rs index 59cc7752db..295ec3b650 100644 --- a/parser/src/parser/file.rs +++ b/parser/src/parser/file.rs @@ -162,7 +162,7 @@ impl ParserContext<'_> { /// Returns an [`ImportTree`] AST node if the next tokens represent a valid package import /// with accesses. - // Public soely foro writing import parsing tests. + // Public solely for writing import parsing tests. pub fn parse_import_tree(&mut self) -> Result { // Parse the first part of the path. let first_name = self.parse_package_name()?; @@ -216,7 +216,7 @@ impl ParserContext<'_> { } /// Returns a [`CircuitMember`] AST node if the next tokens represent a circuit member variable - /// or circuit member function. + /// or circuit member function or circuit member constant. pub fn parse_circuit_declaration(&mut self) -> Result> { let mut members = Vec::new(); @@ -462,7 +462,7 @@ impl ParserContext<'_> { /// /// Returns an [`(String, DefinitionStatement)`] AST node if the next tokens represent a global - /// const definition statement and assignment. + /// constant declaration. /// pub fn parse_global_const_declaration(&mut self) -> Result<(Vec, DefinitionStatement)> { let statement = self.parse_definition_statement()?; @@ -476,8 +476,7 @@ impl ParserContext<'_> { } /// - /// Returns an [`(String, Alias)`] AST node if the next tokens represent a global - /// const definition statement and assignment. + /// Returns a [`(String, Alias)`] AST node if the next tokens represent a type alias declaration. /// pub fn parse_type_alias(&mut self) -> Result<(Identifier, Alias)> { let start = self.expect(Token::Type)?;