int32 ilineno;
int nlsemi;
int eofnl;
+ int last;
int peekc;
int peekc1; // second peekc for ...
char* cp; // used for content when bin==nil
curio.peekc = 0;
curio.peekc1 = 0;
curio.nlsemi = 0;
+ curio.eofnl = 0;
+ curio.last = 0;
// Skip initial BOM if present.
if(Bgetrune(curio.bin) != BOM)
}
case EOF:
// insert \n at EOF
- if(curio.eofnl)
+ if(curio.eofnl || curio.last == '\n')
return EOF;
curio.eofnl = 1;
c = '\n';
lexlineno++;
break;
}
+ curio.last = c;
return c;
}
package main
func foo() {
- bar(1, // ERROR "unexpected|missing|undefined"
+ bar(1, // ERROR "unexpected|missing|undefined"
\ No newline at end of file