]> git.saurik.com Git - cycript.git/commitdiff
Implement output of Objective-C class field lists.
authorJay Freeman (saurik) <saurik@saurik.com>
Sat, 19 Dec 2015 04:21:08 +0000 (20:21 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Sat, 19 Dec 2015 04:21:08 +0000 (20:21 -0800)
ObjectiveC/Output.cpp
Parser.ypp.in

index a1101ecce77ebafd841eea3c974ecdd63ad328b2..7d21d6fe47f200efecece3d825294d4266294c47 100644 (file)
@@ -49,6 +49,9 @@ void CYImplementation::Output(CYOutput &out, CYFlags flags) const {
 }
 
 void CYImplementationField::Output(CYOutput &out) const {
+    out << *typed_;
+    out.Terminate();
+    out << '\n';
 }
 
 void CYInstanceLiteral::Output(CYOutput &out, CYFlags flags) const {
index 687218ae7144db28665d5d0d783cc5b7e9b77321..f73ccd168b9758b9d83a630351a260d02799c764 100644 (file)
@@ -87,9 +87,9 @@
 @end
 
 @begin ObjectiveC
+%union { CYImplementationField *implementationField_; }
 %union { CYMessage *message_; }
 %union { CYMessageParameter *messageParameter_; }
-%union { CYImplementationField *implementationField_; }
 %union { CYProtocol *protocol_; }
 %union { CYSelectorPart *selector_; }
 @end
@@ -644,13 +644,12 @@ type; })
 %type <statement_> CategoryStatement
 %type <expression_> ClassSuperOpt
 %type <expression_> ConditionalExpressionClassic
-%type <implementationField_> ImplementationFieldListOpt
-%type <implementationField_> ImplementationFields
 %type <message_> ClassMessageDeclaration
 %type <message_> ClassMessageDeclarationListOpt
 %type <protocol_> ClassProtocolListOpt
 %type <protocol_> ClassProtocols
 %type <protocol_> ClassProtocolsOpt
+%type <implementationField_> ImplementationFieldListOpt
 %type <statement_> ImplementationStatement
 %type <target_> MessageExpression
 %type <messageParameter_> MessageParameter
@@ -2015,10 +2014,6 @@ ImplementationFieldListOpt
     | { $$ = NULL; }
     ;
 
-ImplementationFields
-    : "{" ImplementationFieldListOpt[fields] "}" { $$ = $fields; }
-    ;
-
 MessageScope
     : "+" { $$ = false; }
     | "-" { $$ = true; }
@@ -2072,7 +2067,7 @@ ClassProtocolListOpt
     ;
 
 ImplementationStatement
-    : "@implementation" Identifier[name] ClassSuperOpt[extends] ClassProtocolListOpt[protocols] ImplementationFields[fields] ClassMessageDeclarationListOpt[messages] "@end" { $$ = CYNew CYImplementation($name, $extends, $protocols, $fields, $messages); }
+    : "@implementation" Identifier[name] ClassSuperOpt[extends] ClassProtocolListOpt[protocols] "{" ImplementationFieldListOpt[fields] "}" ClassMessageDeclarationListOpt[messages] "@end" { $$ = CYNew CYImplementation($name, $extends, $protocols, $fields, $messages); }
     ;
 
 CategoryName