From: Jay Freeman (saurik) Date: Sun, 19 Jan 2014 20:20:23 +0000 (-0800) Subject: CYONify NSObject with # (different from NSString). X-Git-Tag: v0.9.500~33 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/74dde0f879f5c11cfb10e161ec5e4c4f2abbca73 CYONify NSObject with # (different from NSString). --- diff --git a/Cycript.l.in b/Cycript.l.in index 77a4d27..e7bd05c 100644 --- a/Cycript.l.in +++ b/Cycript.l.in @@ -193,6 +193,7 @@ XMLName {XMLNameStart}{XMLNamePart}* @begin E4X ObjectiveC "@" L C F(tk::At, hi::Operator); +"#" L C F(tk::Pound, hi::Operator); @end "&" L C F(tk::Ampersand, hi::Operator); diff --git a/Cycript.yy.in b/Cycript.yy.in index 983802f..a11643f 100644 --- a/Cycript.yy.in +++ b/Cycript.yy.in @@ -160,6 +160,7 @@ int cylex(YYSTYPE *, cy::location *, void *); @begin E4X ObjectiveC %token At "@" +%token Pound "#" @end %token Ampersand "&" diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index 355966f..81cc3a2 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -1068,7 +1068,7 @@ NSObject *CYCopyNSObject(CYPool &pool, JSContextRef context, JSValueRef value) { } - (NSString *) cy$toCYON:(bool)objective { - return [[self description] cy$toCYON:objective]; + return [@"#" stringByAppendingString:[[self description] cy$toCYON:true]]; } - (bool) cy$hasProperty:(NSString *)name {