summaryrefslogtreecommitdiff
path: root/src/atom
diff options
context:
space:
mode:
authorJohn Turner <jturner.usa@gmail.com>2025-11-20 23:27:41 +0000
committerJohn Turner <jturner.usa@gmail.com>2025-11-20 23:27:41 +0000
commit699d4bafd0fb1e2e7bf12e62a3c9673bc4bfa578 (patch)
tree08675cab55297243c435345efbb45ecb6cea0bab /src/atom
parentff7d9b312f77880c237aad4dc07a9d340d750be6 (diff)
downloadgentoo-utils-699d4bafd0fb1e2e7bf12e62a3c9673bc4bfa578.tar.gz
update mon and use new ascii parsers
Diffstat (limited to 'src/atom')
-rw-r--r--src/atom/parsers.rs36
1 files changed, 24 insertions, 12 deletions
diff --git a/src/atom/parsers.rs b/src/atom/parsers.rs
index 7733f12..301409c 100644
--- a/src/atom/parsers.rs
+++ b/src/atom/parsers.rs
@@ -1,6 +1,9 @@
use core::option::Option::None;
-use mon::{Parser, ParserIter, alphanumeric, eof, r#if, input::InputIter, numeric1, one_of, tag};
+use mon::{
+ Parser, ParserIter, ascii_alphanumeric, ascii_numeric1, eof, r#if, input::InputIter, one_of,
+ tag,
+};
use crate::{
Parseable,
@@ -40,7 +43,7 @@ impl<'a> Parseable<'a, &'a str> for VersionNumber {
type Parser = impl Parser<&'a str, Output = Self>;
fn parser() -> Self::Parser {
- numeric1().map(|output: &str| VersionNumber(output.to_string()))
+ ascii_numeric1().map(|output: &str| VersionNumber(output.to_string()))
}
}
@@ -115,8 +118,11 @@ impl<'a> Parseable<'a, &'a str> for Category {
type Parser = impl Parser<&'a str, Output = Self>;
fn parser() -> Self::Parser {
- let start = alphanumeric().or(one_of("_".chars()));
- let rest = alphanumeric().or(one_of("+_.-".chars())).repeated().many();
+ let start = ascii_alphanumeric().or(one_of("_".chars()));
+ let rest = ascii_alphanumeric()
+ .or(one_of("+_.-".chars()))
+ .repeated()
+ .many();
start
.and(rest)
@@ -129,19 +135,19 @@ impl<'a> Parseable<'a, &'a str> for Name {
type Parser = impl Parser<&'a str, Output = Self>;
fn parser() -> Self::Parser {
- let start = || alphanumeric().or(one_of("_".chars()));
+ let start = || ascii_alphanumeric().or(one_of("_".chars()));
- let rest = alphanumeric()
+ let rest = ascii_alphanumeric()
.or(one_of("_+".chars()))
.or(one_of("-".chars()).and_not(
Version::parser()
.preceded_by(tag("-"))
- .followed_by(alphanumeric().or(one_of("_+-".chars())).not()),
+ .followed_by(ascii_alphanumeric().or(one_of("_+-".chars())).not()),
))
.repeated()
.many();
- let verify = alphanumeric()
+ let verify = ascii_alphanumeric()
.or(one_of("_+".chars()))
.or(one_of("-".chars())
.and_not(Version::parser().preceded_by(tag("-")).followed_by(eof())))
@@ -172,8 +178,11 @@ impl<'a> Parseable<'a, &'a str> for SlotName {
type Parser = impl Parser<&'a str, Output = Self>;
fn parser() -> Self::Parser {
- let start = alphanumeric().or(one_of("_".chars()));
- let rest = alphanumeric().or(one_of("+_.-".chars())).repeated().many();
+ let start = ascii_alphanumeric().or(one_of("_".chars()));
+ let rest = ascii_alphanumeric()
+ .or(one_of("+_.-".chars()))
+ .repeated()
+ .many();
start
.and(rest)
@@ -215,8 +224,11 @@ impl<'a> Parseable<'a, &'a str> for Repo {
type Parser = impl Parser<&'a str, Output = Self>;
fn parser() -> Self::Parser {
- let start = alphanumeric().or(one_of("_".chars()));
- let rest = alphanumeric().or(one_of("+_-".chars())).repeated().many();
+ let start = ascii_alphanumeric().or(one_of("_".chars()));
+ let rest = ascii_alphanumeric()
+ .or(one_of("+_-".chars()))
+ .repeated()
+ .many();
start
.and(rest)