From: Jay Freeman (saurik) Date: Tue, 11 Mar 2014 23:35:13 +0000 (-0700) Subject: The nice thing about # is its similar density to @. X-Git-Tag: v0.9.502~22 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/ac9d4181bbfb217fda1fd531c3cd466b10a38564?ds=sidebyside The nice thing about # is its similar density to @. --- diff --git a/Cycript.l.in b/Cycript.l.in index 7eb9d11..cbe4fe5 100644 --- a/Cycript.l.in +++ b/Cycript.l.in @@ -196,6 +196,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 2c8125e..3a31f1e 100644 --- a/Cycript.yy.in +++ b/Cycript.yy.in @@ -161,6 +161,7 @@ int cylex(YYSTYPE *, cy::location *, void *); @begin E4X ObjectiveC %token At "@" +%token Pound "#" @end %token Ampersand "&" @@ -1664,7 +1665,7 @@ PrimaryExpression /* }}} */ /* Cycript (Objective-C): Instance Literals {{{ */ PrimaryExpression - : "^" NumericLiteral { $$ = CYNew CYInstanceLiteral($2); } + : "#" NumericLiteral { $$ = CYNew CYInstanceLiteral($2); } ; /* }}} */ @end diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index b707a90..b7d23ef 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -1087,7 +1087,7 @@ NSObject *CYCopyNSObject(CYPool &pool, JSContextRef context, JSValueRef value) { } - (NSString *) cy$toCYON:(bool)objective { - return [@"^" stringByAppendingString:[[self description] cy$toCYON:true]]; + return [@"#" stringByAppendingString:[[self description] cy$toCYON:true]]; } - (bool) cy$hasProperty:(NSString *)name {