diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2022-03-24 21:53:58 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2022-03-24 21:53:58 +0300 |
commit | 5725085e3be9ee005c9b9cc4623d5ad5f90418f2 (patch) | |
tree | d9594f00b930cfb6b7350697f38f643f76867ce2 /src | |
parent | 5d66c96a190a396a1535c89bed4e33c2a005fe8d (diff) | |
download | roscha-5725085e3be9ee005c9b9cc4623d5ad5f90418f2.tar.gz roscha-5725085e3be9ee005c9b9cc4623d5ad5f90418f2.zip |
Fix closing tags eating tokens
Diffstat (limited to 'src')
-rw-r--r-- | src/parser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parser.c b/src/parser.c index 4ccba1b..0e331d9 100644 --- a/src/parser.c +++ b/src/parser.c @@ -449,10 +449,10 @@ parser_parse_tblock(struct parser *parser, struct block *blk) return false; } vector_push(blk->tag.tblock.subblocks, subblk); + parser_next_token(parser); if (subblk->type == BLOCK_TAG && subblk->tag.type == TAG_CLOSE) { break; } - parser_next_token(parser); } hmap_sets(parser->tblocks, blk->tag.tblock.name.token.literal, blk); @@ -519,7 +519,7 @@ closing: blk->tag.type = TAG_CLOSE; onetoken: if (!parser_expect_peek(parser, TOKEN_PERCENT)) goto fail; - if (!parser_expect_peek(parser, TOKEN_RBRACE)) goto fail; + if (!parser_peek_token_is(parser, TOKEN_RBRACE)) goto fail; return blk; noopening:; parser_error(parser, parser->cur_token, "unexpected closing tag %s", |