diff options
Diffstat (limited to 'lib/template/index.js')
-rw-r--r-- | lib/template/index.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/template/index.js b/lib/template/index.js index bb8272c..d426988 100644 --- a/lib/template/index.js +++ b/lib/template/index.js @@ -176,7 +176,7 @@ TemplateEngine.prototype.addBlock = function(name, block) { var args = parser.parseSignature(null, true); parser.advanceAfterBlockEnd(tok.value); - while (1) { + do { // Read body var currentBody = parser.parseUntilBlocks.apply(parser, allBlocks); @@ -193,14 +193,14 @@ TemplateEngine.prototype.addBlock = function(name, block) { // Read new block lastBlockName = parser.peekToken().value; - if (lastBlockName == block.end) { - break; - } // Parse signature and move to the end of the block - lastBlockArgs = parser.parseSignature(null, true); - parser.advanceAfterBlockEnd(lastBlockName); - } + if (lastBlockName != block.end) { + lastBlockArgs = parser.parseSignature(null, true); + parser.advanceAfterBlockEnd(lastBlockName); + } + } while (lastBlockName == block.end) + parser.advanceAfterBlockEnd(); var bodies = [body]; |