X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/03db6a67c728f631b6c6f6fd140eb86a8050cf12..fa3c5be836cc074bdc12ba66298764a1da026e48:/Output.cpp?ds=sidebyside diff --git a/Output.cpp b/Output.cpp index 9b9bc72..778acb5 100644 --- a/Output.cpp +++ b/Output.cpp @@ -118,8 +118,7 @@ void CYArgument::Output(CYOutput &out) const { if (value_ != NULL) value_->Output(out, CYAssign::Precedence_, CYNoFlags); if (next_ != NULL) { - if (next_->name_ == NULL) - out << ','; + out << ','; out << ' ' << *next_; } } @@ -194,19 +193,13 @@ void CYComment::Output(CYOutput &out, CYFlags flags) const { } void CYCompound::Output(CYOutput &out, CYFlags flags) const { - if (CYExpression *expression = expressions_) - if (CYExpression *next = expression->next_) { - expression->Output(out, CYLeft(flags)); - CYFlags center(CYCenter(flags)); - while (next != NULL) { - expression = next; - out << ',' << ' '; - next = expression->next_; - CYFlags right(next != NULL ? center : CYRight(flags)); - expression->Output(out, right); - } - } else - expression->Output(out, flags); + if (next_ == NULL) + expression_->Output(out, flags); + else { + expression_->Output(out, CYLeft(flags)); + out << ',' << ' '; + next_->Output(out, CYRight(flags)); + } } void CYCondition::Output(CYOutput &out, CYFlags flags) const { @@ -447,6 +440,10 @@ void CYIfComprehension::Output(CYOutput &out) const { out << "if" << ' ' << '(' << *test_ << ')' << next_; } +void CYImport::Output(CYOutput &out, CYFlags flags) const { + out << "@import"; +} + void CYIndirectMember::Output(CYOutput &out, CYFlags flags) const { object_->Output(out, Precedence(), CYLeft(flags)); if (const char *word = property_->Word()) @@ -554,6 +551,12 @@ void CYLetStatement::Output(CYOutput &out, CYFlags flags) const { code_->Single(out, CYRight(flags)); } +void CYModule::Output(CYOutput &out) const { + out << part_; + if (next_ != NULL) + out << '.' << next_; +} + namespace cy { namespace Syntax {