cleanup
This commit is contained in:
		
							parent
							
								
									f58a143d90
								
							
						
					
					
						commit
						4bcd7a2801
					
				
					 3 changed files with 3 additions and 7 deletions
				
			
		
							
								
								
									
										2
									
								
								LICENSE
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								LICENSE
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -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:
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,8 +12,6 @@ impl<'a> Parser<'a> {
 | 
			
		|||
            .collect::<Vec<_>>();
 | 
			
		||||
        let mut captures = vec![input];
 | 
			
		||||
 | 
			
		||||
        println!("splits: {:?}", splits);
 | 
			
		||||
 | 
			
		||||
        for pat in splits {
 | 
			
		||||
            captures = captures
 | 
			
		||||
                .iter()
 | 
			
		||||
| 
						 | 
				
			
			@ -41,7 +39,6 @@ macro_rules! parse {
 | 
			
		|||
            let mut parser = eyes::Parser::new($input, $pattern);
 | 
			
		||||
            let mut captures = parser.captures();
 | 
			
		||||
            captures.reverse();
 | 
			
		||||
            println!("caps: {:?}", captures);
 | 
			
		||||
 | 
			
		||||
            (
 | 
			
		||||
            $({
 | 
			
		||||
| 
						 | 
				
			
			@ -59,7 +56,6 @@ macro_rules! try_parse {
 | 
			
		|||
            let mut parser = eyes::Parser::new($input, $pattern);
 | 
			
		||||
            let mut captures = parser.captures();
 | 
			
		||||
            captures.reverse();
 | 
			
		||||
            println!("caps: {:?}", captures);
 | 
			
		||||
 | 
			
		||||
            (
 | 
			
		||||
            $({
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,13 +1,13 @@
 | 
			
		|||
use eyes::*;
 | 
			
		||||
 | 
			
		||||
fn main() {
 | 
			
		||||
    let input = "#1 @ 338,764: 20x24";
 | 
			
		||||
    let input = "#loll1 @ 338,764: 20x24";
 | 
			
		||||
    let pattern = "#{} @ {},{}: {}x{}";
 | 
			
		||||
 | 
			
		||||
    println!("input: {}", input);
 | 
			
		||||
    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!("x: {:?}", x);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue