yylval.val.u.sval = (Strlit*)cp;
yylval.val.ctype = CTSTR;
DBG("lex: string literal\n");
+ strcpy(litbuf, "string literal");
return LLITERAL;
case '\'':
mpmovecfix(yylval.val.u.xval, v);
yylval.val.ctype = CTINT;
DBG("lex: codepoint literal\n");
+ strcpy(litbuf, "string literal");
return LLITERAL;
case '/':
}
yylval.val.ctype = CTINT;
DBG("lex: integer literal\n");
+ strcpy(litbuf, "literal ");
+ strcat(litbuf, lexbuf);
return LLITERAL;
casedot:
}
yylval.val.ctype = CTCPLX;
DBG("lex: imaginary literal\n");
+ strcpy(litbuf, "literal ");
+ strcat(litbuf, lexbuf);
return LLITERAL;
caseout:
}
yylval.val.ctype = CTFLT;
DBG("lex: floating literal\n");
+ strcpy(litbuf, "literal ");
+ strcat(litbuf, lexbuf);
return LLITERAL;
}
for(i=0; yytname[i] != nil; i++) {
s = yytname[i];
+ if(strcmp(s, "LLITERAL") == 0) {
+ strcpy(litbuf, "literal");
+ yytname[i] = litbuf;
+ goto loop;
+ }
+
// apply yytfix if possible
for(j=0; j<nelem(yytfix); j++) {
if(strcmp(s, yytfix[j].have) == 0) {
--- /dev/null
+// errchk $G $D/$F.go
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// issue 1192 - detail in error
+
+package main
+
+func foo() (a, b, c int) {
+ return 0, 1 2.01 // ERROR "unexpected literal 2.01"
+}