Comparing version 0.15.0-beta to 0.15.1-beta
@@ -135,2 +135,6 @@ "use strict"; | ||
attribute: function(node, context) { | ||
if(!context.attributes) { | ||
throw node.unexpected; | ||
} | ||
context.attributes.addText(" " + node.name); | ||
@@ -137,0 +141,0 @@ |
{ | ||
"name": "razorleaf", | ||
"version": "0.15.0-beta", | ||
"version": "0.15.1-beta", | ||
"main": "razorleaf.js", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -146,3 +146,4 @@ "use strict"; | ||
parent: this.context, | ||
indent: this.indent | ||
indent: this.indent, | ||
unexpected: this.prepareError() | ||
}; | ||
@@ -233,2 +234,3 @@ this.context.parent.children.push(this.context); | ||
this.context.value = null; | ||
this.context.unexpected = this.context.unexpected("An attribute here is not valid"); | ||
@@ -332,2 +334,9 @@ return states.attributeValue; | ||
}, | ||
prepareError: function() { | ||
var location = " at line " + line + ", character " + (i - lineStart + 1) + "."; | ||
return function(message) { | ||
return message + location; | ||
}; | ||
}, | ||
beginLine: function() { | ||
@@ -508,12 +517,12 @@ line++; | ||
begin: function() { | ||
var replacesNonExistentError = this.error("Block {block} does not exist in a parent template").message; | ||
this.context.type = "block"; | ||
this.context.name = ""; | ||
this.context.replacesNonExistentBlock = function() { | ||
return new SyntaxError(replacesNonExistentError.replace("{block}", this.name)); | ||
}; | ||
}, | ||
initialState: function whitespace(c) { | ||
if(c !== " ") { | ||
var replacesNonExistentError = this.prepareError(); | ||
this.context.replacesNonExistentBlock = function() { | ||
return replacesNonExistentError("Block " + this.name + " does not exist in a parent template"); | ||
}; | ||
return this.pass(specialBlocks.block.name); | ||
@@ -520,0 +529,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26605
840