X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/0f37eca9cb8f903a7a54f0177c21a8cc52d93896..d5618df7c804163dceb3eb48e5406aeb9de79c96:/Output.cpp diff --git a/Output.cpp b/Output.cpp index 8d3ddaa..53d5bfe 100644 --- a/Output.cpp +++ b/Output.cpp @@ -236,6 +236,10 @@ void CYClause::Output(CYOutput &out) const { out << next_; } +void CYDebugger::Output(CYOutput &out, CYFlags flags) const { + out << "debugger" << ';'; +} + void CYDeclaration::ForIn(CYOutput &out, CYFlags flags) const { out << "var"; Output(out, CYRight(flags)); @@ -262,16 +266,19 @@ void CYDeclarations::Output(CYOutput &out) const { void CYDeclarations::Output(CYOutput &out, CYFlags flags) const { const CYDeclarations *declaration(this); bool first(true); - output: - CYDeclarations *next(declaration->next_); - CYFlags jacks(first ? CYLeft(flags) : next == NULL ? CYRight(flags) : CYCenter(flags)); - first = false; - declaration->declaration_->Output(out, jacks); - if (next != NULL) { + for (;;) { + CYDeclarations *next(declaration->next_); + + CYFlags jacks(first ? CYLeft(flags) : next == NULL ? CYRight(flags) : CYCenter(flags)); + first = false; + declaration->declaration_->Output(out, jacks); + + if (next == NULL) + break; + out << ',' << ' '; declaration = next; - goto output; } } @@ -349,14 +356,14 @@ void CYFor::Output(CYOutput &out, CYFlags flags) const { code_->Single(out, CYRight(flags)); } -void CYForEachIn::Output(CYOutput &out, CYFlags flags) const { +void CYForOf::Output(CYOutput &out, CYFlags flags) const { out << "for" << ' ' << "each" << ' ' << '('; initialiser_->ForIn(out, CYNoIn); out << "in" << *set_ << ')'; code_->Single(out, CYRight(flags)); } -void CYForEachInComprehension::Output(CYOutput &out) const { +void CYForOfComprehension::Output(CYOutput &out) const { out << "for" << ' ' << "each" << ' ' << '(' << *name_ << ' ' << "in" << ' ' << *set_ << ')' << next_; } @@ -395,7 +402,7 @@ void CYFunctionStatement::Output(CYOutput &out, CYFlags flags) const { } void CYFunctionParameter::Output(CYOutput &out) const { - out << *name_; + initialiser_->Output(out, CYNoFlags); if (next_ != NULL) out << ',' << ' ' << *next_; } @@ -463,7 +470,7 @@ void CYLabel::Output(CYOutput &out, CYFlags flags) const { statement_->Single(out, CYRight(flags)); } -void CYLet::Output(CYOutput &out, CYFlags flags) const { +void CYLetStatement::Output(CYOutput &out, CYFlags flags) const { out << "let" << ' ' << '(' << *declarations_ << ')'; code_->Single(out, CYRight(flags)); } @@ -512,13 +519,6 @@ void CYObject::Output(CYOutput &out, CYFlags flags) const { out << ')'; } -void CYOptionalFunctionParameter::Output(CYOutput &out) const { - out << *name_ << '='; - initializer_->Output(out, CYAssign::Precedence_, CYNoFlags); - if (next_ != NULL) - out << ',' << ' ' << *next_; -} - void CYPostfix::Output(CYOutput &out, CYFlags flags) const { lhs_->Output(out, Precedence(), CYLeft(flags)); out << Operator();