summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/sexpr.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/sexpr.rs b/tests/sexpr.rs
index 77ef3a0..a3783f0 100644
--- a/tests/sexpr.rs
+++ b/tests/sexpr.rs
@@ -1,8 +1,8 @@
#![allow(dead_code)]
use mon::{
- Parser, ParserIter, alpha1, alphanumeric, alphanumeric1, input::InputIter, numeric1, tag,
- whitespace, whitespace1,
+ Parser, ParserIter, ascii_alpha1, ascii_alphanumeric, ascii_alphanumeric1, ascii_numeric1,
+ ascii_whitespace1, input::InputIter, tag,
};
#[derive(Debug)]
@@ -14,20 +14,20 @@ enum Sexpr {
}
fn atom<'a>() -> impl Parser<&'a str, Output = Sexpr> {
- alpha1()
- .and(alphanumeric().repeated().many())
+ ascii_alpha1()
+ .and(ascii_alphanumeric().repeated().many())
.recognize()
.map(|output: &str| Sexpr::Atom(output.to_string()))
}
fn string<'a>() -> impl Parser<&'a str, Output = Sexpr> {
- alphanumeric1()
+ ascii_alphanumeric1()
.delimited_by(tag("\""), tag("\""))
.map(|output: &str| Sexpr::String(output.to_string()))
}
fn int<'a>() -> impl Parser<&'a str, Output = Sexpr> {
- numeric1().map(|output: &str| Sexpr::Int(output.parse().unwrap()))
+ ascii_numeric1().map(|output: &str| Sexpr::Int(output.parse().unwrap()))
}
// Recursive parsers must avoid an infinite loop, you can do this
@@ -35,7 +35,7 @@ fn int<'a>() -> impl Parser<&'a str, Output = Sexpr> {
fn sexpr<'a>() -> impl Parser<&'a str, Output = Sexpr> {
|it| {
sexpr()
- .separated_by(whitespace1())
+ .separated_by(ascii_whitespace1())
.many()
.delimited_by(tag("("), tag(")"))
.map(|output| Sexpr::List(output))