Revert "Added Unix-like piping. Allows chaining of function calls where every succeeding call receives as first argument the result of all preceding expressions."

This reverts commit 7ee10e06be.
This commit is contained in:
Jeremy Ashkenas
2010-03-27 15:25:34 -04:00
parent 4dd40034ed
commit eaf4a71d32
6 changed files with 169 additions and 257 deletions

View File

@@ -1277,23 +1277,6 @@ exports.IfNode: class IfNode extends BaseNode
else_part: if @else_body then @else_body.compile(o) else 'null'
"$if_part : $else_part"
#### PipeNode
# Unix-like piping. Allows chaining of function calls where every succeeding
# call receives as first argument the result of all preceding expressions.
exports.PipeNode: class PipeNode extends BaseNode
type: 'Pipe'
constructor: (left, right, fallback) ->
@children: [@left: left, @right: right]
@fallback: fallback
compile_node: (o) ->
if @right instanceof CallNode and not (@right.is_new or @right.is_super)
@right.args.unshift @left
return @right.compile o
new OpNode((if @fallback and @left instanceof PipeNode then '||' else '|'), @left, @right).compile o
# Faux-Nodes
# ----------