]> git.saurik.com Git - cycript.git/blobdiff - Replace.cpp
Require strings used as characters to be one byte.
[cycript.git] / Replace.cpp
index c2681822f5f6c71782f48e8e070446bb4ee101de..68beb4f47b3ad1127ba94aabb0338c714434b159 100644 (file)
@@ -1173,6 +1173,13 @@ CYTarget *CYTemplate::Replace(CYContext &context) {
     return $C2($M($M($M($V("String"), $S("prototype")), $S("concat")), $S("apply")), $S(""), $ CYArray($ CYElementValue(string_, spans_->Replace(context))));
 }
 
+CYString *CYTemplate::String(CYContext &context) {
+    // XXX: implement this over local concat
+    if (spans_ != NULL)
+        return NULL;
+    return string_;
+}
+
 CYTarget *CYThis::Replace(CYContext &context) {
     if (context.this_ != NULL)
         return $V(context.this_->Identifier(context));
@@ -1262,6 +1269,15 @@ CYTarget *CYTypeExpression::Replace(CYContext &context) {
     return typed_->Replace(context);
 }
 
+CYTarget *CYTypeFloating::Replace(CYContext &context) {
+    switch (length_) {
+        case 0: return $V("float");
+        case 1: return $V("double");
+        case 2: return $V("longdouble");
+        default: _assert(false);
+    }
+}
+
 CYTarget *CYTypeInt128::Replace(CYContext &context) {
     return $V(signing_ == CYTypeUnsigned ? "uint128" : "int128");
 }