From b3505b6d32fbcdd9d507d4cec41a4fb7d6267e68 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Wed, 23 Feb 2022 15:12:58 -0800 Subject: [PATCH] [parser] Minor documentation fixes. --- parser/src/parser/expression.rs | 8 ++++---- parser/src/parser/file.rs | 9 ++++----- 2 files changed, 8 insertions(+), 9 deletions(-) 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)?;