--- parser3/src/targets/parser/Attic/parser.C 2001/02/21 11:13:37 1.10 +++ parser3/src/targets/parser/Attic/parser.C 2001/02/21 15:00:08 1.12 @@ -1,5 +1,5 @@ /* - $Id: parser.C,v 1.10 2001/02/21 11:13:37 paf Exp $ + $Id: parser.C,v 1.12 2001/02/21 15:00:08 paf Exp $ */ #include @@ -167,17 +167,17 @@ int main(int argc, char *argv[]) { } { - VClass *class_RUN=request.classes().get(RUN); + VClass *class_RUN=static_cast(request.classes().get(name_RUN)); String name_main(pool); name_main.APPEND_CONST("main"); - Method *method_main=vclass.get_method(name_main); + Method *method_main=class_RUN->get_method(name_main); if(!method_main) request.exception().raise(0,0, - class_RUN.name(), - "no 'main' method"); + &class_RUN->name(), + "no 'main' method in class"); - Array *code=method_main->code; - execute(&pool, code); + Array& code=method_main->code; + execute(pool, code); } } else { @@ -194,9 +194,12 @@ int main(int argc, char *argv[]) { const String *problem_source=e.problem_source(); if(problem_source) { const Origin& origin=problem_source->origin(); - printf(" '%s' [%s:%d]\n", - problem_source->cstr(), - origin.file, origin.line); + printf(" '%s'\n", + problem_source->cstr()); + if(origin.file) + printf(" [%s:%d]", + origin.file, origin.line); + printf("\n"); } } } else {