From 1d00044a33c8852a4675b91b8dc6b4ccfec1e8b3 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 8 Jan 2016 20:37:54 -0800 Subject: [PATCH] Allow the size of array typedefs to be a variable. --- Parser.ypp.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parser.ypp.in b/Parser.ypp.in index 547d93e..6e889fa 100644 --- a/Parser.ypp.in +++ b/Parser.ypp.in @@ -2045,7 +2045,7 @@ ParameterTail ; SuffixedType - : SuffixedTypeOpt[typed] "[" NumericLiteral[size] "]" { $$ = $typed; $$->modifier_ = CYNew CYTypeArrayOf($size, $$->modifier_); } + : SuffixedTypeOpt[typed] "[" AssignmentExpression[size] "]" { $$ = $typed; $$->modifier_ = CYNew CYTypeArrayOf($size, $$->modifier_); } | "(" "^" TypeQualifierRightOpt[typed] ")" "(" TypedParameters[parameters] ")" { $$ = $typed; $$->modifier_ = CYNew CYTypeBlockWith($parameters, $$->modifier_); } | TypeSignifier[typed] "(" ParameterTail[modifier] { $$ = $typed; CYSetLast($modifier) = $$->modifier_; $$->modifier_ = $modifier; } | "("[parenthesis] ParameterTail[modifier] { $$ = CYNew CYTypedName(@parenthesis); CYSetLast($modifier) = $$->modifier_; $$->modifier_ = $modifier; } -- 2.45.2