This commit is contained in:
Frederik Palmø 2021-10-21 16:12:19 +02:00
parent f58a143d90
commit 4bcd7a2801
3 changed files with 3 additions and 7 deletions

View file

@ -1,4 +1,4 @@
Copyright (c) <year> <owner>. All rights reserved. Copyright (c) 2021 vodofrede. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

View file

@ -12,8 +12,6 @@ impl<'a> Parser<'a> {
.collect::<Vec<_>>(); .collect::<Vec<_>>();
let mut captures = vec![input]; let mut captures = vec![input];
println!("splits: {:?}", splits);
for pat in splits { for pat in splits {
captures = captures captures = captures
.iter() .iter()
@ -41,7 +39,6 @@ macro_rules! parse {
let mut parser = eyes::Parser::new($input, $pattern); let mut parser = eyes::Parser::new($input, $pattern);
let mut captures = parser.captures(); let mut captures = parser.captures();
captures.reverse(); captures.reverse();
println!("caps: {:?}", captures);
( (
$({ $({
@ -59,7 +56,6 @@ macro_rules! try_parse {
let mut parser = eyes::Parser::new($input, $pattern); let mut parser = eyes::Parser::new($input, $pattern);
let mut captures = parser.captures(); let mut captures = parser.captures();
captures.reverse(); captures.reverse();
println!("caps: {:?}", captures);
( (
$({ $({

View file

@ -1,13 +1,13 @@
use eyes::*; use eyes::*;
fn main() { fn main() {
let input = "#1 @ 338,764: 20x24"; let input = "#loll1 @ 338,764: 20x24";
let pattern = "#{} @ {},{}: {}x{}"; let pattern = "#{} @ {},{}: {}x{}";
println!("input: {}", input); println!("input: {}", input);
println!("pattern: {}", pattern); println!("pattern: {}", pattern);
let (id, x, y, w, h) = parse!(input, pattern, usize, isize, isize, usize, usize); let (id, x, y, w, h) = parse!(input, pattern, String, f64, f32, usize, isize);
println!("id: {:?}", id); println!("id: {:?}", id);
println!("x: {:?}", x); println!("x: {:?}", x);