Skip to content

Commit

Permalink
made ABNF nonterminals less... all-consuming
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlyle-Foster committed Jan 4, 2025
1 parent 2326fba commit 64bea7e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/augmented.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::term::Term;

use nom::{
bytes::complete::{tag, take, take_till},
character::complete,
character::complete::{self, satisfy},
combinator::{complete, not},
error::VerboseError,
sequence::{preceded, terminated},
Expand All @@ -23,10 +23,7 @@ impl Format for ABNF {
}

fn nonterminal(input: &str) -> IResult<&str, Term, VerboseError<&str>> {
not(complete::char('\''))(input)?;
not(complete::char('\"'))(input)?;
not(complete::char('|'))(input)?;
not(complete::char(';'))(input)?;
satisfy(|c: char| c.is_alphanumeric() || c == '_')(input)?;
let (input, nt) = complete(terminated(
take_till(char::is_whitespace),
complete::multispace0,
Expand Down

0 comments on commit 64bea7e

Please sign in to comment.