Respect --MXcomments

This commit is contained in:
Wilson Lin 2018-08-04 16:55:50 +12:00
parent 02c6f3a4e0
commit 577637c59a
2 changed files with 9 additions and 11 deletions

View File

@ -5,26 +5,24 @@
#include "../util/pipe.c"
#include "./streamoptions.c"
void hbs_comment(hbu_pipe_t pipe)
void hbs_comment(hbs_options_t so, hbu_pipe_t pipe)
{
hbu_pipe_require(pipe, '<');
hbu_pipe_require(pipe, '!');
hbu_pipe_require(pipe, '-');
hbu_pipe_require(pipe, '-');
hbu_pipe_toggle_output_mask(pipe, so->remove_comments);
hbu_pipe_require_match(pipe, "<!--");
while (1)
{
if (hbu_pipe_peek_offset(pipe, 1) == '-' &&
hbu_pipe_peek_offset(pipe, 2) == '-' &&
hbu_pipe_peek_offset(pipe, 3) == '>')
if (hbu_pipe_accept_if_matches(pipe, "-->"))
{
break;
}
hbu_pipe_skip(pipe);
hbu_pipe_accept(pipe);
}
hbu_pipe_skip_amount(pipe, 3);
hbu_pipe_toggle_output_mask(pipe, 0);
}
#endif // _HDR_HYPERBUILD_STREAM_COMMENT

View File

@ -104,7 +104,7 @@ void hbs_content(hbs_options_t so, hbu_pipe_t pipe, hb_char_t *parent) {
break;
case HBS_CONTENT_NEXT_STATE_COMMENT:
hbs_comment(pipe);
hbs_comment(so, pipe);
break;
case HBS_CONTENT_NEXT_STATE_BANG: