X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/09eee478cd3085633d87ddc8a7997ff3d000102e..029bc65b46de676c6733fff684000c7363eda512:/Output.cpp diff --git a/Output.cpp b/Output.cpp index 04f893c..27ea3fc 100644 --- a/Output.cpp +++ b/Output.cpp @@ -284,7 +284,7 @@ void CYClause::Output(CYOutput &out) const { } const char *CYDeclaration::ForEachIn() const { - return identifier_->Value(); + return identifier_->Word(); } void CYDeclaration::ForIn(CYOutput &out, CYFlags flags) const { @@ -352,6 +352,7 @@ void CYElement::Output(CYOutput &out) const { } void CYEmpty::Output(CYOutput &out, CYFlags flags) const { + out << '`'; out.Terminate(); } @@ -416,7 +417,8 @@ void CYForEachInComprehension::Output(CYOutput &out) const { void CYForIn::Output(CYOutput &out, CYFlags flags) const { out << "for" << ' ' << '('; - initialiser_->ForIn(out, CYNoIn); + if (initialiser_ != NULL) + initialiser_->ForIn(out, CYNoIn); out << "in" << *set_ << ')'; code_->Single(out, CYRight(flags)); } @@ -431,6 +433,8 @@ void CYFunction::Output(CYOutput &out, CYFlags flags) const { if (protect) out << '('; out << "function"; + if (out.options_.verbose_) + out.out_ << ':' << static_cast(this); if (name_ != NULL) out << ' ' << *name_; out << '(' << parameters_ << ')'; @@ -453,6 +457,10 @@ void CYFunctionParameter::Output(CYOutput &out) const { out << ',' << ' ' << *next_; } +const char *CYIdentifier::Word() const { + return replace_ == NULL || replace_ == this ? CYWord::Word() : replace_->Word(); +} + void CYIf::Output(CYOutput &out, CYFlags flags) const { bool protect(false); if (false_ == NULL && (flags & CYNoDangle) != 0) { @@ -716,15 +724,21 @@ void CYWith::Output(CYOutput &out, CYFlags flags) const { void CYWord::ClassName(CYOutput &out, bool object) const { if (object) out << "objc_getClass("; - out << '"' << Value() << '"'; + out << '"' << Word() << '"'; if (object) out << ')'; } void CYWord::Output(CYOutput &out) const { - out << Value(); + out << Word(); + if (out.options_.verbose_) + out.out_ << '@' << this; } void CYWord::PropertyName(CYOutput &out) const { Output(out); } + +const char *CYWord::Word() const { + return word_; +}