From 217246731b8e62c9a6715db96fd0c752c879d7fa Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 29 Jan 2014 08:53:25 -0800 Subject: [PATCH] Let's reserve # entirely for the pre-processor. --- Cycript.l.in | 1 - Cycript.yy.in | 3 +-- ObjectiveC/Library.mm | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Cycript.l.in b/Cycript.l.in index 798e354..73721e2 100644 --- a/Cycript.l.in +++ b/Cycript.l.in @@ -193,7 +193,6 @@ 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 3a31f1e..2c8125e 100644 --- a/Cycript.yy.in +++ b/Cycript.yy.in @@ -161,7 +161,6 @@ int cylex(YYSTYPE *, cy::location *, void *); @begin E4X ObjectiveC %token At "@" -%token Pound "#" @end %token Ampersand "&" @@ -1665,7 +1664,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 c50f5b7..57bfcc7 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 { -- 2.50.0