+void CYForInComprehension::Output(CYOutput &out) const {
+ out << "for" << ' ' << '(';
+ binding_->Output(out, CYNoIn | CYNoRightHand);
+ out << ' ' << "in" << ' ' << *iterable_ << ')';
+}
+
+void CYForOf::Output(CYOutput &out, CYFlags flags) const {
+ out << "for" << ' ' << '(';
+ initializer_->Output(out, CYNoRightHand);
+ out << ' ' << "of" << ' ' << *iterable_ << ')';
+ code_->Single(out, CYRight(flags), CYCompactShort);
+}
+
+void CYForOfComprehension::Output(CYOutput &out) const {
+ out << "for" << ' ' << '(';
+ binding_->Output(out, CYNoRightHand);
+ out << ' ' << "of" << ' ' << *iterable_ << ')' << next_;
+}
+
+void CYForVariable::Output(CYOutput &out, CYFlags flags) const {
+ out << "var" << ' ';
+ binding_->Output(out, CYRight(flags));
+}
+
+void CYFunction::Output(CYOutput &out) const {
+ out << '(' << parameters_ << ')' << ' ';
+ out << '{' << '\n';
+ ++out.indent_;
+ out << code_;
+ --out.indent_;
+ out << '\t' << '}';
+}
+
+void CYFunctionExpression::Output(CYOutput &out, CYFlags flags) const {
+ // XXX: one could imagine using + here to save a byte
+ bool protect((flags & CYNoFunction) != 0);
+ if (protect)
+ out << '(';
+ out << "function";
+ if (name_ != NULL)
+ out << ' ' << *name_;
+ CYFunction::Output(out);
+ if (protect)
+ out << ')';
+}
+
+void CYFunctionStatement::Output(CYOutput &out, CYFlags flags) const {
+ out << "function" << ' ' << *name_;
+ CYFunction::Output(out);
+}
+
+void CYFunctionParameter::Output(CYOutput &out) const {
+ binding_->Output(out, CYNoFlags);
+ if (next_ != NULL)
+ out << ',' << ' ' << *next_;
+}
+
+const char *CYIdentifier::Word() const {
+ return next_ == NULL || next_ == this ? CYWord::Word() : next_->Word();
+}
+
+void CYIf::Output(CYOutput &out, CYFlags flags) const {
+ bool protect(false);
+ if (false_ == NULL && (flags & CYNoDangle) != 0) {
+ protect = true;
+ out << '{';
+ }
+
+ out << "if" << ' ' << '(' << *test_ << ')';
+
+ CYFlags right(protect ? CYNoFlags : CYRight(flags));
+
+ CYFlags jacks(CYNoDangle);
+ if (false_ == NULL)
+ jacks |= right;
+ else
+ jacks |= protect ? CYNoFlags : CYCenter(flags);
+
+ unsigned line(out.position_.line);
+ unsigned indent(out.indent_);
+ true_->Single(out, jacks, CYCompactShort);
+