|
|
|
@@ -459,13 +459,21 @@ var Mustache = function() { |
|
|
|
}, |
|
|
|
|
|
|
|
discard: function(parserContext, contextStack) { |
|
|
|
if (parserContext.token()===parserContext.closeTag) { |
|
|
|
return 'text'; |
|
|
|
if (parserContext.token()==='!') { |
|
|
|
return 'closeComment'; |
|
|
|
} else { |
|
|
|
return 'discard'; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
closeComment: function(parserContext, contextStack) { |
|
|
|
if (parserContext.token()!==parserContext.closeTag) { |
|
|
|
return 'discard'; |
|
|
|
} else { |
|
|
|
return 'text'; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
endOfDoc: function(parserContext, contextStack) { |
|
|
|
// eventually we may want to give better error messages |
|
|
|
throw new ParserException('Unexpected end of document.'); |
|
|
|
|