makes lineno correct for statements without semicolons.
R=ken
OCL=19454
CL=19454
EXTERN Io curio;
EXTERN Io pushedio;
EXTERN int32 lineno;
+EXTERN int32 prevlineno;
EXTERN char* pathname;
EXTERN Hist* hist;
EXTERN Hist* ehist;
int escflag;
Sym *s;
+ prevlineno = lineno;
+
l0:
c = getc();
if(isspace(c))
return d;
}
+extern int yychar;
Node*
nod(int op, Node *nleft, Node *nright)
{
n->op = op;
n->left = nleft;
n->right = nright;
- n->lineno = lineno;
+ if(yychar <= 0) // no lookahead
+ n->lineno = lineno;
+ else
+ n->lineno = prevlineno;
return n;
}