=========== ./readfile.go
=========== ./sieve.go
-sieve.go:8: fatal error: walktype: switch 1 unknown op SEND l(201)
+sieve.go:8: fatal error: walktype: switch 1 unknown op SEND l(212)
BUG: known to fail incorrectly
=========== ./simassign.go
=========== ./turing.go
Hello World!
-=========== ./utf.go
-
=========== ken/for.go
=========== ken/interfun.go
pc: 0x1349
0x1349?zi
- main·main(1, 0, 1606416464, ...)
- main·main(0x1, 0x7fff5fbff850, 0x1, ...)
+ main·main(1, 0, 1606416456, ...)
+ main·main(0x1, 0x7fff5fbff848, 0x1, ...)
BUG: incorrect code for division
=========== bugs/bug054.go
xxx
-. CALL u(100) l(218) <Element>I{}
-. . NAME-Vector_At G0 a(1) l(205) 111({},{}){}
-. . AS u(1) l(218)
-. . . INDREG a(1) l(218) v G0 *<Vector>{}
-. . . DOTPTR u(1) l(218) *<Vector>{}
-. . . . NAME-s G264 a(1) g(264) l(214) *<TStruct>{}
-. . . . NAME-fields G0 a(1) l(211)
-. . AS u(1) l(218)
-. . . INDREG a(1) l(218) i G265 <int32>INT32
-. . . NAME-i G265 a(1) g(265) l(214) <int32>INT32
+. CALL u(100) l(229) <Element>I{}
+. . NAME-Vector_At G0 a(1) l(216) 111({},{}){}
+. . AS u(1) l(229)
+. . . INDREG a(1) l(229) v G0 *<Vector>{}
+. . . DOTPTR u(1) l(229) *<Vector>{}
+. . . . NAME-s G279 a(1) g(279) l(225) *<TStruct>{}
+. . . . NAME-fields G0 a(1) l(222)
+. . AS u(1) l(229)
+. . . INDREG a(1) l(229) i G280 <int32>INT32
+. . . NAME-i G280 a(1) g(280) l(225) <int32>INT32
bugs/bug054.go:25: fatal error: agen_inter i2s
BUG: known to fail incorrectly
({<u><int32>INT32;<v><int32>INT32;})
BUG: compilation should succeed
+=========== bugs/bug065.go
+bugs/bug065.go:6: unknown escape sequence: '
+BUG: compilation should succeed
+
=========== fixedbugs/bug000.go
=========== fixedbugs/bug001.go
=========== fixedbugs/bug037.go
fixedbugs/bug037.go:6: vlong: undefined
-fixedbugs/bug037.go:6: fatal error: addvar: n=NAME-s G0 a(1) l(199) t=<T> nil
+fixedbugs/bug037.go:6: fatal error: addvar: n=NAME-s G0 a(1) l(210) t=<T> nil
=========== fixedbugs/bug038.go
export Scanner
type Scanner struct {
src string;
- pos int;
+ pos int; // current reading position
ch int; // one char look-ahead
+ chpos int; // position of ch
}
-/*
-export Token
-type Token struct {
- val int;
- beg, end int;
- txt string;
-}
-
-
-func (T *Token) Print () {
- print TokenName(T.val), " [", T.beg, ", ", T.end, "[ ", T.txt, "\n";
-}
-*/
-
-
// Read the next Unicode char into S.ch.
// S.ch < 0 means end-of-file.
//
// 0000-007F => T1
if pos >= lim {
S.ch = -1; // end of file
+ S.chpos = lim;
return;
}
c0 := int(src[pos]);
pos++;
if c0 < Tx {
S.ch = c0;
+ S.chpos = S.pos;
S.pos = pos;
return;
}
goto bad;
}
S.ch = r;
+ S.chpos = S.pos;
S.pos = pos;
return;
}
goto bad;
}
S.ch = r;
+ S.chpos = S.pos;
S.pos = pos;
return;
}
// bad encoding
bad:
S.ch = Bad;
+ S.chpos = S.pos;
S.pos += 1;
return;
}
}
+// TODO this needs to go elsewhere
+func IntString(x, base int) string {
+ neg := false;
+ if x < 0 {
+ x = -x;
+ if x < 0 {
+ panic "smallest int not handled";
+ }
+ neg = true;
+ }
+
+ hex := "0123456789ABCDEF";
+ var buf [16] byte;
+ i := 0;
+ for x > 0 || i == 0 {
+ buf[i] = hex[x % base];
+ x /= base;
+ i++;
+ }
+
+ s := "";
+ if neg {
+ s = "-";
+ }
+ for i > 0 {
+ i--;
+ s = s + string(int(buf[i]));
+ }
+ return s;
+}
+
+
+
+func CharString(ch int) string {
+ s := string(ch);
+ switch ch {
+ case '\a': s = "\\a";
+ case '\b': s = "\\b";
+ case '\f': s = "\\f";
+ case '\n': s = "\\n";
+ case '\r': s = "\\r";
+ case '\t': s = "\\t";
+ case '\v': s = "\\v";
+ case '\\': s = "\\";
+ case '\'': s = "\\'";
+ }
+ return "'" + s + "' (U+" + IntString(ch, 16) + ")";
+}
+
+
func (S *Scanner) Expect (ch int) {
if S.ch != ch {
- S.Error(S.pos, "expected " + string(ch) + ", found " + string(S.ch));
+ S.Error(S.chpos, "expected " + CharString(ch) + ", found " + CharString(S.ch));
}
S.Next(); // make always progress
}
func (S *Scanner) SkipComment () {
+ // '/' already consumed
if S.ch == '/' {
// comment
S.Next();
} else {
/* comment */
- pos := S.pos;
- S.Next();
+ pos := S.chpos - 1;
+ S.Expect('*');
for S.ch >= 0 {
ch := S.ch;
S.Next();
n--;
}
if n > 0 {
- S.Error(S.pos, "illegal char escape");
+ S.Error(S.chpos, "illegal char escape");
}
}
// TODO: fix this routine
ch := S.ch;
+ pos := S.chpos;
S.Next();
switch (ch) {
case 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', '\'', '"':
return ""; // TODO fix this
default:
- S.Error(S.pos, "illegal char escape");
+ S.Error(pos, "illegal char escape");
}
}
func (S *Scanner) ScanString () int {
// '"' already consumed
- pos := S.pos - 1; // TODO maybe incorrect (Unicode)
+ pos := S.chpos - 1;
for S.ch != '"' {
ch := S.ch;
S.Next();
if ch == '\n' || ch < 0 {
S.Error(pos, "string not terminated");
+ break;
}
if ch == '\\' {
S.ScanEscape();
func (S *Scanner) ScanRawString () int {
// '`' already consumed
- pos := S.pos - 1; // TODO maybe incorrect (Unicode)
+ pos := S.chpos - 1;
for S.ch != '`' {
ch := S.ch;
S.Next();
if ch == '\n' || ch < 0 {
S.Error(pos, "string not terminated");
+ break;
}
}
case is_letter(ch): tok = S.ScanIdentifier();
case digit_val(ch) < 10: tok = S.ScanNumber(false);
default:
- S.Next();
+ S.Next(); // always make progress
switch ch {
case -1: tok = EOF;
case '"': tok = S.ScanString();
case '!': tok = S.Select2(NOT, NEQ);
case '&': tok = S.Select3(AND, AND_ASSIGN, '&', CAND);
case '|': tok = S.Select3(OR, OR_ASSIGN, '|', COR);
- default: tok = ILLEGAL;
}
}
- end = S.pos - 1;
-
- /*
- t.val = tok;
- t.beg = beg;
- t.end = end;
- t.txt = S.src[beg : end];
- */
+ end = S.pos - 1; // TODO correct? (Unicode)
return tok, beg, end;
}