in double-checking this patch, i found that // comments are already used in cc.y. the difference in output between the old yacc and the new version is amusing. yacc doesn't see the comment and translates $n in the comments.
- erik
----
in cpyact() replace case '/' with
case '/':
/* look for comments; sync with skipcom() */
Bputrune(faction, c);
c = Bgetrune(finput);
switch(c){
default:
goto lcopy;
case '/':
Bputrune(faction, c);
while((c = Bgetrune(finput)) != Beof){
Bputrune(faction, c);
if(c == '\n'){
lineno++;
goto loop;
}
}
break;
case '*':
Bputrune(faction, c);
match = 0;
while((c = Bgetrune(finput)) != Beof){
Bputrune(faction, c);
if(c == '\n')
lineno++;
if(match && c == '/')
goto loop;
match = c == '*';
}
break;
case Beof:
break;
}
error("EOF inside comment");
