minify-html/src/unit/instruction.rs

19 lines
529 B
Rust
Raw Normal View History

2020-01-08 07:00:23 -05:00
use crate::err::ProcessingResult;
use crate::proc::Processor;
include!(concat!(env!("OUT_DIR"), "/gen_pattern_INSTRUCTION_END.rs"));
pub fn process_instruction(proc: &mut Processor) -> ProcessingResult<()> {
if cfg!(debug_assertions) {
chain!(proc.match_seq(b"<?").expect().keep());
} else {
proc.accept_amount_expect(2);
};
chain!(proc.match_while_not_seq(INSTRUCTION_END).keep());
chain!(proc.match_seq(b"?>").require_with_reason("end of processing instruction")?.keep());
Ok(())
}