minify-html/src/unit/bang.rs

17 lines
397 B
Rust
Raw Normal View History

use crate::err::ProcessingResult;
2019-12-29 05:53:49 -05:00
use crate::proc::Processor;
2019-12-25 04:44:51 -05:00
pub fn process_bang(proc: &mut Processor) -> ProcessingResult<()> {
2020-01-04 21:28:34 -05:00
if cfg!(debug_assertions) {
chain!(proc.match_seq(b"<!").expect().keep());
} else {
2020-01-06 03:53:46 -05:00
proc.accept_amount_expect(2);
2020-01-04 21:28:34 -05:00
};
2019-12-25 04:44:51 -05:00
2019-12-25 07:29:18 -05:00
chain!(proc.match_while_not_char(b'>').keep());
2019-12-25 04:44:51 -05:00
2019-12-25 07:29:18 -05:00
chain!(proc.match_char(b'>').require()?.keep());
2019-12-25 04:44:51 -05:00
Ok(())
}