From a502c21a7f52ded9b24a34313d5700f3bb8d24e8 Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Thu, 28 Jul 2022 00:48:31 +0100 Subject: [PATCH] parser: ident method docs for clarity --- trunk_parser/src/parser/ident.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/trunk_parser/src/parser/ident.rs b/trunk_parser/src/parser/ident.rs index 0f3074d..33951d1 100644 --- a/trunk_parser/src/parser/ident.rs +++ b/trunk_parser/src/parser/ident.rs @@ -3,14 +3,17 @@ use trunk_lexer::TokenKind; use super::{ParseResult, ParseError}; impl Parser { + /// Expect an unqualified identifier such as Foo or Bar. pub(crate) fn ident(&mut self) -> ParseResult { Ok(expect!(self, TokenKind::Identifier(i), i, "expected identifier")) } + /// Expect an unqualified or qualified identifier such as Foo, Bar or Foo\Bar. pub(crate) fn name(&mut self) -> ParseResult { Ok(expect!(self, TokenKind::Identifier(i) | TokenKind::QualifiedIdentifier(i), i, "expected identifier")) } + /// Expect an unqualified, qualified or fully qualified identifier such as Foo, Foo\Bar or \Foo\Bar. pub(crate) fn full_name(&mut self) -> ParseResult { Ok(expect!(self, TokenKind::Identifier(i) | TokenKind::QualifiedIdentifier(i) | TokenKind::FullyQualifiedIdentifier(i), i, "expected identifier")) }