Skip to content
Browse files

Blank Blade documents are now valid (fixes #149)

  • Loading branch information...
1 parent 33d7afd commit 26f3de888d75b1e137c54829965fd8f50891fa88 @bminer committed Mar 11, 2013
Showing with 2 additions and 1 deletion.
  1. +1 −1 lib/parser/blade-grammar.pegjs
  2. +1 −0 lib/parser/index.js
View
2 lib/parser/blade-grammar.pegjs
@@ -29,7 +29,7 @@ Sample document (indented for readability):
var currentParentNode;
} start =
doctypes:(doctype:doctype newline {return doctype;})*
- nodes:nodes
+ nodes:nodes?
newline* //Trailing newlines in a file are certainly permitted
{return {'doctypes': doctypes, 'nodes': nodes};}
View
1 lib/parser/index.js
@@ -225,6 +225,7 @@ module.exports = (function(){
}
if (result0 !== null) {
result1 = parse_nodes();
+ result1 = result1 !== null ? result1 : "";
if (result1 !== null) {
result2 = [];
result3 = parse_newline();

0 comments on commit 26f3de8

Please sign in to comment.
Something went wrong with that request. Please try again.