diff --git a/src/main/c/stream/bang.c b/src/main/c/stream/bang.c new file mode 100644 index 0000000..bb29dcc --- /dev/null +++ b/src/main/c/stream/bang.c @@ -0,0 +1,24 @@ +#ifndef _HDR_HYPERBUILD_STREAM_BANG +#define _HDR_HYPERBUILD_STREAM_BANG + +#include "../util/hbchar.h" +#include "../util/pipe.c" + +void hbs_bang(hbu_pipe_t pipe) +{ + hbu_pipe_require_match(pipe, "') + { + break; + } + + hbu_pipe_skip(pipe); + } + + hbu_pipe_skip(pipe); +} + +#endif // _HDR_HYPERBUILD_STREAM_BANG diff --git a/src/main/c/stream/content.c b/src/main/c/stream/content.c index 696a4c9..55ee7fe 100644 --- a/src/main/c/stream/content.c +++ b/src/main/c/stream/content.c @@ -8,6 +8,7 @@ void hbs_content(hbu_pipe_t pipe); #include "./tag.c" +#include "./bang.c" void hbs_content(hbu_pipe_t pipe) { while (1) { @@ -21,9 +22,14 @@ void hbs_content(hbu_pipe_t pipe) { if (hbu_pipe_peek_offset(pipe, 2) == '/') { // Callee is responsible for requiring close tag (or not, if root) return; - } - hbs_tag(pipe); + } else if (hbu_pipe_peek_offset(pipe, 2) == '!') { + // Check after comment + hbs_bang(pipe); + + } else { + hbs_tag(pipe); + } break; case '&':