oxilean_parse/command/commandparser_parsing_4.rs
1//! # CommandParser - parsing Methods
2//!
3//! This module contains method implementations for `CommandParser`.
4//!
5//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
6
7use crate::{ParseError, TokenKind};
8
9use super::commandparser_type::CommandParser;
10
11impl CommandParser {
12 /// Parse a dotted path like `Foo.Bar.Baz` and return as separate segments.
13 pub(super) fn parse_dotted_path(&mut self) -> Result<Vec<String>, ParseError> {
14 let first = self.parse_ident()?;
15 let mut parts = vec![first];
16 while self.consume(&TokenKind::Dot) {
17 parts.push(self.parse_ident()?);
18 }
19 Ok(parts)
20 }
21}