pike.git/
src/
language.yacc
Branch:
Tag:
Non-build tags
All tags
No tags
2019-08-22
2019-08-22 10:13:46 by Henrik Grubbström (Grubba) <grubba@grubba.org>
ba00039d06ab5812e46883b7b355f5ba775a3569 (
20
lines) (+
20
/-
0
)
[
Show
|
Annotate
]
Branch:
master
Compiler: Added tentative generator syntax.
814:
/* construct the function type */ push_finished_type(Pike_compiler->compiler_frame->current_return_type);
+
if ($1 & ID_GENERATOR) {
+
push_type(T_VOID);
+
push_type(T_MANY);
+
+
/* Entry point variable. */
+
add_ref(int_type_string);
+
add_local_name(empty_pike_string, int_type_string, 0);
+
}
+
e = $<number>8 + $9 - 1; if(Pike_compiler->varargs && (!$<number>8 || (Pike_compiler->num_create_args >= 0)))
935:
} }
+
if ($1 & ID_GENERATOR) {
+
$12 = mknode(F_GENERATOR, $12, NULL);
+
}
+
{ int l = $12->line_number; struct pike_string *f = $12->current_file;
957:
/* Change "auto" return type to actual return type. */ push_finished_type(Pike_compiler->compiler_frame->current_return_type->car);
+
if ($1 & ID_GENERATOR) {
+
push_type(T_VOID);
+
push_type(T_MANY);
+
}
+
e = $<number>8 + $9 - 1; if(Pike_compiler->varargs && (!$<number>8 || (Pike_compiler->num_create_args >= 0)))
1194:
| TOK_INLINE { $$ = ID_INLINE; } | TOK_VARIANT { $$ = ID_VARIANT; } | TOK_WEAK { $$ = ID_WEAK; }
+
| TOK_CONTINUE { $$ = ID_GENERATOR; }
; magic_identifiers1: