X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/37dadc219da7f34c243c5c76c2eff2d3fa1f1051..2c4a8bb6222b88ff96fbf25372179646ce15f706:/Output.cpp diff --git a/Output.cpp b/Output.cpp index a2e3213..26e49fe 100644 --- a/Output.cpp +++ b/Output.cpp @@ -92,6 +92,12 @@ void CYStringify(std::ostringstream &str, const char *data, size_t size, CYStrin case '\t': str << "\\t"; break; case '\v': str << "\\v"; break; + case '\a': + if (mode == CYStringifyModeNative) + str << "\\a"; + else goto simple; + break; + case '\n': if (!split) str << "\\n"; @@ -130,7 +136,7 @@ void CYStringify(std::ostringstream &str, const char *data, size_t size, CYStrin break; case '\0': - if (value[1] >= '0' && value[1] <= '9') + if (mode != CYStringifyModeNative && value[1] >= '0' && value[1] <= '9') str << "\\x00"; else str << "\\0"; @@ -139,6 +145,8 @@ void CYStringify(std::ostringstream &str, const char *data, size_t size, CYStrin default: if (next >= 0x20 && next < 0x7f) simple: str << *value; + else if (mode == CYStringifyModeNative) + str << "\\x" << std::setbase(16) << std::setw(2) << std::setfill('0') << unsigned(*value & 0xff); else { unsigned levels(1); if ((next & 0x80) != 0) @@ -294,6 +302,14 @@ void CYAssignment::Output(CYOutput &out, CYFlags flags) const { rhs_->Output(out, Precedence(), CYRight(flags)); } +void CYAttemptMember::Output(CYOutput &out, CYFlags flags) const { + object_->Output(out, Precedence(), CYLeft(flags) | CYNoInteger); + if (const char *word = property_->Word()) + out << "?." << word; + else + _assert(false); +} + void CYBlock::Output(CYOutput &out, CYFlags flags) const { out << '{' << '\n'; ++out.indent_; @@ -1177,6 +1193,15 @@ void CYTypeError::Output(CYOutput &out) const { out << "@error"; } +void CYTypeFloating::Output(CYOutput &out) const { + switch (length_) { + case 0: out << "float"; break; + case 1: out << "double"; break; + case 2: out << "long" << ' ' << "double"; break; + default: _assert(false); + } +} + void CYTypeInt128::Output(CYOutput &out) const { switch (signing_) { case CYTypeNeutral: break;