mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
Fix storage class for for-loop declarations
Getting "i redeclared" when i was declared in a for loop in two different functions was a tad unexpected.
This commit is contained in:
parent
67e183c8b6
commit
7a315b4a89
1 changed files with 10 additions and 2 deletions
|
@ -153,7 +153,7 @@ int yylex (void);
|
||||||
%token PROTECTED PROTOCOL PUBLIC SELECTOR REFERENCE SELF THIS
|
%token PROTECTED PROTOCOL PUBLIC SELECTOR REFERENCE SELF THIS
|
||||||
|
|
||||||
%type <spec> optional_specifiers specifiers local_specifiers
|
%type <spec> optional_specifiers specifiers local_specifiers
|
||||||
%type <spec> storage_class save_storage
|
%type <spec> storage_class save_storage set_spec_storage
|
||||||
%type <spec> type_specifier type_specifier_or_storage_class
|
%type <spec> type_specifier type_specifier_or_storage_class
|
||||||
%type <spec> type
|
%type <spec> type
|
||||||
|
|
||||||
|
@ -349,6 +349,14 @@ save_storage
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
set_spec_storage
|
||||||
|
: /* emtpy */
|
||||||
|
{
|
||||||
|
$$ = $<spec>0;
|
||||||
|
$$.storage = current_storage;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
function_body
|
function_body
|
||||||
: optional_state_expr
|
: optional_state_expr
|
||||||
{
|
{
|
||||||
|
@ -1229,7 +1237,7 @@ switch_block
|
||||||
|
|
||||||
opt_init
|
opt_init
|
||||||
: cexpr
|
: cexpr
|
||||||
| type init_var_decl_list { $$ = $2; }
|
| type set_spec_storage init_var_decl_list { $$ = $3; }
|
||||||
| /* empty */
|
| /* empty */
|
||||||
{
|
{
|
||||||
$$ = 0;
|
$$ = 0;
|
||||||
|
|
Loading…
Reference in a new issue