Branch: Tag:

2001-06-30

2001-06-30 02:02:43 by Martin Stjernholm <mast@lysator.liu.se>

Fixed a good file:line entry for top level programs. Added and used a new
function get_program_line that always returns the first file:line entry,
which is at the program start.

Rev: src/builtin.cmod:1.50
Rev: src/interpret.c:1.209
Rev: src/lexer.h:1.33
Rev: src/object.c:1.173
Rev: src/program.c:1.336
Rev: src/program.h:1.131

5:   \*/   /**/   #include "global.h" - RCSID("$Id: interpret.c,v 1.208 2001/06/23 10:33:11 hubbe Exp $"); + RCSID("$Id: interpret.c,v 1.209 2001/06/30 02:02:42 mast Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"
1815:    if (f->pc)    file = get_line (f->pc, f->context.prog, &line);    else -  file = get_line (f->context.prog->program, f->context.prog, &line); +  file = get_program_line (f->context.prog, &line);    }    if (file)    fprintf (stderr, "%s:%d: ", file, line);
1936:    case T_OBJECT: {    struct program *p = arg->u.object->prog;    if (p && p->num_linenumbers) { -  file = get_line (p->program, p, &line); +  file = get_program_line (p, &line);    fprintf (stderr, "object(%s:%d)", file, line);    }    else
1947:    case T_PROGRAM: {    struct program *p = arg->u.program;    if (p->num_linenumbers) { -  file = get_line (p->program, p, &line); +  file = get_program_line (p, &line);    fprintf (stderr, "program(%s:%d)", file, line);    }    else