fprintf(stderr, "oceani: no main function found.\n");
context.parse_error = 1;
}
+ if (context.prog && !context.parse_error) {
+ if (!analyse_prog(context.prog, &context)) {
+ fprintf(stderr, "oceani: type error in program - not running.\n");
+ context.parse_error = 1;
+ }
+ }
if (context.prog && doprint) {
## print const decls
## print type decls
print_exec(context.prog, 0, brackets);
}
- if (context.prog && doexec && !context.parse_error) {
- if (!analyse_prog(context.prog, &context)) {
- fprintf(stderr, "oceani: type error in program - not running.\n");
- exit(1);
- }
+ if (context.prog && doexec && !context.parse_error)
interp_prog(&context, context.prog, argc - optind, argv+optind);
- }
free_exec(context.prog);
while (s) {
do_indent(indent, "");
print_exec(b->left, indent, bracket);
if (cast(var, b->left)->var->constant) {
+ printf("::");
if (v->where_decl == v->where_set) {
- printf("::");
type_print(v->type, stdout);
printf(" ");
- } else
- printf(" ::");
+ }
} else {
+ printf(":");
if (v->where_decl == v->where_set) {
- printf(":");
type_print(v->type, stdout);
printf(" ");
- } else
- printf(" :");
+ }
}
if (b->right) {
printf("= ");