X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/76284c7490dc7bab511412c707daf856c61d3fd0..63db22e50caddb75792b67534547cb3ac7ccff61:/Output.cpp diff --git a/Output.cpp b/Output.cpp index a26e3e7..2ff5ad7 100644 --- a/Output.cpp +++ b/Output.cpp @@ -183,13 +183,6 @@ void Catch::Output(CYOutput &out) const { } } -void CYComment::Output(CYOutput &out, CYFlags flags) const { - out << '\r'; - out(value_); - out.right_ = true; - out << '\r'; -} - void CYCompound::Output(CYOutput &out, CYFlags flags) const { if (next_ == NULL) expression_->Output(out, flags); @@ -298,12 +291,16 @@ void CYDoWhile::Output(CYOutput &out, CYFlags flags) const { out << "while" << ' ' << '(' << *test_ << ')'; } -void CYElement::Output(CYOutput &out) const { +void CYElementSpread::Output(CYOutput &out) const { + out << "..." << value_; +} + +void CYElementValue::Output(CYOutput &out) const { if (value_ != NULL) value_->Output(out, CYAssign::Precedence_, CYNoFlags); if (next_ != NULL || value_ == NULL) { out << ','; - if (next_ != NULL && next_->value_ != NULL) + if (next_ != NULL && !next_->Elision()) out << ' '; } if (next_ != NULL) @@ -510,6 +507,10 @@ void CYStatement::Output(CYOutput &out) const { Multiple(out); } +void CYTemplate::Output(CYOutput &out, CYFlags flags) const { + _assert(false); +} + void CYTypeArrayOf::Output(CYOutput &out, CYIdentifier *identifier) const { next_->Output(out, Precedence(), identifier); out << '['; @@ -610,7 +611,7 @@ void New::Output(CYOutput &out, CYFlags flags) const { } } void CYNull::Output(CYOutput &out, CYFlags flags) const { - CYWord::Output(out); + out << "null"; } void CYNumber::Output(CYOutput &out, CYFlags flags) const { @@ -653,7 +654,7 @@ void CYPrefix::Output(CYOutput &out, CYFlags flags) const { rhs_->Output(out, Precedence(), CYRight(flags)); } -void CYProgram::Output(CYOutput &out) const { +void CYScript::Output(CYOutput &out) const { out << code_; } @@ -784,7 +785,7 @@ void CYSwitch::Output(CYOutput &out, CYFlags flags) const { } void CYThis::Output(CYOutput &out, CYFlags flags) const { - CYWord::Output(out); + out << "this"; } namespace cy {