this assumes that embedded newlines are
legal in back-quote strings.
R=r
OCL=30502
CL=30502
static int32
_yylex(void)
{
- int c, c1, clen;
+ int c, c1, clen, escflag;
vlong v;
char *cp;
Rune rune;
- int escflag;
+ int32 lno;
Sym *s;
prevlineno = lineno;
clen = sizeof(int32);
casebq:
+ lno = lineno;
for(;;) {
c = getc();
- if(c == EOF || c == '`')
+ if(c == EOF) {
+ yyerror("eof in string starting at line %L", lno);
+ break;
+ }
+ if(c == '`')
break;
cp = remal(cp, clen, 1);
cp[clen++] = c;
loop:
c = getr();
- if(c == '\n') {
+ switch(c) {
+ case EOF:
+ yyerror("eof in string");
+ return 1;
+ case '\n':
yyerror("newline in string");
return 1;
- }
- if(c != '\\') {
+ case '\\':
+ break;
+ default:
if(c == e)
return 1;
*val = c;