always wrap 'yield' in () to allow composability with all other operators

This commit is contained in:
Andreas Lubbe
2014-09-06 17:12:25 +02:00
parent 437b9ed65c
commit 781ea22d57
2 changed files with 4 additions and 4 deletions

View File

@@ -2472,9 +2472,9 @@
parts.push(this.first.expression.compileToFragments(o, LEVEL_OP));
}
} else {
parts.push([this.makeCode(op)]);
parts.push([this.makeCode(' ')]);
parts.push([this.makeCode("(" + op + " ")]);
parts.push(this.first.compileToFragments(o, LEVEL_OP));
parts.push([this.makeCode(")")]);
}
return this.joinFragmentArrays(parts, '');
};

View File

@@ -1760,9 +1760,9 @@ exports.Op = class Op extends Base
if 'expression' in Object.keys @first
parts.push @first.expression.compileToFragments o, LEVEL_OP if @first.expression?
else
parts.push [@makeCode op]
parts.push [@makeCode(' ')]
parts.push [@makeCode "(#{op} "]
parts.push @first.compileToFragments o, LEVEL_OP
parts.push [@makeCode ")"]
@joinFragmentArrays parts, ''
compilePower: (o) ->