From 579875e0eae2866a246fdadf598b31ea50aa1da4 Mon Sep 17 00:00:00 2001 From: Greg Brown Date: Mon, 9 Nov 2020 14:44:03 +0000 Subject: Rename Seq to Cat --- src/nibble/mod.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/nibble/mod.rs') diff --git a/src/nibble/mod.rs b/src/nibble/mod.rs index 9c41344..6e1ed17 100644 --- a/src/nibble/mod.rs +++ b/src/nibble/mod.rs @@ -313,11 +313,11 @@ impl From for TermError { } #[derive(Clone, Debug, Eq, PartialEq)] -pub struct Seq { +pub struct Cat { terms: Vec, } -impl Parse for Seq { +impl Parse for Cat { type Err = SeqError; fn parse>(mut iter: I) -> Result> { @@ -335,11 +335,11 @@ impl Parse for Seq { } } -impl FromStr for Seq { - type Err = ParseError<::Err>; +impl FromStr for Cat { + type Err = ParseError<::Err>; fn from_str(s: &str) -> Result { - Seq::parse(s.chars().peekable()) + Cat::parse(s.chars().peekable()) } } @@ -354,7 +354,7 @@ impl From for SeqError { #[derive(Clone, Debug, Eq, PartialEq)] pub struct Alt { - seqs: Vec, + seqs: Vec, } impl Parse for Alt { @@ -362,11 +362,11 @@ impl Parse for Alt { fn parse>(mut iter: I) -> Result> { let mut seqs = Vec::new(); - seqs.push(Seq::parse(&mut iter).map_err(ParseError::map)?); + seqs.push(Cat::parse(&mut iter).map_err(ParseError::map)?); while iter.consume_if_next(&'|') { iter.advance_while(|c| c.is_whitespace()); - seqs.push(Seq::parse(&mut iter).map_err(ParseError::map)?); + seqs.push(Cat::parse(&mut iter).map_err(ParseError::map)?); } Ok(Self { seqs }) @@ -427,7 +427,7 @@ mod tests { use super::Alt; use super::Expression; use super::Fix; - use super::Seq; + use super::Cat; use super::Term; use super::{ parse::{Parse, ParseError}, @@ -641,7 +641,7 @@ mod tests { fn parse_fix_basic() { let expr = Expression { alt: Alt { - seqs: vec![Seq { + seqs: vec![Cat { terms: vec![Term::Epsilon], }], }, @@ -707,7 +707,7 @@ mod tests { }, expr: Expression { alt: Alt { - seqs: vec![Seq { + seqs: vec![Cat { terms: vec![Term::Epsilon], }], }, -- cgit v1.2.3