]> git.saurik.com Git - cycript.git/commitdiff
Relax (broken) restriction of void typedef/return.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 10 Jan 2016 22:11:35 +0000 (14:11 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 10 Jan 2016 22:11:35 +0000 (14:11 -0800)
Parser.ypp.in

index 3dbca897318dc2ca64abf86cd3c141fe501c1806..c0769674d830edc05028deda6c7422e333346914 100644 (file)
@@ -2130,6 +2130,7 @@ PrimitiveType
     | "float" { $$ = CYNew CYTypeFloating(0); }
     | "double" { $$ = CYNew CYTypeFloating(1); }
     | "long" "double" { $$ = CYNew CYTypeFloating(2); }
+    | "void" { $$ = CYNew CYTypeVoid(); }
     ;
 
 PrimitiveReference
@@ -2141,9 +2142,7 @@ PrimitiveReference
     ;
 
 TypedIdentifierMaybe
-    : TypeQualifierLeft[modifier] "void" TypeQualifierRight[typed] { $$ = $typed; $$->specifier_ = CYNew CYTypeVoid(); CYSetLast($modifier) = $$->modifier_; $$->modifier_ = $modifier; }
-    | "void" TypeQualifierRight[typed] { $$ = $typed; $$->specifier_ = CYNew CYTypeVoid(); }
-    | TypeQualifierLeftOpt[modifier] PrimitiveReference[specifier] TypeQualifierRightOpt[typed] { $$ = $typed; $$->specifier_ = $specifier; CYSetLast($modifier) = $$->modifier_; $$->modifier_ = $modifier; }
+    : TypeQualifierLeftOpt[modifier] PrimitiveReference[specifier] TypeQualifierRightOpt[typed] { $$ = $typed; $$->specifier_ = $specifier; CYSetLast($modifier) = $$->modifier_; $$->modifier_ = $modifier; }
     ;
 
 TypedIdentifierYes
@@ -2167,13 +2166,11 @@ TypedIdentifierField
 TypedIdentifierEncoding
     : TypedIdentifierNo[pass] { $$ = $pass; }
     | TypedIdentifierTagged[typed] { if ($typed->name_ != NULL) CYERR($typed->location_, "unexpected identifier"); $$ = $typed; }
-    | "void" TypeSignifierNone[typed] { $$ = $typed; $$->specifier_ = CYNew CYTypeVoid(); }
     ;
 
 TypedIdentifierDefinition
     : TypedIdentifierYes[pass] { $$ = $pass; }
     | TypeQualifierLeftOpt[modifier] "struct" IdentifierTypeOpt[name] "{" StructFieldListOpt[fields] "}" TypeQualifierRightOpt[typed] { if ($typed->name_ == NULL) CYERR($typed->location_, "expected identifier"); $$ = $typed; $$->specifier_ = CYNew CYTypeStruct($name, CYNew CYStructTail($fields)); CYSetLast($modifier) = $$->modifier_; $$->modifier_ = $modifier; }
-    | "void" TypeSignifier[typed] { $$ = $typed; $$->specifier_ = CYNew CYTypeVoid(); }
     ;
 
 PrimaryExpression
@@ -2408,7 +2405,6 @@ TypedParameterList
 
 TypedParameterListOpt
     : TypedParameterList[pass] { $$ = $pass; }
-    | "void" { $$ = CYNew CYTypedFormal(false); }
     | { $$ = CYNew CYTypedFormal(false); }
     ;