pike.git/
src/
language.yacc
Branch:
Tag:
Non-build tags
All tags
No tags
2016-01-04
2016-01-04 14:57:56 by Per Hedbor <ph@opera.com>
bb88421edb773d9f7ebe70f82ec45394625aa70f (
12
lines) (+
10
/-
2
)
[
Show
|
Annotate
]
Branch:
per/auto_type_81
Somewhat better handling of global auto variables
1748:
$2->u.sval.u.string->str); } #endif /* PIKE_DEBUG */
-
if(
is
_
auto
_
variable
_type
( $<number
>
4
)
)
+
if(
Pike
_
compiler->compiler
_
frame->current
_type
-
>
type
== PIKE_T_AUTO
)
{ // auto variable type needs to be updated.
-
+
fix_type_field( $5 );
fix_auto_variable_type( $<number>4, $5->type ); } free_node($5);
1758:
} } if ($5) {
-
if( Pike_compiler->compiler_
pass
==
2 && is
_
auto
_
variable_type(
$<number>4
)
)
+
// this is done in both passes to get somewhat better handling
+
// of auto types.
+
//
+
// an example is: auto a = typeof(b); auto b = (["foo":"bar"]);
+
//
if
this is only done in the second pass the type of a will be
+
// type
(
auto),
not type(mapping(..))
+
if(
Pike_compiler->compiler_
frame->current_type->type
==
PIKE
_
T
_
AUTO
)
{ fix_type_field( $5 ); fix_auto_variable_type( $<number>4, $5->type );