feat(parser): clock parsing

This commit is contained in:
PoiScript 2019-04-23 18:52:52 +08:00
parent cd7e03accb
commit 69534576f1
4 changed files with 11 additions and 11 deletions

View file

@ -86,7 +86,7 @@ pub enum Event<'a> {
value: &'a str,
},
Clock,
Clock(Clock<'a>),
Comment(&'a str),
FixedWidth(&'a str),
@ -335,6 +335,12 @@ impl<'a> Parser<'a> {
return Some((Event::ListBeg { ordered }, 0, line_begin, text.len()));
}
if tail.starts_with("CLOCK:") {
if let Some((clock, off)) = Clock::parse(tail) {
return Some((Event::Clock(clock), off + line_begin, 0, 0));
}
}
// TODO: LaTeX environment
if tail.starts_with("\\begin{") {}