Skip to content

Commit

Permalink
kill old code
Browse files Browse the repository at this point in the history
  • Loading branch information
dgreensp committed Jun 17, 2013
1 parent 23ff6fb commit 630b3b8
Showing 1 changed file with 0 additions and 68 deletions.
68 changes: 0 additions & 68 deletions packages/spacebars/spacebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,74 +560,6 @@ Spacebars.compile = function (inputString) {
tree = Spacebars.parse(inputString);
}

// XXX rewrite interpolate.
//
// Should now return the source code of either a
// string or a (reactive) function. Ideally it is
// a simple string if possible.
//
// Oh snap, can't do components this way.
// Only double and triple stache.
// Should first write the logic that parses out
// block helpers and inclusions in a run of Characters,
// in tokensToFunc. These tags aren't allowed in an
// interpolation, only double-stache and triple-stache are.
//
// Will need to write the lookup rules for component names,
// helper functions, and values. Maybe it's the same?
// Delegates to `component.lookup(path)`?
//
// We will probably lose the `{{#if equal a b}}` convenience
// syntax (but maybe introduce new syntax for this later).
/*var interpolate = function (strOrArray, indent) {
if (typeof strOrArray === "string")
return toJSLiteral(strOrArray);
var parts = [];
_.each(strOrArray, function (strOrTagRef) {
if (typeof strOrTagRef === "string") {
parts.push(toJSLiteral(strOrTagRef));
} else {
var tagOrBlock = strOrTagRef.ref;
if (tagOrBlock.isBlock) {
var block = tagOrBlock;
var openTag = block.openTag;
parts.push('env.blockHelper(' + toJSLiteral(openTag.name) +
', ' + toJSLiteral(openTag.args) +
', ' + tokensToFunc(block.bodyTokens, indent) +
(block.elseTag ? ', ' +
tokensToFunc(block.elseTokens, indent)
: '') + ')');
} else {
var tag = tagOrBlock;
switch (tag.type) {
case 'COMMENT':
// nothing to do
break;
case 'INCLUSION':
parts.push('env.include(' + toJSLiteral(tag.name) +
(tag.args.length ? ', ' +toJSLiteral(tag.args) : '') +
')');
break;
case 'DOUBLE': // fall through
case 'TRIPLE':
parts.push('env.' +
(tag.type === 'DOUBLE' ? 'dstache' : 'tstache') +
'(' + toJSLiteral(tag.path) +
(tag.args.length ? ', ' + toJSLiteral(tag.args) : '') +
')');
break;
default:
throw new Error("Unknown stache tag type: " + tag.type);
//parts.push('env.tag(' + tagLiteral(tag) + ')');
}
}
}
});
return parts.join('+');
};*/

// `path` is an array of at least one string
var codeGenPath = function (path, funcInfo) {
funcInfo.usedSelf = true;
Expand Down

0 comments on commit 630b3b8

Please sign in to comment.