extend(this, options);
this.template = this.scanner.scan(this.text, this.name);
};
can.EJS = EJS;
EJS.prototype.
render = function(object, extraHelpers) {
object = object || {};
return this.template.fn.call(object, object, new EJS.Helpers(object, extraHelpers || {}));
};
extend(EJS.prototype, {
scanner: new can.view.Scanner({
tokens: [
["templateLeft", "<%%"],
["templateRight", "%>"],
["returnLeft", "<%=="],
["escapeLeft", "<%="],
["commentLeft", "<%#"],
["left", "<%"],
["right", "%>"],
["returnRight", "%>"]
],
transform: function(source) {
return source.replace(/<%([\s\S]+?)%>/gm, function(whole, part) {
var brackets = [],
foundBracketPair,
i;