From f53b3728f410baac87f286b5345aeb18cc8b8d17 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 15 Sep 2012 08:30:28 -0700 Subject: [PATCH] Allow the use of void as a primitive data type. --- Cycript.yy.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Cycript.yy.in b/Cycript.yy.in index d049537..684463d 100644 --- a/Cycript.yy.in +++ b/Cycript.yy.in @@ -481,6 +481,7 @@ int cylex(YYSTYPE *, cy::location *, void *); %type MessageScope %type ModifiedType %type PrefixedType +%type PrimitiveType %type QualifiedType %type SelectorCall_ %type SelectorCall @@ -1357,8 +1358,13 @@ PrefixedType | "*" PrefixedType { CYSetLast($2->type_) = CYNew CYTypePointerTo(); $$ = $2; } ; +PrimitiveType + : Variable { $$ = $1; } + | "void" { $$ = CYNew cy::Syntax::New(CYNew CYVariable(CYNew CYIdentifier("Type")), CYNew CYArgument(CYNew CYString("v"))); } + ; + QualifiedType - : Variable { $$ = CYNew CYTypeVariable($1); } + : PrimitiveType { $$ = CYNew CYTypeVariable($1); } | "const" QualifiedType { $$ = CYNew CYTypeConstant($2); } ; @@ -1403,7 +1409,6 @@ MessageScope TypeOpt : "(" LexSetRegExp EncodedType ")" { $$ = $3; } - | "(" LexSetRegExp "void" ")" { $$ = CYNew CYString("v"); } | { $$ = NULL; } ; -- 2.47.2