X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/226edb709e84d365649e44f12fbf33e9edddfae3..9ec2b9397cc7a924bb0aa9a44ba3747fd32fa36d:/Parser.ypp.in diff --git a/Parser.ypp.in b/Parser.ypp.in index 3dbca89..c076967 100644 --- a/Parser.ypp.in +++ b/Parser.ypp.in @@ -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); } ;