2019-12-25 21:47:18 -05:00
|
|
|
use crate::err::ProcessingResult;
|
2019-12-29 05:53:49 -05:00
|
|
|
use crate::proc::Processor;
|
2019-12-25 04:44:51 -05:00
|
|
|
|
2020-01-01 22:14:40 -05:00
|
|
|
include!(concat!(env!("OUT_DIR"), "/gen_pattern_COMMENT_END.rs"));
|
|
|
|
|
2019-12-25 21:47:18 -05:00
|
|
|
pub fn process_comment(proc: &mut Processor) -> ProcessingResult<()> {
|
2019-12-29 19:33:49 -05:00
|
|
|
if cfg!(debug_assertions) {
|
|
|
|
chain!(proc.match_seq(b"<!--").expect().discard());
|
|
|
|
} else {
|
|
|
|
proc.skip_amount_expect(4);
|
|
|
|
}
|
2019-12-25 04:44:51 -05:00
|
|
|
|
2020-01-01 22:14:40 -05:00
|
|
|
chain!(proc.match_while_not_seq(COMMENT_END).discard());
|
2019-12-25 04:44:51 -05:00
|
|
|
|
2020-01-08 07:00:23 -05:00
|
|
|
chain!(proc.match_seq(b"-->").require_with_reason("end of comment")?.discard());
|
2019-12-25 04:44:51 -05:00
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|