]> git.saurik.com Git - cycript.git/blobdiff - Cycript.yy.in
Allow Type objects to have associated identifiers.
[cycript.git] / Cycript.yy.in
index 92d57f68bdfc733727ca99cf000e23778b03d8ea..b6f355c865f96cb50ab283163d2c67c38f045412 100644 (file)
@@ -478,6 +478,7 @@ int cylex(YYSTYPE *, cy::location *, void *);
 %type <messageParameter_> MessageParameterListOpt
 %type <bool_> MessageScope
 %type <type_> ModifiedType
 %type <messageParameter_> MessageParameterListOpt
 %type <bool_> MessageScope
 %type <type_> ModifiedType
+%type <part_> NamedTypeOpt
 %type <part_> PrefixedType
 %type <argument_> SelectorCall_
 %type <argument_> SelectorCall
 %type <part_> PrefixedType
 %type <argument_> SelectorCall_
 %type <argument_> SelectorCall
@@ -1339,8 +1340,13 @@ ProgramBodyOpt
 
 @begin ObjectiveC
 /* Cycript (Objective-C): Type Encoding {{{ */
 
 @begin ObjectiveC
 /* Cycript (Objective-C): Type Encoding {{{ */
+NamedTypeOpt
+    : Identifier { $$ = CYNew CYEncodedPart(NULL, "withName", CYNew CYArgument(CYNew CYString($1->word_))); }
+    | { $$ = NULL; }
+    ;
+
 SuffixedType
 SuffixedType
-    : { $$ = NULL; }
+    : NamedTypeOpt { $$ = $1; }
     | "(" PrefixedType ")" { $$ = $2; }
     | SuffixedType "[" NumericLiteral "]" { $$ = CYNew CYEncodedPart($1, "arrayOf", CYNew CYArgument($3)); }
     ;
     | "(" PrefixedType ")" { $$ = $2; }
     | SuffixedType "[" NumericLiteral "]" { $$ = CYNew CYEncodedPart($1, "arrayOf", CYNew CYArgument($3)); }
     ;