Very simple setup.
This commit is contained in:
parent
6823db5c60
commit
2ec055af5a
32
Cargo.lock
generated
Normal file
32
Cargo.lock
generated
Normal file
@ -0,0 +1,32 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
|
||||
|
||||
[[package]]
|
||||
name = "minimal-lexical"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
||||
|
||||
[[package]]
|
||||
name = "nom"
|
||||
version = "7.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
"minimal-lexical",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nom_custom_input_test"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"nom",
|
||||
]
|
@ -6,3 +6,4 @@ edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
nom = "7.1.3"
|
||||
|
12
src/main.rs
12
src/main.rs
@ -1,3 +1,13 @@
|
||||
use nom::bytes::complete::tag;
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
let input = "this is my test input".to_owned();
|
||||
|
||||
let output = tag::<_, _, (_, nom::error::ErrorKind)>("this")(input.as_str()).unwrap();
|
||||
|
||||
println!("{:#?}", output);
|
||||
}
|
||||
|
||||
struct WrappedInput<'s> {
|
||||
contents: &'s str,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user