diff options
author | Till Hoeppner | 2015-04-04 21:18:14 +0200 |
---|---|---|
committer | Till Hoeppner | 2015-04-04 21:18:14 +0200 |
commit | 5fdac1cc6da07a800f944fa04d37f698bf296b8a (patch) | |
tree | c231dc58b7e6cfcdca7dc82390f0da5f428b4a78 /src/format/weechat3.rs | |
parent | 7459288bfc849f50e12a220d561210b259e5394a (diff) | |
download | ilc-5fdac1cc6da07a800f944fa04d37f698bf296b8a.tar.gz ilc-5fdac1cc6da07a800f944fa04d37f698bf296b8a.tar.xz ilc-5fdac1cc6da07a800f944fa04d37f698bf296b8a.zip |
Remove remains of regex parsing
Diffstat (limited to 'src/format/weechat3.rs')
-rw-r--r-- | src/format/weechat3.rs | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/src/format/weechat3.rs b/src/format/weechat3.rs index dfe2868..f33847e 100644 --- a/src/format/weechat3.rs +++ b/src/format/weechat3.rs @@ -7,17 +7,10 @@ use format::{ Encode, Decode }; use l::LogLevel::Info; -//use regex::Regex; - use chrono::*; pub struct Weechat3; -//static NORMAL_LINE: Regex = regex!(r"^(\d+-\d+-\d+ \d+:\d+:\d+)\t[@%+~&]?([^ <-]\S+)\t(.*)"); -//static ACTION_LINE: Regex = regex!(r"^(\d+-\d+-\d+ \d+:\d+:\d+)\t \*\t(\S+) (.*)"); -//static OTHER_LINES: Regex = regex!(r"^(\d+-\d+-\d+ \d+:\d+:\d+)\s(?:--|<--|-->)\s(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\S+)(.*)\n$"); -//static OTHER_LINES: Regex = regex!(r"(.+)"); - static TIME_DATE_FORMAT: &'static str = "%Y-%m-%d %H:%M:%S"; pub struct Iter<R> where R: BufRead { @@ -85,66 +78,6 @@ impl<R> Iterator for Iter<R> where R: BufRead { })), _ => () } - /* - if let Some(cap) = NORMAL_LINE.captures(line) { - return Some(Ok(Event::Msg { - from: cap.at(2).unwrap().to_owned(), - content: cap.at(3).unwrap().to_owned(), - time: time(cap.at(1).unwrap()) - })) - } else if let Some(cap) = ACTION_LINE.captures(line) { - return Some(Ok(Event::Action { - from: cap.at(1).unwrap().to_owned(), - content: cap.at(2).unwrap().to_owned(), - time: time(cap.at(1).unwrap()) - })) - } else if let Some(cap) = OTHER_LINES.captures(line) { - println!("{:?}", cap.iter().collect::<Vec<_>>()); - if cap.at(4) == Some("has") && cap.at(5) == Some("kicked") { - println!(" Matched Event::Kick"); - return Some(Ok(Event::Kick { - kicked_nick: cap.at(6).unwrap().to_owned(), - kicking_nick: cap.at(3).unwrap().to_owned(), - kick_message: cap.at(4).unwrap().to_owned(), - time: time(cap.at(1).unwrap()) - })) - } else if cap.at(2) == Some("Topic") && cap.at(3) == Some("for") { - return Some(Ok(Event::Topic { - topic: { let mut s = cap.at(6).unwrap().to_string(); s.push_str(cap.at(7).unwrap()); s }, - time: time(cap.at(1).unwrap()) - })) - } else if cap.at(3) == Some("has") && cap.at(5) == Some("changed") && cap.at(6) == Some("topic") { - return Some(Ok(Event::TopicChange { - new_topic: cap.at(5).unwrap().to_owned(), - time: time(cap.at(1).unwrap()) - })) - } else if cap.at(3) == Some("Mode") { - return Some(Ok(Event::Mode { - time: time(cap.at(1).unwrap()) - })) - } else if cap.at(4) == Some("has") && cap.at(5) == Some("joined") { - return Some(Ok(Event::Join { - nick: cap.at(2).unwrap().to_owned(), - channel: cap.at(6).unwrap().to_owned(), - mask: mask(cap.at(3).unwrap()), - time: time(cap.at(1).unwrap()) - })) - } else if cap.at(4) == Some("has") && cap.at(5) == Some("left") { - return Some(Ok(Event::Part { - nick: cap.at(2).unwrap().to_owned(), - channel: cap.at(6).unwrap().to_owned(), - reason: cap.at(7).unwrap().to_owned(), - mask: mask(cap.at(3).unwrap()), - time: time(cap.at(1).unwrap()) - })) - } else if cap.at(5) == Some("now") && cap.at(6) == Some("known") { - return Some(Ok(Event::Nick { - old: String::new(), - new: String::new(), - time: time(cap.at(1).unwrap()) - })) - } - }*/ } } } |