From: Jay Freeman (saurik) Date: Sat, 19 Dec 2015 04:21:08 +0000 (-0800) Subject: Implement output of Objective-C class field lists. X-Git-Tag: v0.9.590~180 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/7cf0481b5ad2ae2b3b17fbc475bacae5c1a4ddd4?hp=0e63c25fcf834e2e18cecec6673e7cdecf8b4507 Implement output of Objective-C class field lists. --- diff --git a/ObjectiveC/Output.cpp b/ObjectiveC/Output.cpp index a1101ec..7d21d6f 100644 --- a/ObjectiveC/Output.cpp +++ b/ObjectiveC/Output.cpp @@ -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 { diff --git a/Parser.ypp.in b/Parser.ypp.in index 687218a..f73ccd1 100644 --- a/Parser.ypp.in +++ b/Parser.ypp.in @@ -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 CategoryStatement %type ClassSuperOpt %type ConditionalExpressionClassic -%type ImplementationFieldListOpt -%type ImplementationFields %type ClassMessageDeclaration %type ClassMessageDeclarationListOpt %type ClassProtocolListOpt %type ClassProtocols %type ClassProtocolsOpt +%type ImplementationFieldListOpt %type ImplementationStatement %type MessageExpression %type 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