"skimsource" of the associated source file before printing the lines
SCCS-vsn: usr.bin/pascal/pdx/tree/eval.c 1.6
/* Copyright (c) 1982 Regents of the University of California */
/* Copyright (c) 1982 Regents of the University of California */
-static char sccsid[] = "@(#)eval.c 1.5 %G%";
+static char sccsid[] = "@(#)eval.c 1.6 %G%";
/*
* Parse tree evaluation.
/*
* Parse tree evaluation.
if (p->left->op == O_NAME) {
b = p->left->nameval;
if (!isblock(b)) {
error("\"%s\" is not a procedure or function", name(b));
}
if (p->left->op == O_NAME) {
b = p->left->nameval;
if (!isblock(b)) {
error("\"%s\" is not a procedure or function", name(b));
}
- r0 = srcline(firstline(b));
+ addr = firstline(b);
+ if (addr == -1) {
+ error("\"%s\" is empty", name(b));
+ }
+ skimsource(srcfilename(addr));
+ r0 = srcline(addr);
r1 = r0 + 5;
if (r1 > lastlinenum) {
r1 = lastlinenum;
r1 = r0 + 5;
if (r1 > lastlinenum) {
r1 = lastlinenum;