raz / commit 1d7484fe

commit
1d7484fe4352eeff5b32f08a82cd0de6388454fd
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
1d0597c6
Step 4: the conformance suite, conform/, apart from this compiler's tests

conform/run and conform/err: programs whose output, status or
rejection the report alone fixes, using only the language and the
library no target may leave out. conform/check.sh runs them with any
compiler taking -I and -o, and compares its messages only when given
a dir of them: test/msg holds this compiler's.

Kept in test/: code procs, SYSCALL, extern and link, Thread, target
files, warnings and -Werror, the compiler's limits (names in one decl,
defers, frame size, ...), record sizes over 64-bit pointers, and the
faults caught by signals, whose status the report leaves open.
Programs with reals stay in the suite until step 6.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

patch · log

900 files changed, +3703 -3609

CLAUDE.md modified +12 -5

@@ -24,11 +24,18 @@
2424 (`apt-get install -y vim emacs-nox`): each example must indent back
2525 exactly as written.
2626
27-`make check` must pass before every commit. Tests: `test/run/X.raz`
28-with `X.expect` (stdout), optional `X.status`, `X.stderr` and
29-`X.args`; modules they import in `test/run/mods`. `test/err/X.raz`
30-must fail to compile with the text in `X.err` (all of standard error),
31-given the compiler options in `X.args` if there is one.
27+`make check` must pass before every commit. The conformance suite,
28+`conform/`, holds what any implementation must do (`conform/check.sh`
29+says how it is laid out); `test/` holds what is this compiler's alone:
30+its messages, its limits, its target. A test goes in `conform/` when
31+the report alone fixes its output and status, and keeps to the
32+language and the library a target can't leave out. Tests:
33+`test/run/X.raz` with `X.expect` (stdout), optional `X.status`,
34+`X.stderr` and `X.args`; modules they import in `test/run/mods`.
35+`test/err/X.raz` must fail to compile with the text in `X.err` (all of
36+standard error), given the compiler options in `X.args` if there is
37+one. `test/msg` holds this compiler's `X.stderr` and `X.err` for the
38+programs in `conform/`.
3239 `test/pretty/X.raz` must format to `X.expect`. Examples in `examples/`
3340 work the same way, compiled with `-Werror`, as are the tools and the
3441 library's tests: they must have no warnings.

PLAN.md (history) modified +2 -2

@@ -66,7 +66,7 @@
6666
6767 ## Proposed, v0.6.0: raz to be rebuilt by anyone
6868
69-Under way: steps 1 to 3 are agreed; step 4 is next. The freeze
69+Under way: steps 1 to 3 are agreed; step 4 is for review. The freeze
7070 doesn't hold for this work, by the owner's word.
7171
7272 **For:** a language a person alone can implement again, from the
@@ -108,7 +108,7 @@
108108 code close to what the parser asks of `gen` today, with types
109109 and places, so that a back end turns its stack into registers and
110110 an interpreter of it stays small.
111-- [ ] 4. The tests split: a conformance suite any implementation
111+- [x] 4. The tests split: a conformance suite any implementation
112112 passes, apart from this compiler's own messages.
113113 - [ ] 5. The system integer.
114114 - [ ] 6. Optional reals: a target says whether it has them.

README.md (history) modified +3 -2

@@ -41,7 +41,8 @@
4141 | `tools/Doc.raz` | Prints what a module exports, with its comments |
4242 | `tools/Pretty.raz` | The formatter: fixes indentation and spacing |
4343 | `editor/` | Support for vim and emacs |
44-| `test/` | Tests, and the scripts that run them |
44+| `conform/` | The conformance suite: what every implementation must do |
45+| `test/` | This compiler's own tests, and the scripts that run them |
4546 | `PLAN.md` | The plan: the milestone under way and its steps |
4647
4748 ## Building
@@ -135,7 +136,7 @@
135136 $ ./raz -o Doc tools/Doc.raz && ./Doc lib/Str.raz
136137
137138 Each library module's `main` is its test, which `make check` runs; the
138-generic ones, which can't run alone, are tested in `test/run`.
139+generic ones, which can't run alone, are tested in `conform/run`.
139140
140141 ## Editors
141142

conform/check.sh (history) added (executable) +79 -0

@@ -0,0 +1,79 @@
1+#!/bin/sh
2+# The conformance suite: programs whose behaviour the report defines,
3+# which every implementation of raz must give, whatever its target.
4+#
5+# conform/check.sh COMPILER [MESSAGES]
6+#
7+# run from the directory above conform/. COMPILER is run as
8+# COMPILER -I DIR -o EXE FILE
9+# to compile FILE, finding the modules it imports, besides the
10+# library's, in DIR, into the executable EXE; an implementation run
11+# otherwise is given a script that runs it so.
12+#
13+# run/X.raz a program; run/mods holds the modules it imports
14+# run/X.expect its standard output
15+# run/X.args its arguments, one per line (optional)
16+# run/X.status its exit status (optional; 0 if missing)
17+# err/X.raz a program the report says is an error, which must not
18+# compile; err/mods holds the modules it imports
19+#
20+# What a program says on standard error, the compiler's messages
21+# included, is the implementation's own (appendix A). One that keeps
22+# its text may give MESSAGES, a directory of X.stderr and X.err, the
23+# standard error of run/X and of compiling err/X, compared when there.
24+#
25+# Programs that use reals are among the rest, until a target may leave
26+# them out.
27+
28+raz=$1
29+msg=${2:-/nonexistent}
30+out=build/conform
31+mkdir -p $out
32+pass=0
33+fail=0
34+
35+for f in conform/run/*.raz; do
36+ name=$(basename $f .raz)
37+ if ! $raz -I conform/run/mods -o $out/$name $f 2>$out/$name.cerr; then
38+ echo "FAIL $f: doesn't compile: $(cat $out/$name.cerr)"
39+ fail=$((fail + 1)); continue
40+ fi
41+ set --
42+ if [ -f conform/run/$name.args ]; then
43+ while IFS= read -r a; do set -- "$@" "$a"; done < conform/run/$name.args
44+ fi
45+ # in $(...), so that what the shell says of a signal goes nowhere
46+ status=$( { ( exec $out/$name "$@" ) > $out/$name.out 2>$out/$name.err; echo $?; } 2>/dev/null )
47+ want=0
48+ [ -f conform/run/$name.status ] && want=$(cat conform/run/$name.status)
49+ if ! cmp -s $out/$name.out conform/run/$name.expect; then
50+ echo "FAIL $f: output differs"
51+ diff $out/$name.out conform/run/$name.expect | head -5
52+ fail=$((fail + 1))
53+ elif [ $status != $want ]; then
54+ echo "FAIL $f: status $status, not $want"
55+ fail=$((fail + 1))
56+ elif [ -f $msg/$name.stderr ] && ! cmp -s $out/$name.err $msg/$name.stderr; then
57+ echo "FAIL $f: standard error differs"
58+ diff $out/$name.err $msg/$name.stderr | head -5
59+ fail=$((fail + 1))
60+ else
61+ pass=$((pass + 1))
62+ fi
63+done
64+
65+for f in conform/err/*.raz; do
66+ name=$(basename $f .raz)
67+ if $raz -I conform/err/mods -o $out/$name $f 2>$out/$name.cerr; then
68+ echo "FAIL $f: compiles"
69+ fail=$((fail + 1))
70+ elif [ -f $msg/$name.err ] && ! cmp -s $msg/$name.err $out/$name.cerr; then
71+ echo "FAIL $f: says"; diff $msg/$name.err $out/$name.cerr
72+ fail=$((fail + 1))
73+ else
74+ pass=$((pass + 1))
75+ fi
76+done
77+
78+echo "$pass passed, $fail failed"
79+[ $fail = 0 ]

conform/err/AmpBools.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AmpBools;
2+proc main*;
3+var b: BOOL; x: I64;
4+begin
5+ b := b & true;
6+end;
7+end AmpBools.

conform/err/ArrayEqReal.raz (history) added +9 -0

@@ -0,0 +1,9 @@
1+module ArrayEqReal;
2+
3+proc main*;
4+var a, b: [2]F64;
5+begin
6+ if a = b then end;
7+end;
8+
9+end ArrayEqReal.

conform/err/ArrayEqRecord.raz (history) added +9 -0

@@ -0,0 +1,9 @@
1+module ArrayEqRecord;
2+
3+proc main*;
4+var a, b: [2]record x: I64; end;
5+begin
6+ if a = b then end;
7+end;
8+
9+end ArrayEqRecord.

conform/err/ArrayEqTypes.raz (history) added +9 -0

@@ -0,0 +1,9 @@
1+module ArrayEqTypes;
2+
3+proc main*;
4+var a: [2]I64; b: [2]I32;
5+begin
6+ if a # b then end;
7+end;
8+
9+end ArrayEqTypes.

conform/err/Assign.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module Assign;
2+proc main*;
3+var a: I64; b: I32;
4+begin
5+ a := b;
6+end;
7+end Assign.

conform/err/AtAnd.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtAnd;
2+proc main*;
3+var b: BOOL; x: I64;
4+begin
5+ b := b and (x + 1);
6+end;
7+end AtAnd.

conform/err/AtArgType.raz (history) added +9 -0

@@ -0,0 +1,9 @@
1+module AtArgType;
2+proc Id(a: I64): I64;
3+begin return a; end;
4+proc main*;
5+var b: BOOL;
6+begin
7+ Id(b);
8+end;
9+end AtArgType.

conform/err/AtBinary.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtBinary;
2+proc main*;
3+var x: I64; b: BOOL;
4+begin
5+ x := (x + 2) * b;
6+end;
7+end AtBinary.

conform/err/AtCall.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtCall;
2+proc main*;
3+var x: I64;
4+begin
5+ x := x(1);
6+end;
7+end AtCall.

conform/err/AtCondition.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtCondition;
2+proc main*;
3+var x: I64;
4+begin
5+ if x + 1 then end;
6+end;
7+end AtCondition.

conform/err/AtConstFit.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtConstFit;
2+proc main*;
3+var x: I32;
4+begin
5+ x := 5 + 3000000000;
6+end;
7+end AtConstFit.

conform/err/AtConvert.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtConvert;
2+proc main*;
3+var b: BOOL; x: I64;
4+begin
5+ x := I64(b);
6+end;
7+end AtConvert.

conform/err/AtDeref.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtDeref;
2+proc main*;
3+var x, y: I64;
4+begin
5+ y := x^;
6+end;
7+end AtDeref.

conform/err/AtDivZero.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtDivZero;
2+proc main*;
3+var x: I64;
4+begin
5+ x := 7 div (3 - 3);
6+end;
7+end AtDivZero.

conform/err/AtIndex.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtIndex;
2+proc main*;
3+var a: [4]I64; b: BOOL; x: I64;
4+begin
5+ x := a[b];
6+end;
7+end AtIndex.

conform/err/AtMany.raz (history) added +9 -0

@@ -0,0 +1,9 @@
1+module AtMany;
2+proc Id(a: I64): I64;
3+begin return a; end;
4+proc main*;
5+var x: I64;
6+begin
7+ x := Id(1, 2 * 3);
8+end;
9+end AtMany.

conform/err/AtMatch.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtMatch;
2+proc main*;
3+var x: I64;
4+begin
5+ match x + 1 do end;
6+end;
7+end AtMatch.

conform/err/AtNegate.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtNegate;
2+proc main*;
3+var b: BOOL; x: I64;
4+begin
5+ x := -b;
6+end;
7+end AtNegate.

conform/err/AtNot.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtNot;
2+proc main*;
3+var s: []U8; b: BOOL;
4+begin
5+ b := not s;
6+end;
7+end AtNot.

conform/err/AtNotValue.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtNotValue;
2+proc main*;
3+var x: I64;
4+begin
5+ x := I64 + 1;
6+end;
7+end AtNotValue.

conform/err/AtPAdr.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtPAdr;
2+proc main*;
3+var p: ^I64;
4+begin
5+ p := ADR(1);
6+end;
7+end AtPAdr.

conform/err/AtPArrayLen.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module AtPArrayLen;
2+var a: [0]I64;
3+proc main*;
4+begin
5+end;
6+end AtPArrayLen.

conform/err/AtPCantAssign.raz (history) added +9 -0

@@ -0,0 +1,9 @@
1+module AtPCantAssign;
2+const k = 1;
3+proc two: (I64, I64); begin return 1, 2; end;
4+proc main*;
5+var a: I64;
6+begin
7+ a, k := two();
8+end;
9+end AtPCantAssign.

conform/err/AtPChar.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtPChar;
2+proc main*;
3+var a: I64;
4+begin
5+ a := 1 ? 2;
6+end;
7+end AtPChar.

conform/err/AtPComment.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module AtPComment;
2+proc main*;
3+begin
4+end;
5+(* never closed
6+end AtPComment.

conform/err/AtPConstExpr.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtPConstExpr;
2+proc main*;
3+var n: I64;
4+var a: [n]I64;
5+begin
6+end;
7+end AtPConstExpr.

conform/err/AtPElems.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtPElems;
2+proc main*;
3+var a: [3]I64;
4+begin
5+ a := [1, 2];
6+end;
7+end AtPElems.

conform/err/AtPEscape.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtPEscape;
2+proc main*;
3+var s: [8]U8;
4+begin
5+ s := "a\q";
6+end;
7+end AtPEscape.

conform/err/AtPInc.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtPInc;
2+proc main*;
3+var a: BOOL;
4+begin
5+ INC(a);
6+end;
7+end AtPInc.

conform/err/AtPLen.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtPLen;
2+proc main*;
3+var a: I64;
4+begin
5+ a := LEN(a);
6+end;
7+end AtPLen.

conform/err/AtPNewVar.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtPNewVar;
2+proc main*;
3+var a: I64;
4+begin
5+ NEW(a, a);
6+end;
7+end AtPNewVar.

conform/err/AtPNoResult.raz (history) added +10 -0

@@ -0,0 +1,10 @@
1+module AtPNoResult;
2+proc p;
3+begin
4+end;
5+proc main*;
6+var a: I64;
7+begin
8+ a := p() + 1;
9+end;
10+end AtPNoResult.

conform/err/AtPNotRecord.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtPNotRecord;
2+proc main*;
3+var a: I64;
4+begin
5+ a := a.f;
6+end;
7+end AtPNotRecord.

conform/err/AtPNotStmt.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtPNotStmt;
2+proc main*;
3+var a: I64;
4+begin
5+ a;
6+end;
7+end AtPNotStmt.

conform/err/AtPSetLit.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module AtPSetLit;
2+type C = (r, g, b);
3+proc main*;
4+var s: set of C;
5+begin
6+ s := {r, 1};
7+end;
8+end AtPSetLit.

conform/err/AtPStep.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtPStep;
2+proc main*;
3+var i: I64;
4+begin
5+ for i := 1 to 5 by 1 - 1 do end;
6+end;
7+end AtPStep.

conform/err/AtPtrMinus.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtPtrMinus;
2+proc main*;
3+var p: ^I64; q: ^I32; x: I64;
4+begin
5+ x := p - q;
6+end;
7+end AtPtrMinus.

conform/err/AtReturn.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module AtReturn;
2+proc main*;
3+begin
4+ return 1 + 2;
5+end;
6+end AtReturn.

conform/err/AtSliceHi.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtSliceHi;
2+proc main*;
3+var a: [4]I64; b: BOOL; s: []I64;
4+begin
5+ s := a[0..b];
6+end;
7+end AtSliceHi.

conform/err/AtSliceLo.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtSliceLo;
2+proc main*;
3+var a: [4]I64; b: BOOL; s: []I64;
4+begin
5+ s := a[b..2];
6+end;
7+end AtSliceLo.

conform/err/AtStrCmp.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module AtStrCmp;
2+proc main*;
3+var s: []U8; x: I64;
4+begin
5+ if s = x + 1 then end;
6+end;
7+end AtStrCmp.

conform/err/AtVarArg.raz (history) added +9 -0

@@ -0,0 +1,9 @@
1+module AtVarArg;
2+proc Inc(var a: I64);
3+begin a := a + 1; end;
4+proc main*;
5+var x: I64;
6+begin
7+ Inc(1 + 2);
8+end;
9+end AtVarArg.

conform/err/BadProc.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module BadProc;
2+import Str, M := Map([]U8, I64, Str.cmp, Str.eq);
3+
4+var m: M.Map;
5+
6+end BadProc.

conform/err/BarBools.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module BarBools;
2+proc main*;
3+var b: BOOL; x: I64;
4+begin
5+ b := b | true;
6+end;
7+end BarBools.

conform/err/BigI64.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module BigI64;
2+proc main*;
3+var i: I64;
4+begin
5+ i := 0FFFFFFFFFFFFFFFFH;
6+end;
7+end BigI64.

conform/err/Break.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module Break;
2+proc main*;
3+begin
4+ break;
5+end;
6+end Break.

conform/err/Cycle.raz (history) added +3 -0

@@ -0,0 +1,3 @@
1+module Cycle;
2+import CycleB;
3+end Cycle.

conform/err/DeclArrayUnknown.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module DeclArrayUnknown;
2+proc main*;
3+begin
4+ if [1] = [1] then end;
5+end;
6+end DeclArrayUnknown.

conform/err/DeclAtomicPtr.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module DeclAtomicPtr;
2+proc main*;
3+var n: I64;
4+begin
5+ n := XADD(n, 1);
6+end;
7+end DeclAtomicPtr.

conform/err/DeclEnumNames.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module DeclEnumNames;
2+type E = (
3+ a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38, a39, a40, a41, a42, a43, a44, a45, a46, a47, a48, a49, a50, a51, a52, a53, a54, a55, a56, a57, a58, a59, a60, a61, a62, a63, a64, a65, a66, a67, a68, a69, a70, a71, a72, a73, a74, a75, a76, a77, a78, a79, a80, a81, a82, a83, a84, a85, a86, a87, a88, a89, a90, a91, a92, a93, a94, a95, a96, a97, a98, a99, a100, a101, a102, a103, a104, a105, a106, a107, a108, a109, a110, a111, a112, a113, a114, a115, a116, a117, a118, a119, a120, a121, a122, a123, a124, a125, a126, a127, a128, a129, a130, a131, a132, a133, a134, a135, a136, a137, a138, a139, a140, a141, a142, a143, a144, a145, a146, a147, a148, a149, a150, a151, a152, a153, a154, a155, a156, a157, a158, a159, a160, a161, a162, a163, a164, a165, a166, a167, a168, a169, a170, a171, a172, a173, a174, a175, a176, a177, a178, a179, a180, a181, a182, a183, a184, a185, a186, a187, a188, a189, a190, a191, a192, a193, a194, a195, a196, a197, a198, a199, a200, a201, a202, a203, a204, a205, a206, a207, a208, a209, a210, a211, a212, a213, a214, a215, a216, a217, a218, a219, a220, a221, a222, a223, a224, a225, a226, a227, a228, a229, a230, a231, a232, a233, a234, a235, a236, a237, a238, a239, a240, a241, a242, a243, a244, a245, a246, a247, a248, a249, a250, a251, a252, a253, a254, a255, a256);
4+proc main*;
5+begin
6+end;
7+end DeclEnumNames.

conform/err/DeclFieldTwice.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module DeclFieldTwice;
2+type R = record a: I64; end;
3+proc main*;
4+var r: R;
5+begin
6+ r := {a: 1, a: 2};
7+end;
8+end DeclFieldTwice.

conform/err/DeclIntConst.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module DeclIntConst;
2+proc main*;
3+var a: [1.5]I64;
4+begin
5+end;
6+end DeclIntConst.

conform/err/DeclLitNoField.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module DeclLitNoField;
2+type R = record a: I64; end;
3+proc main*;
4+var r: R;
5+begin
6+ r := {b: 1};
7+end;
8+end DeclLitNoField.

conform/err/DeclNeedsFields.raz (history) added +11 -0

@@ -0,0 +1,11 @@
1+module DeclNeedsFields;
2+type Shape = variant
3+ circle(r: F64);
4+ dot;
5+end;
6+proc main*;
7+var s: Shape;
8+begin
9+ s := circle;
10+end;
11+end DeclNeedsFields.

conform/err/DeclNewAllocator.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module DeclNewAllocator;
2+proc main*;
3+var p, q: ^I64;
4+begin
5+ NEW(p, q);
6+end;
7+end DeclNewAllocator.

conform/err/DeclNoField.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module DeclNoField;
2+type R = record a: I64; end;
3+proc main*;
4+var r: R;
5+begin
6+ r.b := 1;
7+end;
8+end DeclNoField.

conform/err/DeclNotExported.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module DeclNotExported;
2+import DeclHidden;
3+proc main*;
4+var n: I64;
5+begin
6+ n := DeclHidden.hidden;
7+end;
8+end DeclNotExported.

conform/err/DeclNotType.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module DeclNotType;
2+proc main*;
3+var n: I64;
4+var a: n;
5+begin
6+end;
7+end DeclNotType.

conform/err/DeclSetLitType.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module DeclSetLitType;
2+type C = (r, g);
3+proc main*;
4+var n: I64;
5+begin
6+ n := {r};
7+end;
8+end DeclSetLitType.

conform/err/DeclSetNames.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module DeclSetNames;
2+type C = (r, g);
3+proc main*;
4+var s: set of C;
5+begin
6+ s := {} + {1};
7+end;
8+end DeclSetNames.

conform/err/DeclSetType.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module DeclSetType;
2+proc main*;
3+var s: set of I64;
4+begin
5+end;
6+end DeclSetType.

conform/err/DeclSetUnknown.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module DeclSetUnknown;
2+proc main*;
3+begin
4+ if {} = {} then end;
5+end;
6+end DeclSetUnknown.

conform/err/DeferBreak.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module DeferBreak;
2+proc f;
3+begin
4+ while true do
5+ defer break;
6+ end;
7+end;
8+end DeferBreak.

conform/err/DeferDefer.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module DeferDefer;
2+proc f;
3+begin
4+ defer defer f;
5+end;
6+end DeferDefer.

conform/err/DeferReturn.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module DeferReturn;
2+proc f: I64;
3+begin
4+ defer return 1;
5+ return 0;
6+end;
7+end DeferReturn.

conform/err/ErrOrder.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ErrOrder;
2+const A: ERROR = "a"; B: ERROR = "b";
3+proc main*;
4+begin
5+ if A < B then end;
6+end;
7+end ErrOrder.

conform/err/FirstUseLate.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module FirstUseLate;
2+import L := List(Later);
3+
4+var l: L.List; (* made here, before Later is declared *)
5+
6+type Later = I64;
7+
8+end FirstUseLate.

conform/err/GenBoolOp.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenBoolOp;
2+
3+proc main*;
4+var b: BOOL;
5+begin
6+ b := b + b;
7+end;
8+end GenBoolOp.

conform/err/GenConstOverflow.raz (history) added +14 -0

@@ -0,0 +1,14 @@
1+module GenConstOverflow;
2+(* An untyped constant doesn't wrap *)
3+const
4+ Big = 9223372036854775807;
5+ Over = Big + 1;
6+ Twice = 4611686018427387904 * 2;
7+ Under = -Big - 2;
8+ Fine = U8(250) + 10;
9+
10+proc main*;
11+begin
12+end;
13+
14+end GenConstOverflow.

conform/err/GenConvertString.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenConvertString;
2+
3+proc main*;
4+var x: I64;
5+begin
6+ x := I64("a");
7+end;
8+end GenConvertString.

conform/err/GenConvertType.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenConvertType;
2+
3+proc main*;
4+var x: I64;
5+begin
6+ x := I64(I64);
7+end;
8+end GenConvertType.

conform/err/GenDivOverflow.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenDivOverflow;
2+
3+proc main*;
4+var x: I64;
5+begin
6+ x := (-9223372036854775807 - 1) div (0 - 1);
7+end;
8+end GenDivOverflow.

conform/err/GenDotsRecord.raz (history) added +9 -0

@@ -0,0 +1,9 @@
1+module GenDotsRecord;
2+import C;
3+type R = record a, b: I64; end;
4+proc main*;
5+var r: R;
6+begin
7+ C.printf("%d", r);
8+end;
9+end GenDotsRecord.

conform/err/GenEnumOp.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenEnumOp;
2+type C = (red, green);
3+proc main*;
4+var c: C;
5+begin
6+ c := c + c;
7+end;
8+end GenEnumOp.

conform/err/GenErrorString.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module GenErrorString;
2+const E: ERROR = 1;
3+proc main*;
4+begin
5+
6+end;
7+end GenErrorString.

conform/err/GenIntReal.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenIntReal;
2+
3+proc main*;
4+var x: I64; y: F64;
5+begin
6+ y := x + y;
7+end;
8+end GenIntReal.

conform/err/GenIntTypes.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenIntTypes;
2+
3+proc main*;
4+var a: I32; b: I64;
5+begin
6+ b := a + b;
7+end;
8+end GenIntTypes.

conform/err/GenNotIndexable.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenNotIndexable;
2+
3+proc main*;
4+var x: I64;
5+begin
6+ x := x[0];
7+end;
8+end GenNotIndexable.

conform/err/GenNotVariable.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module GenNotVariable;
2+proc P(var a: I64); begin end;
3+proc main*;
4+begin
5+ P(1);
6+end;
7+end GenNotVariable.

conform/err/GenPosition.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenPosition;
2+type C = (red, green);
3+proc main*;
4+var c: C;
5+begin
6+ c := C(5);
7+end;
8+end GenPosition.

conform/err/GenPtrOp.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenPtrOp;
2+
3+proc main*;
4+var p: ^I64; b: BOOL;
5+begin
6+ b := p + p;
7+end;
8+end GenPtrOp.

conform/err/GenRealOp.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenRealOp;
2+
3+proc main*;
4+var x: F64;
5+begin
6+ x := x mod 2.0;
7+end;
8+end GenRealOp.

conform/err/GenReturnNone.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module GenReturnNone;
2+proc P(): I64; begin return; end;
3+proc main*;
4+begin
5+ P();
6+end;
7+end GenReturnNone.

conform/err/GenReturnNothing.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module GenReturnNothing;
2+proc P; begin return 1; end;
3+proc main*;
4+begin
5+ P();
6+end;
7+end GenReturnNothing.

conform/err/GenSetOp.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenSetOp;
2+type C = (red, green); CS = set of C;
3+proc main*;
4+var a: CS; b: BOOL;
5+begin
6+ b := a < a;
7+end;
8+end GenSetOp.

conform/err/GenSingleValue.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenSingleValue;
2+type R = record a, b: I64; end;
3+proc main*;
4+var r: R; x: I64;
5+begin
6+ x := r + 1;
7+end;
8+end GenSingleValue.

conform/err/GenSlash.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenSlash;
2+
3+proc main*;
4+var x: I64;
5+begin
6+ x := 6 / 3;
7+end;
8+end GenSlash.

conform/err/GenSlashVar.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenSlashVar;
2+
3+proc main*;
4+var x, y: I64;
5+begin
6+ x := x / y;
7+end;
8+end GenSlashVar.

conform/err/GenStringAs.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenStringAs;
2+
3+proc main*;
4+var x: I64;
5+begin
6+ x := "a";
7+end;
8+end GenStringAs.

conform/err/GenStringOperand.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenStringOperand;
2+
3+proc main*;
4+var x: I64;
5+begin
6+ x := "a" + 1;
7+end;
8+end GenStringOperand.

conform/err/GenTooFew.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenTooFew;
2+proc Id(a: I64): I64; begin return a; end;
3+proc main*;
4+var x: I64;
5+begin
6+ x := Id();
7+end;
8+end GenTooFew.

conform/err/GenTooFewValue.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenTooFewValue;
2+type F = proc(a: I64);
3+proc main*;
4+var f: F;
5+begin
6+ f();
7+end;
8+end GenTooFewValue.

conform/err/GenTooManyValue.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenTooManyValue;
2+type F = proc(a: I64);
3+proc main*;
4+var f: F;
5+begin
6+ f(1, 2);
7+end;
8+end GenTooManyValue.

conform/err/GenVarExact.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenVarExact;
2+proc P(var a: I64); begin end;
3+proc main*;
4+var x: I32;
5+begin
6+ P(x);
7+end;
8+end GenVarExact.

conform/err/GenVolCompare.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenVolCompare;
2+
3+proc main*;
4+var p: ^VOLATILE [4]U8; b: BOOL;
5+begin
6+ b := p^ = "a";
7+end;
8+end GenVolCompare.

conform/err/GenVolCopy.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenVolCopy;
2+type R = record a, b: I64; end;
3+proc main*;
4+var p: ^VOLATILE R; r: R;
5+begin
6+ r := p^;
7+end;
8+end GenVolCopy.

conform/err/GenVolSlice.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenVolSlice;
2+
3+proc main*;
4+var p: ^VOLATILE [4]I64; s: []I64;
5+begin
6+ s := p^;
7+end;
8+end GenVolSlice.

conform/err/GenVolVar.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module GenVolVar;
2+proc P(var a: I64); begin end;
3+proc main*;
4+var p: ^VOLATILE I64;
5+begin
6+ P(p^);
7+end;
8+end GenVolVar.

conform/err/Match.raz (history) added +11 -0

@@ -0,0 +1,11 @@
1+module Match;
2+type S = variant a; b; c; end;
3+proc main*;
4+var s: S;
5+begin
6+ match s of
7+ | a: s := b;
8+ | b:
9+ end;
10+end;
11+end Match.

conform/err/Mixed.raz (history) added +9 -0

@@ -0,0 +1,9 @@
1+module Mixed;
2+
3+proc main*;
4+var x: F32; y: F64;
5+begin
6+ y := x + y;
7+end;
8+
9+end Mixed.

conform/err/NegU64.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module NegU64;
2+proc main*;
3+var u: U64;
4+begin
5+ u := -1;
6+end;
7+end NegU64.

conform/err/NoArgs.raz (history) added +3 -0

@@ -0,0 +1,3 @@
1+module NoArgs;
2+import List;
3+end NoArgs.

conform/err/NotGeneric.raz (history) added +9 -0

@@ -0,0 +1,9 @@
1+module NotGeneric;
2+import S := Str(I64);
3+
4+proc f(a, b: []U8): I64;
5+begin
6+ return S.cmp(a, b);
7+end;
8+
9+end NotGeneric.

conform/err/NotInt.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module NotInt;
2+proc main*;
3+var b: BOOL; x: I64;
4+begin
5+ x := not x;
6+end;
7+end NotInt.

conform/err/NoteBuiltin.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module NoteBuiltin;
2+proc main*;
3+var x, y: I64;
4+begin
5+ x := len(y);
6+end;
7+end NoteBuiltin.

conform/err/NoteExport.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module NoteExport;
2+import Out;
3+proc main*;
4+var x, y: I64;
5+begin
6+ Out.Int(x);
7+end;
8+end NoteExport.

conform/err/NoteField.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module NoteField;
2+type P = record count: I64; end;
3+proc main*;
4+var p: P;
5+begin
6+ p.cuont := 1;
7+end;
8+end NoteField.

conform/err/NoteImport.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module NoteImport;
2+proc main*;
3+var x, y: I64;
4+begin
5+ Fmt.print(x);
6+end;
7+end NoteImport.

conform/err/NoteLocal.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module NoteLocal;
2+proc main*;
3+var x, y, count: I64;
4+begin
5+
6+ cuont := 1;
7+end;
8+end NoteLocal.

conform/err/OrInts.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module OrInts;
2+proc main*;
3+var b: BOOL; x: I64;
4+begin
5+ x := x or 1;
6+end;
7+end OrInts.

conform/err/PackedAddress.raz (history) added +24 -0

@@ -0,0 +1,24 @@
1+module PackedAddress;
2+(* A field of a packed record may be misaligned: it has no address,
3+ and no volatile access *)
4+type
5+ Header = packed record kind: U8; len: U32; tag: U8; vals: [2]U16; end;
6+
7+proc put(var n: U32);
8+begin
9+ n := 1;
10+end;
11+
12+proc main*;
13+var h: Header; p: ^U32; q: ^VOLATILE Header; k: ^U8; s: []U16;
14+begin
15+ p := ADR(h.len);
16+ put(h.len);
17+ s := h.vals[0..1];
18+ q := ADR(h);
19+ q^.len := 2;
20+ k := ADR(h.tag);
21+ h.len := 3;
22+end;
23+
24+end PackedAddress.

conform/err/PassOnTypes.raz (history) added +19 -0

@@ -0,0 +1,19 @@
1+module PassOnTypes;
2+
3+proc two(n: I64): (I64, BOOL);
4+begin
5+ return n, n = 0;
6+end;
7+
8+proc swapped(n: I64): (BOOL, I64);
9+begin
10+ return two(n);
11+end;
12+
13+proc main*;
14+var b: BOOL; i: I64;
15+begin
16+ b, i := swapped(1);
17+end;
18+
19+end PassOnTypes.

conform/err/PtrArray.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module PtrArray;
2+proc main*;
3+var a: [4]I64; p: ^[4]I64;
4+begin
5+ p := ADR(a);
6+ p[1] := 0;
7+end;
8+end PtrArray.

conform/err/Recover.raz (history) added +40 -0

@@ -0,0 +1,40 @@
1+module Recover;
2+
3+import Out;
4+
5+type
6+ P = record a: I64; b: Foo; end;
7+ Q = record a: I64; end;
8+
9+var g: Bar;
10+ h: I64;
11+
12+proc f(x: I64): I64;
13+var b: BOOL;
14+begin
15+ b := x;
16+ x := y + 1;
17+ x := y * 2;
18+ if x = 1 then
19+ x := (x + 2) * b;
20+ Out.int(z);
21+ end;
22+ return x + true;
23+end f;
24+
25+proc g2(): Q;
26+var q: Q;
27+begin
28+ q.c := 1;
29+ h := g;
30+ Out.str("hi")
31+ return q;
32+end g2;
33+
34+proc main*();
35+begin
36+ Out.int(f(1));
37+ Out.int(nope(2));
38+end main;
39+
40+end Recover.

conform/err/Resync.raz (history) added +35 -0

@@ -0,0 +1,35 @@
1+module Resync;
2+
3+import Out;
4+
5+proc a(x: I64);
6+begin
7+ if x = 1 then
8+ x := 2;
9+ Out.int(x);
10+end a;
11+
12+proc b(x: I64);
13+begin
14+ while x > 0 do x := x - 1 end;
15+ x := ) + 2;
16+ match x
17+ | 1: x := true;
18+ end;
19+end b;
20+
21+proc c(x: I64);
22+begin
23+ x := 1 +;
24+
25+proc d(x: I64);
26+begin
27+ x := false;
28+end d;
29+
30+proc main*();
31+begin
32+ a(1); b(2); c(3); d(4);
33+end main;
34+
35+end Resync.

conform/err/ScanBigDec.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanBigDec;
2+proc main*;
3+var x: I64;
4+begin
5+ x := 9223372036854775808;
6+end;
7+end ScanBigDec.

conform/err/ScanBigHex.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanBigHex;
2+proc main*;
3+var x: U64;
4+begin
5+ x := 10000000000000000H;
6+end;
7+end ScanBigHex.

conform/err/ScanCharEmpty.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanCharEmpty;
2+proc main*;
3+var c: U8;
4+begin
5+ c := '';
6+end;
7+end ScanCharEmpty.

conform/err/ScanCharOpen.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanCharOpen;
2+proc main*;
3+var c: U8;
4+begin
5+ c := 'ab';
6+end;
7+end ScanCharOpen.

conform/err/ScanCodePoint.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanCodePoint;
2+proc main*;
3+var s: [4]U8;
4+begin
5+ s := "\u{110000}";
6+end;
7+end ScanCodePoint.

conform/err/ScanComment.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module ScanComment;
2+proc main*;
3+begin
4+ (* never closed
5+end;
6+end ScanComment.

conform/err/ScanExponent.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanExponent;
2+proc main*;
3+var x: F64;
4+begin
5+ x := 1.5E+;
6+end;
7+end ScanExponent.

conform/err/ScanHexChar.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanHexChar;
2+proc main*;
3+var c: U8;
4+begin
5+ c := '\x41';
6+end;
7+end ScanHexChar.

conform/err/ScanHexDigits.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanHexDigits;
2+proc main*;
3+var s: [4]U8;
4+begin
5+ s := "\xZ1";
6+end;
7+end ScanHexDigits.

conform/err/ScanHexH.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanHexH;
2+proc main*;
3+var x: I64;
4+begin
5+ x := 12A;
6+end;
7+end ScanHexH.

conform/err/ScanMain.raz (history) added +5 -0

@@ -0,0 +1,5 @@
1+module ScanMain;
2+proc main*(_n: I64);
3+begin
4+end;
5+end ScanMain.

conform/err/ScanName.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module ScanName;
2+proc main*;
3+begin
4+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
5+end;
6+end ScanName.

conform/err/ScanNameDigit.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanNameDigit;
2+proc main*;
3+var x: I64;
4+begin
5+ x := 12abc;
6+end;
7+end ScanNameDigit.

conform/err/ScanNul.raz (history) added

Binary file; the patch has it.

conform/err/ScanRealBig.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanRealBig;
2+proc main*;
3+var x: F64;
4+begin
5+ x := 1.8E308;
6+end;
7+end ScanRealBig.

conform/err/ScanRealHex.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanRealHex;
2+proc main*;
3+var x: F64;
4+begin
5+ x := 1A.5;
6+end;
7+end ScanRealHex.

conform/err/ScanStringOpen.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanStringOpen;
2+proc main*;
3+var s: [4]U8;
4+begin
5+ s := "abc;
6+end;
7+end ScanStringOpen.

conform/err/ScanTwice.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module ScanTwice;
2+proc main*;
3+var x: I64;
4+ x: I64;
5+begin
6+
7+end;
8+end ScanTwice.

conform/err/ScanUBad.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanUBad;
2+proc main*;
3+var s: [4]U8;
4+begin
5+ s := "\u{41";
6+end;
7+end ScanUBad.

conform/err/ScanUBig.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanUBig;
2+proc main*;
3+var s: [4]U8;
4+begin
5+ s := "\u{1234567}";
6+end;
7+end ScanUBig.

conform/err/ScanUBrace.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanUBrace;
2+proc main*;
3+var s: [4]U8;
4+begin
5+ s := "\u0041";
6+end;
7+end ScanUBrace.

conform/err/ScanUtf8.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module ScanUtf8;
2+proc main*;
3+var s: [4]U8;
4+begin
5+ s := "ÿ";
6+end;
7+end ScanUtf8.

conform/err/SlipAnd.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module SlipAnd;
2+proc main*;
3+var x, y: I64;
4+begin
5+ if (x = 1) && (y = 2) then x := 2; end;
6+end;
7+end SlipAnd.

conform/err/SlipAssign.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module SlipAssign;
2+proc main*;
3+var x, y: I64;
4+begin
5+ x = 1;
6+end;
7+end SlipAssign.

conform/err/SlipBrace.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module SlipBrace;
2+proc main*;
3+var x, y: I64;
4+begin
5+ if x = 1 { x := 2 }
6+end;
7+end SlipBrace.

conform/err/SlipDo.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module SlipDo;
2+proc main*;
3+var x, y: I64;
4+begin
5+ while x < 3 { x := x + 1 }
6+end;
7+end SlipDo.

conform/err/SlipElif.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module SlipElif;
2+proc main*;
3+var x, y: I64;
4+begin
5+ if x = 1 then x := 2; elif x = 3 then x := 4; end;
6+end;
7+end SlipElif.

conform/err/SlipEql.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module SlipEql;
2+proc main*;
3+var x, y: I64;
4+begin
5+ if x == 1 then x := 2; end;
6+end;
7+end SlipEql.

conform/err/SlipMany.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module SlipMany;
2+proc main*;
3+var x, y: I64;
4+begin
5+ if x != 1 && z then x := y; end;
6+end;
7+end SlipMany.

conform/err/SlipNeq.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module SlipNeq;
2+proc main*;
3+var x, y: I64;
4+begin
5+ if x != 1 then x := 2; end;
6+end;
7+end SlipNeq.

conform/err/SlipNot.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module SlipNot;
2+proc main*;
3+var x, y: I64;
4+begin
5+ if ! (x = 1) then x := 2; end;
6+end;
7+end SlipNot.

conform/err/SlipOr.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module SlipOr;
2+proc main*;
3+var x, y: I64;
4+begin
5+ if (x = 1) || (y = 2) then x := 2; end;
6+end;
7+end SlipOr.

conform/err/StmtArgKind.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module StmtArgKind;
2+import Mem, L := List(Mem.Page);
3+
4+var l: L.List;
5+
6+end StmtArgKind.

conform/err/StmtAssignConst.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module StmtAssignConst;
2+const k = 1;
3+proc main*;
4+begin
5+ k := 2;
6+end;
7+end StmtAssignConst.

conform/err/StmtAssignValue.raz (history) added +9 -0

@@ -0,0 +1,9 @@
1+module StmtAssignValue;
2+type R = record a: I64; end;
3+proc f(): R; var r: R; begin return r; end;
4+proc main*;
5+var r: R;
6+begin
7+ r, f().a := f(), f().a;
8+end;
9+end StmtAssignValue.

conform/err/StmtCaseName.raz (history) added +14 -0

@@ -0,0 +1,14 @@
1+module StmtCaseName;
2+type S = variant
3+ circle(r: F64);
4+ rect(w, h: F64);
5+ dot;
6+end;
7+proc main*;
8+var s: S;
9+begin
10+ match s of
11+ | 5:
12+ end;
13+end;
14+end StmtCaseName.

conform/err/StmtCaseTwice.raz (history) added +16 -0

@@ -0,0 +1,16 @@
1+module StmtCaseTwice;
2+type S = variant
3+ circle(r: F64);
4+ rect(w, h: F64);
5+ dot;
6+end;
7+proc main*;
8+var s: S;
9+begin
10+ match s of
11+ | dot:
12+ | dot:
13+ | else:
14+ end;
15+end;
16+end StmtCaseTwice.

conform/err/StmtDot.raz (history) added +2 -0

@@ -0,0 +1,2 @@
1+module StmtDot;
2+end StmtDot;

conform/err/StmtElseLast.raz (history) added +15 -0

@@ -0,0 +1,15 @@
1+module StmtElseLast;
2+type S = variant
3+ circle(r: F64);
4+ rect(w, h: F64);
5+ dot;
6+end;
7+proc main*;
8+var s: S;
9+begin
10+ match s of
11+ | else:
12+ | dot:
13+ end;
14+end;
15+end StmtElseLast.

conform/err/StmtEnd.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module StmtEnd;
2+proc main*;
3+var a: I64;
4+begin
5+ a := 1;
6+)
7+end;
8+end StmtEnd.

conform/err/StmtEndName.raz (history) added +2 -0

@@ -0,0 +1,2 @@
1+module StmtEndName;
2+end Other.

conform/err/StmtErrType.raz (history) added +3 -0

@@ -0,0 +1,3 @@
1+module StmtErrType;
2+const k: I64 = "a";
3+end StmtErrType.

conform/err/StmtFewFields.raz (history) added +15 -0

@@ -0,0 +1,15 @@
1+module StmtFewFields;
2+type S = variant
3+ circle(r: F64);
4+ rect(w, h: F64);
5+ dot;
6+end;
7+proc main*;
8+var s: S;
9+begin
10+ match s of
11+ | rect(w):
12+ | else:
13+ end;
14+end;
15+end StmtFewFields.

conform/err/StmtFieldName.raz (history) added +15 -0

@@ -0,0 +1,15 @@
1+module StmtFieldName;
2+type S = variant
3+ circle(r: F64);
4+ rect(w, h: F64);
5+ dot;
6+end;
7+proc main*;
8+var s: S;
9+begin
10+ match s of
11+ | circle(5):
12+ | else:
13+ end;
14+end;
15+end StmtFieldName.

conform/err/StmtForName.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module StmtForName;
2+const k = 1;
3+proc main*;
4+begin
5+ for k := 1 to 2 do end;
6+end;
7+end StmtForName.

conform/err/StmtForType.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module StmtForType;
2+proc main*;
3+var b: BOOL;
4+begin
5+ for b := 1 to 2 do end;
6+end;
7+end StmtForType.

conform/err/StmtForwardTwice.raz (history) added +4 -0

@@ -0,0 +1,4 @@
1+module StmtForwardTwice;
2+proc f; forward;
3+proc f; forward;
4+end StmtForwardTwice.

conform/err/StmtFwdPtr.raz (history) added +3 -0

@@ -0,0 +1,3 @@
1+module StmtFwdPtr;
2+type P = ^Missing;
3+end StmtFwdPtr.

conform/err/StmtImportName.raz (history) added +3 -0

@@ -0,0 +1,3 @@
1+module StmtImportName;
2+import 5;
3+end StmtImportName.

conform/err/StmtManyFields.raz (history) added +15 -0

@@ -0,0 +1,15 @@
1+module StmtManyFields;
2+type S = variant
3+ circle(r: F64);
4+ rect(w, h: F64);
5+ dot;
6+end;
7+proc main*;
8+var s: S;
9+begin
10+ match s of
11+ | circle(r, x):
12+ | else:
13+ end;
14+end;
15+end StmtManyFields.

conform/err/StmtManyTypeArgs.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module StmtManyTypeArgs;
2+import L := List(I64, I64);
3+
4+var l: L.List;
5+
6+end StmtManyTypeArgs.

conform/err/StmtNeedProc.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module StmtNeedProc;
2+import Str, M := Map([]U8, I64, I64, Str.eq);
3+
4+var m: M.Map;
5+
6+end StmtNeedProc.

conform/err/StmtNeedType.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module StmtNeedType;
2+import Str, M := Map(Str.cmp, I64, Str.cmp, Str.eq);
3+
4+var m: M.Map;
5+
6+end StmtNeedType.

conform/err/StmtNest.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module StmtNest;
2+proc main*;
3+ proc inner; forward;
4+begin
5+end;
6+end StmtNest.

conform/err/StmtNeverDefined.raz (history) added +3 -0

@@ -0,0 +1,3 @@
1+module StmtNeverDefined;
2+proc f; forward;
3+end StmtNeverDefined.

conform/err/StmtNoModule.raz (history) added +3 -0

@@ -0,0 +1,3 @@
1+module StmtNoModule;
2+import Nothing;
3+end StmtNoModule.

conform/err/StmtNotCase.raz (history) added +15 -0

@@ -0,0 +1,15 @@
1+module StmtNotCase;
2+type S = variant
3+ circle(r: F64);
4+ rect(w, h: F64);
5+ dot;
6+end;
7+proc main*;
8+var s: S;
9+begin
10+ match s of
11+ | square: s := dot;
12+ | else:
13+ end;
14+end;
15+end StmtNotCase.

conform/err/StmtNotStmt.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module StmtNotStmt;
2+type R = record a: I64; end;
3+proc main*;
4+var r: R;
5+begin
6+ r.a;
7+end;
8+end StmtNotStmt.

conform/err/StmtParamName.raz (history) added +6 -0

@@ -0,0 +1,6 @@
1+module StmtParamName;
2+import L := StmtParam(I64);
3+
4+var l: L.T;
5+
6+end StmtParamName.

conform/err/StmtProcName.raz (history) added +3 -0

@@ -0,0 +1,3 @@
1+module StmtProcName;
2+proc main*; begin end mian;
3+end StmtProcName.

conform/err/StmtResults.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module StmtResults;
2+proc two: (I64, I64); begin return 1, 2; end;
3+proc main*;
4+var a, b, c: I64;
5+begin
6+ a, b, c := two();
7+end;
8+end StmtResults.

conform/err/StmtSigForward.raz (history) added +4 -0

@@ -0,0 +1,4 @@
1+module StmtSigForward;
2+proc f(a: I64); forward;
3+proc f(a: BOOL); begin end;
4+end StmtSigForward.

conform/err/StmtStatement.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module StmtStatement;
2+proc main*;
3+var a: I64;
4+begin
5+ a := 1; )
6+end;
7+end StmtStatement.

conform/err/StmtVarOrProc.raz (history) added +3 -0

@@ -0,0 +1,3 @@
1+module StmtVarOrProc;
2+extern 5;
3+end StmtVarOrProc.

conform/err/StmtWrongModule.raz (history) added +3 -0

@@ -0,0 +1,3 @@
1+module StmtWrongModule;
2+import StmtOther;
3+end StmtWrongModule.

conform/err/TildeBool.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module TildeBool;
2+proc main*;
3+var b: BOOL; x: I64;
4+begin
5+ b := ~b;
6+end;
7+end TildeBool.

conform/err/Tuple.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module Tuple;
2+proc two: (I64, I64); begin return 1, 2; end;
3+proc main*;
4+var a: I64;
5+begin
6+ a := two() + 1;
7+end;
8+end Tuple.

conform/err/TwoTypes.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module TwoTypes;
2+import A := List(I64), B := List(I32);
3+proc main*;
4+var a: A.List; b: B.List;
5+begin
6+ a := b;
7+end;
8+end TwoTypes.

conform/err/Utf.raz (history) added +3 -0

@@ -0,0 +1,3 @@
1+module Utf;
2+var é: I64;
3+end Utf.

conform/err/Volatile.raz (history) added +8 -0

@@ -0,0 +1,8 @@
1+module Volatile;
2+proc main*;
3+var x: I64; p: ^VOLATILE I64; q: ^I64;
4+begin
5+ p := ADR(x);
6+ q := p;
7+end;
8+end Volatile.

conform/err/XorBools.raz (history) added +7 -0

@@ -0,0 +1,7 @@
1+module XorBools;
2+proc main*;
3+var b: BOOL; x: I64;
4+begin
5+ b := b xor true;
6+end;
7+end XorBools.

conform/err/mods/Cycle.raz (history) added +3 -0

@@ -0,0 +1,3 @@
1+module Cycle;
2+import CycleB;
3+end Cycle.

conform/err/mods/CycleB.raz (history) added +3 -0

@@ -0,0 +1,3 @@
1+module CycleB;
2+import Cycle;
3+end CycleB.

conform/err/mods/DeclHidden.raz (history) added +4 -0

@@ -0,0 +1,4 @@
1+module DeclHidden;
2+const shown* = 1;
3+const hidden = 2;
4+end DeclHidden.

conform/err/mods/StmtOther.raz (history) added +2 -0

@@ -0,0 +1,2 @@
1+module StmtWrong;
2+end StmtWrong.

conform/err/mods/StmtParam.raz (history) added +2 -0

@@ -0,0 +1,2 @@
1+module StmtParam(5);
2+end StmtParam.

conform/run/Alloc.expect added +5 -0

@@ -0,0 +1,5 @@
1+1001000
2+1001000
3+7
4+10100
5+nil again 0

conform/run/Alloc.raz added +66 -0

@@ -0,0 +1,66 @@
1+module Alloc;
2+import Out, Mem, Arena, Heap;
3+
4+type
5+ Node = record next: ^Node; val: I64; pad: [5]I64; end;
6+ Big = record data: [1000]I64; end;
7+
8+proc build(a: ^Mem.Allocator; n: I64): ^Node;
9+var head, p: ^Node; i: I64;
10+begin
11+ head := nil;
12+ for i := 1 to n do
13+ NEW(p, a);
14+ if p = nil then return nil; end;
15+ if p^.val # 0 then Out.str("not zeroed "); end;
16+ p^.val := i;
17+ p^.pad[4] := i;
18+ p^.next := head;
19+ head := p;
20+ end;
21+ return head;
22+end;
23+
24+proc sum(p: ^Node): I64;
25+var s: I64;
26+begin
27+ s := 0;
28+ while p # nil do s := s + p^.val + p^.pad[4]; p := p^.next; end;
29+ return s;
30+end;
31+
32+proc release(a: ^Mem.Allocator; p: ^Node);
33+var next: ^Node;
34+begin
35+ while p # nil do
36+ next := p^.next;
37+ Mem.free(a, ^U8(p));
38+ p := next;
39+ end;
40+end;
41+
42+proc main*;
43+var ar: Arena.Arena; l, m: ^Node; b: ^Big; i: I64; small: ^U8; again: ^Node;
44+begin
45+ l := build(Heap.heap, 1000);
46+ Out.int(sum(l)); Out.ln;
47+ release(Heap.heap, l);
48+ m := build(Heap.heap, 1000);
49+ Out.int(sum(m)); Out.ln;
50+ NEW(b, Heap.heap);
51+ b^.data[999] := 7;
52+ Out.int(b^.data[999] + b^.data[0]); Out.ln;
53+ Mem.free(Heap.heap, ^U8(b));
54+ if not Arena.init(ADR(ar), 8192) then Out.str("no arena"); end;
55+ l := build(ADR(ar.base), 100);
56+ Out.int(sum(l)); Out.ln;
57+ l := build(ADR(ar.base), 1000);
58+ if l = nil then Out.str("nil "); end;
59+ Arena.reset(ADR(ar));
60+ NEW(again, ADR(ar.base));
61+ if again # nil then Out.str("again "); Out.int(again^.val); end;
62+ Out.ln;
63+ Arena.done(ADR(ar));
64+end;
65+
66+end Alloc.

conform/run/Args.args (history) added +3 -0

@@ -0,0 +1,3 @@
1+one
2+two words
3+é

conform/run/Args.expect (history) added +3 -0

@@ -0,0 +1,3 @@
1+one
2+two words
3+é

conform/run/Args.raz (history) added +18 -0

@@ -0,0 +1,18 @@
1+module Args;
2+import Out;
3+
4+proc main*: I64;
5+var i, n: I64; a: ^^U8; s: ^U8;
6+begin
7+ a := ARGV();
8+ for i := 1 to ARGC() - 1 do
9+ s := a[i];
10+ n := 0;
11+ while s[n] # 0 do n := n + 1; end;
12+ Out.str(s[0..n]);
13+ Out.ln;
14+ end;
15+ return ARGC();
16+end;
17+
18+end Args.

conform/run/Args.status (history) added +1 -0

@@ -0,0 +1 @@
1+4

conform/run/Arith.expect (history) added +35 -0

@@ -0,0 +1,35 @@
1+M 32
2+add 22
3+sub 12
4+mul 85
5+div -3
6+mod -1
7+divv -3
8+modv -2
9+prec 14
10+neg -85
11+u8wrap 44
12+i8wrap -128
13+u32wrap 1
14+u64>i 1
15+i64< 1
16+shl 1024
17+shr -4
18+ushr 15
19+and 8
20+or 15
21+xor 6
22+not -1
23+real 85
24+trunc -2
25+nan 0
26+rlt 1
27+u64real 18
28+bool 1
29+shortcut 1
30+global 42
31+char 65
32+utf8 233
33+hexconst 255
34+cut 44
35+sext -1

conform/run/Arith.raz (history) added +74 -0

@@ -0,0 +1,74 @@
1+module Arith;
2+import Out;
3+
4+const
5+ K = 10;
6+ M = K * 3 + 2;
7+ Big = 0FFFFFFFFFFFFFFFFH;
8+
9+var g: I64;
10+
11+proc show(s: []U8; n: I64);
12+begin
13+ Out.str(s); Out.str(" "); Out.int(n); Out.ln;
14+end;
15+
16+proc showb(s: []U8; t: BOOL);
17+begin
18+ if t then show(s, 1); else show(s, 0); end;
19+end;
20+
21+proc main*;
22+var a, b: I64; u: U8; i8: I8; w: U32; x: U64; r: F64; t: BOOL;
23+begin
24+ show("M", M);
25+ a := 17; b := 5;
26+ show("add", a + b);
27+ show("sub", a - b);
28+ show("mul", a * b);
29+ show("div", -7 div 2);
30+ show("mod", -7 mod 2);
31+ show("divv", (0 - a) div b);
32+ show("modv", (0 - a) mod b);
33+ show("prec", 2 + 3 * 4);
34+ show("neg", -a * b);
35+ u := 200;
36+ u := u + 100;
37+ show("u8wrap", I64(u));
38+ i8 := 127;
39+ i8 := i8 + 1;
40+ show("i8wrap", I64(i8));
41+ w := 0FFFFFFFFH;
42+ w := w + 2;
43+ show("u32wrap", I64(w));
44+ x := Big;
45+ showb("u64>i", x > 5);
46+ showb("i64<", -1 < 5);
47+ show("shl", 1 shl 10);
48+ show("shr", -16 shr 2);
49+ show("ushr", I64(U64(-16) shr 60));
50+ show("and", 12 & 10);
51+ show("or", 12 | 3);
52+ show("xor", 12 xor 10);
53+ show("not", ~0);
54+ r := F64(a) / 2.0;
55+ show("real", I64(r * 10.0));
56+ r := -2.75;
57+ show("trunc", I64(r));
58+ showb("nan", 0.0 / 0.0 = 0.0 / 0.0);
59+ showb("rlt", 1.5 < 2.5);
60+ show("u64real", I64(F64(x) / 1.0E18));
61+ t := (a > 3) and (b < 3);
62+ if not t then show("bool", 1); end;
63+ t := (a > 3) or (g div 0 = 1);
64+ if t then show("shortcut", 1); end;
65+ g := 42;
66+ show("global", g);
67+ show("char", 'A');
68+ show("utf8", 'é');
69+ show("hexconst", 0FFH);
70+ show("cut", I64(U8(300)));
71+ show("sext", I64(I8(U8(255))));
72+end;
73+
74+end Arith.

conform/run/ArrayEq.expect (history) added +1 -0

@@ -0,0 +1 @@
1+TFFTTFTTTTFTTFTFTFTTTTT

conform/run/ArrayEq.raz (history) added +41 -0

@@ -0,0 +1,41 @@
1+module ArrayEq;
2+import Out;
3+
4+type Colour = (red, green, blue);
5+
6+proc say(b: BOOL);
7+begin
8+ if b then Out.str("T"); else Out.str("F"); end;
9+end;
10+
11+proc main*;
12+var
13+ a, b: [4]I64; s: []I64; e: []I64;
14+ w: [3]U16; c, d: [2]Colour; f: [3]BOOL;
15+ m, n: [2]set of Colour; p, q: [2]^I64; x: I64;
16+ t: [5]U8;
17+begin
18+ a := [1, 2, 3, 4]; b := [1, 2, 3, 4];
19+ say(a = b); say(a # b);
20+ b[3] := 5;
21+ say(a = b); say(a # b);
22+ s := a[0..3];
23+ say(s = a[0..3]); say(s = a); (* of different lengths *)
24+ say(a[1..1] = e); say(e = s[0..0]); (* empty *)
25+ w := [1, 256, 65535];
26+ say(w = [U16(1), 256, 65535]); say(w[2..3] = [U16(65535)]);
27+ c := [red, blue]; d := [red, green];
28+ say(c = d); d[1] := blue; say(c = d);
29+ f := [true, false, true];
30+ say(f[0..1] = f[2..3]); say(f[0..1] = [true, false]);
31+ m := [{red}, {green, blue}]; n := m;
32+ say(m = n); n[1] := {blue}; say(m = n);
33+ p := [ADR(x), nil]; q := p;
34+ say(p = q); q[1] := ADR(x); say(p = q);
35+ t := [104, 101, 108, 108, 111];
36+ say(t = "hello"); say("hello" = t[0..5]); say("hell" = t[0..4]);
37+ say("help" # t[0..4]); say("" = t[0..0]);
38+ Out.ln;
39+end;
40+
41+end ArrayEq.

conform/run/AtExit.expect (history) added +5 -0

@@ -0,0 +1,5 @@
1+12 refused
2+main ends
3+third
4+second, which exits again
5+first

conform/run/AtExit.raz (history) added +41 -0

@@ -0,0 +1,41 @@
1+(* Rt.exit runs what Rt.atExit registered, the last first, each once,
2+ then ends the program with main's status. *)
3+module AtExit;
4+import Out, Rt;
5+
6+proc first;
7+begin
8+ Out.str("first\n");
9+end;
10+
11+proc second;
12+begin
13+ Out.str("second, which exits again\n");
14+ Rt.exit(5); (* the rest still run, once each; the status is now 5 *)
15+end;
16+
17+proc third;
18+begin
19+ Out.str("third\n");
20+end;
21+
22+proc nothing;
23+begin
24+end;
25+
26+proc main*: I64;
27+var i, full: I64;
28+begin
29+ Rt.atExit(first);
30+ Rt.atExit(second);
31+ Rt.atExit(third);
32+ full := 0;
33+ for i := 1 to 40 do
34+ if Rt.atExit(nothing) = Rt.Full then INC(full); end;
35+ end;
36+ Out.int(full); Out.str(" refused\n");
37+ Out.str("main ends\n");
38+ return 3;
39+end;
40+
41+end AtExit.

conform/run/AtExit.status (history) added +1 -0

@@ -0,0 +1 @@
1+5

conform/run/Bodies.expect (history) added +1 -0

@@ -0,0 +1 @@
1+First Second Bodies main 12

conform/run/Bodies.raz (history) added +11 -0

@@ -0,0 +1,11 @@
1+module Bodies;
2+import Out, A := First, Second;
3+
4+proc main*;
5+begin
6+ Out.str("main "); Out.int(A.count); Out.int(Second.count); Out.ln;
7+end;
8+
9+begin
10+ Out.str("Bodies ");
11+end Bodies.

conform/run/Bounds.expect (history) added +1 -0

@@ -0,0 +1 @@
1+0123
\ No newline at end of file

conform/run/Bounds.raz (history) added +13 -0

@@ -0,0 +1,13 @@
1+module Bounds;
2+import Out;
3+
4+proc main*;
5+var a: [4]I64; i: I64;
6+begin
7+ for i := 0 to 4 do
8+ a[i] := i;
9+ Out.int(a[i]);
10+ end;
11+end;
12+
13+end Bounds.

conform/run/Bounds.status (history) added +1 -0

@@ -0,0 +1 @@
1+2

conform/run/Control.expect (history) added +8 -0

@@ -0,0 +1,8 @@
1+12345
2+10 7 4 1
3+0 4 8
4+6
5+3
6+0 1 10 11 20 21
7+4
8+one two three many

conform/run/Control.raz (history) added +42 -0

@@ -0,0 +1,42 @@
1+module Control;
2+import Out;
3+
4+proc main*;
5+var i, j, n: I64; u: U8; k: I8;
6+begin
7+ for i := 1 to 5 do Out.int(i); end; Out.ln;
8+ for i := 10 to 1 by -3 do Out.int(i); Out.str(" "); end; Out.ln;
9+ for i := 0 to 10 by 4 do Out.int(i); Out.str(" "); end; Out.ln;
10+ for i := 5 to 1 do Out.str("never"); end;
11+ n := 0;
12+ for u := 250 to 255 do n := n + 1; end;
13+ Out.int(n); Out.ln;
14+ n := 0;
15+ for k := 120 to 127 by 3 do n := n + 1; end;
16+ Out.int(n); Out.ln;
17+ i := 0;
18+ while i < 3 do
19+ j := 0;
20+ while true do
21+ if j = 2 then break; end;
22+ Out.int(i * 10 + j); Out.str(" ");
23+ j := j + 1;
24+ end;
25+ i := i + 1;
26+ end;
27+ Out.ln;
28+ i := 0;
29+ repeat i := i + 1; if i = 4 then break; end; until i = 10;
30+ Out.int(i); Out.ln;
31+ for i := 1 to 4 do
32+ if i = 1 then Out.str("one");
33+ elsif i = 2 then Out.str("two");
34+ elsif i = 3 then Out.str("three");
35+ else Out.str("many");
36+ end;
37+ Out.str(" ");
38+ end;
39+ Out.ln;
40+end;
41+
42+end Control.

conform/run/Defers.expect (history) added +5 -0

@@ -0,0 +1,5 @@
1+body body done
2+()30
3+56
4+[...*][...+**]
5+0

conform/run/Defers.raz (history) added +71 -0

@@ -0,0 +1,71 @@
1+module Defers;
2+import Out;
3+
4+type Pair = record a, b: I64; end;
5+
6+var depth: I64;
7+
8+proc enter(s: []U8);
9+begin
10+ Out.str(s); INC(depth);
11+end;
12+
13+proc leave(s: []U8);
14+begin
15+ Out.str(s); DEC(depth);
16+end;
17+
18+proc real(x: F64): F64;
19+begin
20+ enter("(");
21+ defer leave(")");
22+ return x * 2.0;
23+end;
24+
25+proc pair(n: I64): Pair;
26+var p: Pair;
27+begin
28+ defer p.a := 99;
29+ p.a := n; p.b := n + 1;
30+ return p;
31+end;
32+
33+proc begin_end(i: I64);
34+var k: I64;
35+begin
36+ defer for k := 1 to i do Out.str("*"); end;
37+ if i = 1 then return; end;
38+ Out.str("+");
39+end;
40+
41+proc nested;
42+var i, j: I64;
43+begin
44+ for i := 1 to 2 do
45+ enter("[");
46+ defer leave("]");
47+ defer begin_end(i);
48+ j := 0;
49+ while true do
50+ defer Out.str(".");
51+ INC(j);
52+ if j = 3 then break; end;
53+ end;
54+ end;
55+end;
56+
57+proc main*;
58+var p: Pair;
59+begin
60+ Out.int(I64(real(1.5) * 10.0)); Out.ln;
61+ p := pair(5);
62+ Out.int(p.a); Out.int(p.b); Out.ln;
63+ nested;
64+ Out.ln;
65+ Out.int(depth); Out.ln;
66+end;
67+
68+begin
69+ defer Out.str("body done\n");
70+ Out.str("body ");
71+end Defers.

conform/run/FirstUse.expect (history) added +6 -0

@@ -0,0 +1,6 @@
1+an instance of Loud, of size 1
2+an empty list
3+in main, Ones has size 1
4+sky not red
5+rose red
6+grass -

conform/run/FirstUse.raz (history) added +34 -0

@@ -0,0 +1,34 @@
1+module FirstUse;
2+import Out, Str, Heap, Table := Map([]U8, Colour, Str.hash, Str.eq),
3+ Ints := List(I64), More := List(I64), Never := Loud(I64), Ones := Loud(U8);
4+
5+type Colour = (red, green, blue);
6+
7+var names: Table.Map; (* Table is made here, after Colour *)
8+
9+proc show(k: []U8);
10+var c: Colour; found: BOOL;
11+begin
12+ c, found := Table.get(ADR(names), k);
13+ Out.str(k);
14+ if not found then Out.str(" -"); elsif c = red then Out.str(" red"); else Out.str(" not red"); end;
15+ Out.ln;
16+end;
17+
18+(* Ones is first used in a procedure, and made before its code *)
19+proc main*;
20+var a: Ints.List; b: More.List;
21+begin
22+ a := b; (* two imports, one instance *)
23+ if a.head = nil then Out.str("an empty list\n"); end;
24+ Out.str("in main, Ones has size "); Out.int(Ones.size); Out.ln;
25+ show("sky");
26+ show("rose");
27+ show("grass");
28+end;
29+
30+begin
31+ Table.init(ADR(names), Heap.heap);
32+ Table.put(ADR(names), "rose", red);
33+ Table.put(ADR(names), "sky", blue);
34+end FirstUse.

conform/run/Generic.expect (history) added +6 -0

@@ -0,0 +1,6 @@
1+8 2 true
2+8 1
3+abtrue
4+[] false
5+157 152 -1
6+{ BEEF } x18446744073709551615

conform/run/Generic.raz (history) added +30 -0

@@ -0,0 +1,30 @@
1+module Generic;
2+import Fmt, Buf, Str, Heap, Stack, Ints := List(I64), More := List(I64), Strs := List([]U8);
3+
4+proc twice(x: I64): I64; begin return x * 2; end;
5+
6+proc main*;
7+var l: Strs.List; v: I64; s: []U8; ok: BOOL; b: Buf.Buf; n: ^Ints.Node;
8+begin
9+ ok := Ints.push(ADR(Stack.s), 7);
10+ ok := More.push(ADR(Stack.s), 8);
11+ Fmt.print("{} {} {}\n", [Fmt.int(Stack.top()), Fmt.int(Stack.s.len), Fmt.bool(ok)]);
12+ n := Stack.s.head;
13+ v, ok := Ints.pop(ADR(Stack.s));
14+ Fmt.print("{} {}\n", [Fmt.int(v), Fmt.int(Stack.s.len)]);
15+ Strs.init(ADR(l), Heap.heap);
16+ ok := Strs.push(ADR(l), "b");
17+ ok := Strs.push(ADR(l), "a");
18+ s, ok := Strs.pop(ADR(l));
19+ Fmt.print("{}{}{}\n", [Fmt.str(s), Fmt.str(l.head^.val), Fmt.bool(ok)]);
20+ s, ok := Strs.pop(ADR(l));
21+ s, ok := Strs.pop(ADR(l));
22+ Fmt.print("[{}] {}\n", [Fmt.str(s), Fmt.bool(ok)]);
23+ Buf.init(ADR(b), Heap.heap);
24+ for v := 1 to 40 do Fmt.write(ADR(b), "{},", [Fmt.int(v * v)]); end;
25+ Fmt.print("{} {} {}\n", [Fmt.int(b.len), Fmt.int(Str.find(Buf.bytes(ADR(b)), "1600")), Fmt.int(Str.cmp("ab", "b"))]);
26+ Buf.done(ADR(b));
27+ Fmt.print("{{ {} }} {}{}\n", [Fmt.hex(48879), Fmt.char('x'), Fmt.uint(0FFFFFFFFFFFFFFFFH)]);
28+end;
29+
30+end Generic.

conform/run/HeapCheck.expect added +10 -0

@@ -0,0 +1,10 @@
1+nil
2+nil
3+nil
4+nil
5+nil
6+nil
7+a block
8+aligned
9+a block
10+freeing it again

conform/run/HeapCheck.raz added +34 -0

@@ -0,0 +1,34 @@
1+(* The heap refuses bad sizes and alignments, and stops the program
2+ when a block is freed twice. *)
3+module HeapCheck;
4+import Out, Heap, Mem;
5+
6+proc show(p: ^U8);
7+begin
8+ if p = nil then Out.str("nil\n"); else Out.str("a block\n"); end;
9+end;
10+
11+proc main*;
12+var p, q: ^U8;
13+begin
14+ show(Mem.alloc(Heap.heap, -1, 8));
15+ show(Mem.alloc(Heap.heap, 1 shl 60, 8));
16+ show(Mem.alloc(Heap.heap, 7FFFFFFFFFFFFFF0H, 8));
17+ show(Mem.alloc(Heap.heap, 10, 3));
18+ show(Mem.alloc(Heap.heap, 10, 0));
19+ show(Mem.alloc(Heap.heap, 10, 8192));
20+ p := Mem.alloc(Heap.heap, 10, 64);
21+ show(p);
22+ if I64(p) mod 64 = 0 then Out.str("aligned\n"); end;
23+ Mem.free(Heap.heap, p);
24+ q := Mem.alloc(Heap.heap, 100000, 8);
25+ show(q);
26+ Mem.free(Heap.heap, q);
27+ p := Mem.alloc(Heap.heap, 24, 8);
28+ Mem.free(Heap.heap, p);
29+ Out.str("freeing it again\n");
30+ Mem.free(Heap.heap, p);
31+ Out.str("not reached\n");
32+end;
33+
34+end HeapCheck.

conform/run/HeapCheck.status added +1 -0

@@ -0,0 +1 @@
1+2

conform/run/HeapStray.expect added +1 -0

@@ -0,0 +1 @@
1+freeing a stray pointer

conform/run/HeapStray.raz added +14 -0

@@ -0,0 +1,14 @@
1+(* Freeing what the heap never gave out stops the program. *)
2+module HeapStray;
3+import Out, Heap, Mem;
4+
5+var a: [4]I64;
6+
7+proc main*;
8+begin
9+ Out.str("freeing a stray pointer\n");
10+ Mem.free(Heap.heap, ^U8(ADR(a[2])));
11+ Out.str("not reached\n");
12+end;
13+
14+end HeapStray.

conform/run/HeapStray.status added +1 -0

@@ -0,0 +1 @@
1+2

conform/run/Kinds.expect (history) added +8 -0

@@ -0,0 +1,8 @@
1+023 2 0 in out sub sup ne eq
2+13 10 1 2 lt green other
3+120 0 2
4+47mid
5+24
6+50 LLCBA
7+-1 LLDBA
8+3
\ No newline at end of file

conform/run/Kinds.raz (history) added +95 -0

@@ -0,0 +1,95 @@
1+module Kinds;
2+import Out;
3+
4+type
5+ Color* = (red, green, blue, black);
6+ Colors* = set of Color;
7+ Cell = record ch: U8; attr: U8; fg: Color; end;
8+ Point = record x, y: I64; name: []U8; end;
9+ Line = record a, b: Point; end;
10+
11+var log: [8]U8; nlog: I64;
12+
13+proc note(c: U8);
14+begin
15+ log[nlog] := c;
16+ INC(nlog);
17+end;
18+
19+proc show(s: Colors);
20+var c: Color;
21+begin
22+ for c := red to black do
23+ if c in s then Out.int(I64(c)); end;
24+ end;
25+ Out.str(" ");
26+end;
27+
28+proc name(c: Color): []U8;
29+begin
30+ match c of
31+ | red: return "red";
32+ | green: return "green";
33+ | else: return "other";
34+ end;
35+end;
36+
37+proc deferred(n: I64): I64;
38+var i: I64;
39+begin
40+ defer note('A');
41+ defer note('B');
42+ for i := 1 to 3 do
43+ defer note('L');
44+ if i = 2 then break; end;
45+ end;
46+ if n > 0 then
47+ defer note('C');
48+ return n * 10;
49+ end;
50+ note('D');
51+ return -1;
52+end;
53+
54+proc mid(a, b: Point): Point;
55+begin
56+ return {x: (a.x + b.x) div 2, y: (a.y + b.y) div 2, name: "mid"};
57+end;
58+
59+proc main*;
60+var s, t: Colors; c: Color; cell: Cell; p: Point; l: Line; r: I64; one: Colors;
61+begin
62+ s := {red, blue};
63+ t := {blue, black};
64+ show(s + t); show(s * t); show(s - t); show({});
65+ if red in s then Out.str("in "); end;
66+ if not (green in s) then Out.str("out "); end;
67+ if s * t <= t then Out.str("sub "); end;
68+ if s + t >= s then Out.str("sup "); end;
69+ if s # t then Out.str("ne "); end;
70+ if s = {blue, red} then Out.str("eq"); end;
71+ Out.ln;
72+ c := green;
73+ one := {c, black};
74+ show(one);
75+ Out.int(I64(U8(one))); Out.str(" ");
76+ Out.int(SIZE(Colors)); Out.str(" ");
77+ Out.int(I64(Color(2))); Out.str(" ");
78+ if c < blue then Out.str("lt "); end;
79+ Out.str(name(c)); Out.str(" "); Out.str(name(black)); Out.ln;
80+ cell := {ch: 'x', fg: blue};
81+ Out.int(I64(cell.ch)); Out.str(" "); Out.int(I64(cell.attr)); Out.str(" "); Out.int(I64(cell.fg)); Out.ln;
82+ p := mid({x: 2, y: 4}, {y: 10, x: 6});
83+ Out.int(p.x); Out.int(p.y); Out.str(p.name); Out.ln;
84+ l := {a: {x: 1, y: 2}, b: p};
85+ Out.int(l.a.y); Out.int(l.b.x); Out.ln;
86+ r := deferred(5);
87+ Out.int(r); Out.str(" "); Out.str(log[0..nlog]); Out.ln;
88+ nlog := 0;
89+ r := deferred(0);
90+ Out.int(r); Out.str(" "); Out.str(log[0..nlog]); Out.ln;
91+ Out.int(I64(Color(I64(c) + 2)));
92+ c := Color(nlog);
93+end;
94+
95+end Kinds.

conform/run/Kinds.status (history) added +1 -0

@@ -0,0 +1 @@
1+2

conform/run/MapRemove.expect added +2 -0

@@ -0,0 +1,2 @@
1+341 entries, 341 of them, summing 6658308
2+walked 341, summing 6658308

conform/run/MapRemove.raz added +56 -0

@@ -0,0 +1,56 @@
1+(* Map's remove and next, against an array that holds the same: keys
2+ hashed into runs of eight, so that removing moves entries back,
3+ around the end of the slots too. *)
4+module MapRemove;
5+import Fmt, Heap, Rt, Ints := Map(I64, I64, near, same);
6+
7+const N = 500;
8+
9+proc near(k: I64): U64;
10+begin
11+ return U64(k div 8 * 977);
12+end;
13+
14+proc same(a, b: I64): BOOL;
15+begin
16+ return a = b;
17+end;
18+
19+proc main*;
20+var
21+ m: Ints.Map; want: [N]I64; i, k, v, n, sum, seed: I64;
22+ found, _ok: BOOL;
23+begin
24+ Ints.init(ADR(m), Heap.heap);
25+ seed := 1;
26+ for i := 1 to 20000 do
27+ seed := (seed * 1103515245 + 12345) & 7FFFFFFFH;
28+ k := seed mod N;
29+ if seed div N mod 3 = 0 then
30+ if Ints.remove(ADR(m), k) # (want[k] # 0) then Rt.stop("remove: wrong answer"); end;
31+ want[k] := 0;
32+ else
33+ _ok := Ints.put(ADR(m), k, i);
34+ want[k] := i;
35+ end;
36+ end;
37+ for k := 0 to N - 1 do
38+ v, found := Ints.get(ADR(m), k);
39+ if (found # (want[k] # 0)) or (v # want[k]) then Rt.stop("get: not what was put"); end;
40+ if found then INC(n); INC(sum, v); end;
41+ end;
42+ if Ints.remove(ADR(m), N) then Rt.stop("remove: a key never put"); end;
43+ Fmt.print("{} entries, {} of them, summing {}\n", [Fmt.int(m.len), Fmt.int(n), Fmt.int(sum)]);
44+ (* the walk sees each entry once *)
45+ n := 0; sum := 0;
46+ i, k, v := Ints.next(ADR(m), 0);
47+ while i >= 0 do
48+ if want[k] # v then Rt.stop("next: not what was put"); end;
49+ want[k] := 0;
50+ INC(n); INC(sum, v);
51+ i, k, v := Ints.next(ADR(m), i);
52+ end;
53+ Fmt.print("walked {}, summing {}\n", [Fmt.int(n), Fmt.int(sum)]);
54+end;
55+
56+end MapRemove.

conform/run/PackedFields.expect (history) added +2 -0

@@ -0,0 +1,2 @@
1+14 7 DEADBEF0 -5 9
2+240

conform/run/PackedFields.raz (history) added +23 -0

@@ -0,0 +1,23 @@
1+module PackedFields;
2+(* A packed record's fields are read and written wherever they sit *)
3+import Out;
4+
5+type
6+ Header = packed record kind: U8; len: U32; big: I64; tag: U8; end;
7+
8+proc main*;
9+var h, g: Header; b: ^U8;
10+begin
11+ h.kind := 7; h.len := 0DEADBEEFH; h.big := -5; h.tag := 9;
12+ INC(h.len);
13+ g := h;
14+ Out.int(SIZE(Header)); Out.str(" ");
15+ Out.int(I64(g.kind)); Out.str(" ");
16+ Out.hex(U64(g.len), 8); Out.str(" ");
17+ Out.int(g.big); Out.str(" ");
18+ Out.int(I64(g.tag)); Out.ln;
19+ b := ADR(g.kind);
20+ Out.int(I64(b[1])); Out.ln;
21+end;
22+
23+end PackedFields.

conform/run/PassOn.expect (history) added +5 -0

@@ -0,0 +1,5 @@
1+42
2+2 whole
3+2 part
4+3 part
5+65 66 67 -65

conform/run/PassOn.raz (history) added +42 -0

@@ -0,0 +1,42 @@
1+module PassOn;
2+import Out;
3+
4+type Pair = record a, b: I64; end;
5+
6+proc one(n: I64): I64;
7+begin
8+ return n * 2;
9+end;
10+
11+proc two(n: I64): (I64, BOOL);
12+begin
13+ return n div 7, n mod 7 = 0;
14+end;
15+
16+proc three(n: I64): (U8, Pair, I64);
17+begin
18+ return U8(n), {a: n + 1, b: n + 2}, -n;
19+end;
20+
21+(* each passes on what the one below returns *)
22+proc one1(n: I64): I64; begin return one(n); end;
23+proc one2(n: I64): I64; begin return one1(n); end;
24+proc two1(n: I64): (I64, BOOL); begin return two(n + 1); end;
25+proc two2(n: I64): (I64, BOOL); begin return two1(n + 1); end;
26+proc three1(n: I64): (U8, Pair, I64); begin return three(n); end;
27+proc three2(n: I64): (U8, Pair, I64); begin return three1(n); end;
28+
29+proc main*;
30+var i, q: I64; z: BOOL; c: U8; p: Pair;
31+begin
32+ Out.int(one2(21)); Out.ln;
33+ for i := 0 to 2 do
34+ q, z := two2(i * 5 + 12);
35+ Out.int(q); Out.str(" "); if z then Out.str("whole"); else Out.str("part"); end; Out.ln;
36+ end;
37+ c, p, i := three2(65);
38+ Out.int(I64(c)); Out.str(" "); Out.int(p.a); Out.str(" "); Out.int(p.b);
39+ Out.str(" "); Out.int(i); Out.ln;
40+end;
41+
42+end PassOn.

conform/run/Pow2.expect (history) added +2 -0

@@ -0,0 +1,2 @@
1+-7 div 2 = -3, -7 mod 2 = -1
2+0 wrong

conform/run/Pow2.raz (history) added +68 -0

@@ -0,0 +1,68 @@
1+(* div, mod and * by a power of two are shifts; they must agree with
2+ idiv and imul, which a divisor in a variable still gets. *)
3+module Pow2;
4+import Out;
5+
6+var bad: I64;
7+
8+proc check(s: []U8; x, got, want: I64);
9+begin
10+ if got # want then
11+ Out.str(s); Out.str(" "); Out.int(x); Out.str(": ");
12+ Out.int(got); Out.str(" # "); Out.int(want); Out.ln;
13+ bad := bad + 1;
14+ end;
15+end;
16+
17+proc i64s(x: I64);
18+var d1, d2, d8, d62: I64;
19+begin
20+ d1 := 1; d2 := 2; d8 := 8; d62 := 4000000000000000H;
21+ check("div 1", x, x div 1, x div d1);
22+ check("mod 1", x, x mod 1, x mod d1);
23+ check("div 2", x, x div 2, x div d2);
24+ check("mod 2", x, x mod 2, x mod d2);
25+ check("div 8", x, x div 8, x div d8);
26+ check("mod 8", x, x mod 8, x mod d8);
27+ check("div 2^62", x, x div 4000000000000000H, x div d62);
28+ check("mod 2^62", x, x mod 4000000000000000H, x mod d62);
29+ check("* 8", x, x * 8, x * d8);
30+ check("div -8", x, x div (0 - 8), x div (0 - d8));
31+end;
32+
33+proc u64s(x: U64);
34+var d2, d8, d62: U64;
35+begin
36+ d2 := 2; d8 := 8; d62 := 4000000000000000H;
37+ check("u div 2", I64(x), I64(x div 2), I64(x div d2));
38+ check("u mod 2", I64(x), I64(x mod 2), I64(x mod d2));
39+ check("u div 8", I64(x), I64(x div 8), I64(x div d8));
40+ check("u mod 8", I64(x), I64(x mod 8), I64(x mod d8));
41+ check("u div 2^62", I64(x), I64(x div 4000000000000000H), I64(x div d62));
42+ check("u mod 2^62", I64(x), I64(x mod 4000000000000000H), I64(x mod d62));
43+end;
44+
45+proc main*;
46+var i: I64; b: I8; d: I8; w: U8; dw: U8;
47+begin
48+ for i := -300 to 300 do i64s(i); u64s(U64(i)); end;
49+ i64s(07FFFFFFFFFFFFFFFH); i64s(-07FFFFFFFFFFFFFFFH - 1);
50+ i64s(4000000000000001H); i64s(-4000000000000001H);
51+ u64s(0FFFFFFFFFFFFFFFFH); u64s(8000000000000000H);
52+ d := 8; dw := 8;
53+ for i := -128 to 127 do
54+ b := I8(i); w := U8(i + 128);
55+ check("i8 div 8", i, I64(b div 8), I64(b div d));
56+ check("i8 mod 8", i, I64(b mod 8), I64(b mod d));
57+ check("i8 * 8", i, I64(b * 8), I64(b * d));
58+ check("u8 div 8", i, I64(w div 8), I64(w div dw));
59+ check("u8 mod 8", i, I64(w mod 8), I64(w mod dw));
60+ check("u8 * 8", i, I64(w * 8), I64(w * dw));
61+ end;
62+ i := -7;
63+ Out.str("-7 div 2 = "); Out.int(i div 2);
64+ Out.str(", -7 mod 2 = "); Out.int(i mod 2); Out.ln;
65+ Out.int(bad); Out.str(" wrong\n");
66+end;
67+
68+end Pow2.

conform/run/Procs.expect (history) added +13 -0

@@ -0,0 +1,13 @@
1+parity ok
2+21
3+10 11 21
4+22
5+7 12
6+same
7+nil
8+3245
9+2432902008176640000
10+95 5
11+0
12+16 0
13+15

conform/run/Procs.raz (history) added +117 -0

@@ -0,0 +1,117 @@
1+module Procs;
2+import Out;
3+
4+type
5+ Pair = record x, y: I64; end;
6+ Op = proc(a, b: I64): I64;
7+ Big = record a: [10]I64; end;
8+
9+proc even(n: I64): BOOL; forward;
10+
11+proc odd(n: I64): BOOL;
12+begin
13+ if n = 0 then return false; end;
14+ return even(n - 1);
15+end;
16+
17+proc even(n: I64): BOOL;
18+begin
19+ if n = 0 then return true; end;
20+ return odd(n - 1);
21+end;
22+
23+proc swap(var a, b: I64);
24+var t: I64;
25+begin
26+ t := a; a := b; b := t;
27+end;
28+
29+proc bump(p: Pair): Pair;
30+begin
31+ p.x := p.x + 1;
32+ p.y := p.y + 1;
33+ return p;
34+end;
35+
36+proc add(a, b: I64): I64; begin return a + b; end;
37+proc mul(a, b: I64): I64; begin return a * b; end;
38+
39+proc apply(f: Op; a, b: I64): I64;
40+begin
41+ return f(a, b);
42+end;
43+
44+proc many(a, b, c, d, e, f, g, h: I64; x: F64; i: I64; y: F64): I64;
45+begin
46+ return a + 2 * b + 3 * c + 4 * d + 5 * e + 6 * f + 7 * g + 8 * h + I64(x) * 100 + 9 * i + I64(y) * 1000;
47+end;
48+
49+proc fact(n: I64): I64;
50+begin
51+ if n <= 1 then return 1; end;
52+ return n * fact(n - 1);
53+end;
54+
55+proc fill(var b: Big; v: I64);
56+var i: I64;
57+begin
58+ for i := 0 to 9 do b.a[i] := v + i; end;
59+end;
60+
61+proc total(b: Big): I64;
62+var i, s: I64;
63+begin
64+ s := 0;
65+ for i := 0 to 9 do s := s + b.a[i]; end;
66+ b.a[0] := 1000;
67+ return s;
68+end;
69+
70+proc noresult(n: I64): I64;
71+begin
72+ if n > 100 then return 1; end;
73+end;
74+
75+proc mk(n: I64): Big;
76+var b: Big;
77+begin
78+ fill(b, n);
79+ return b;
80+end;
81+
82+proc mkzero(n: I64): Big;
83+begin
84+end;
85+
86+proc fsum(a, b: F64): F64;
87+begin
88+ return a + b;
89+end;
90+
91+proc main*: I64;
92+var a, b: I64; p, q: Pair; f: Op; bg: Big;
93+begin
94+ if even(10) and odd(7) and not even(3) then Out.str("parity ok"); Out.ln; end;
95+ a := 1; b := 2;
96+ swap(a, b);
97+ Out.int(a); Out.int(b); Out.ln;
98+ p.x := 10; p.y := 20;
99+ q := bump(p);
100+ Out.int(p.x); Out.str(" "); Out.int(q.x); Out.str(" "); Out.int(q.y); Out.ln;
101+ Out.int(bump(bump(p)).y); Out.ln;
102+ f := add;
103+ Out.int(apply(f, 3, 4)); Out.str(" "); Out.int(apply(mul, 3, 4)); Out.ln;
104+ if f = add then Out.str("same"); Out.ln; end;
105+ f := nil;
106+ if f = nil then Out.str("nil"); Out.ln; end;
107+ Out.int(many(1, 1, 1, 1, 1, 1, 1, 1, 2.5, 1, 3.9)); Out.ln;
108+ Out.int(fact(20)); Out.ln;
109+ fill(bg, 5);
110+ Out.int(total(bg)); Out.str(" "); Out.int(bg.a[0]); Out.ln;
111+ Out.int(noresult(5)); Out.ln;
112+ Out.int(mk(7).a[9]); Out.str(" "); Out.int(mkzero(1).a[3]); Out.ln;
113+ Out.int(I64(fsum(1.25, 2.5) * 4.0)); Out.ln;
114+ return 7;
115+end;
116+
117+end Procs.

conform/run/Procs.status (history) added +1 -0

@@ -0,0 +1 @@
1+7

conform/run/RealRead.expect (history) added +12 -0

@@ -0,0 +1,12 @@
1+7506AC5B262CA1FF
2+3FB999999999999A
3+FFFFFFFFFFFFF
4+1
5+1
6+0
7+0
8+7FEFFFFFFFFFFFFF
9+4340000000000000
10+4340000000000002
11+3FF0000000000000
12+3FF0000000000001

conform/run/RealRead.raz (history) added +34 -0

@@ -0,0 +1,34 @@
1+(* Real literals read to the nearest F64, ties to the even one: their
2+ bits, for numbers a reader of decimals easily gets one off. *)
3+module RealRead;
4+import Fmt;
5+
6+proc bits(x: F64): U64;
7+var p: ^U64;
8+begin
9+ p := ^U64(ADR(x));
10+ return p^;
11+end;
12+
13+proc show(x: F64);
14+begin
15+ Fmt.print("{}\n", [Fmt.hex(bits(x))]);
16+end;
17+
18+proc main*;
19+begin
20+ show(5.319372648326541E255);
21+ show(0.1);
22+ show(2.2250738585072011E-308); (* just below the least normal *)
23+ show(4.9E-324); (* the least F64 *)
24+ show(2.4703282292062328E-324); (* just over half of it: up *)
25+ show(2.4703282292062327E-324); (* just under: 0 *)
26+ show(1.0E-400);
27+ show(1.7976931348623157E308); (* the largest *)
28+ show(9007199254740993.0); (* 2^53 + 1, a tie: down to even *)
29+ show(9007199254740995.0); (* 2^53 + 3, a tie: up to even *)
30+ show(1.00000000000000011102230246251565404236316680908203125); (* 1 + 2^-53, a tie *)
31+ show(1.00000000000000011102230246251565404236316680908203126);
32+end;
33+
34+end RealRead.

conform/run/SliceBounds.expect (history) added +1 -0

@@ -0,0 +1 @@
1+6 3 0
\ No newline at end of file

conform/run/SliceBounds.raz (history) added +15 -0

@@ -0,0 +1,15 @@
1+module SliceBounds;
2+(* A slice must have 0 <= lo <= hi <= the length *)
3+import Out;
4+
5+proc main*;
6+var a: [8]I64; s: []I64; lo: I64;
7+begin
8+ s := a[0..8];
9+ for lo := 0 to 9 by 3 do
10+ Out.int(LEN(s[lo..6]));
11+ Out.str(" ");
12+ end;
13+end;
14+
15+end SliceBounds.

conform/run/SliceBounds.status (history) added +1 -0

@@ -0,0 +1 @@
1+2

conform/run/SliceIndex.expect (history) added +1 -0

@@ -0,0 +1 @@
1+0123
\ No newline at end of file

conform/run/SliceIndex.raz (history) added +15 -0

@@ -0,0 +1,15 @@
1+module SliceIndex;
2+(* An index checked against a slice's length, which is in memory *)
3+import Out;
4+
5+proc main*;
6+var a: [8]I64; s: []I64; i: I64;
7+begin
8+ s := a[2..5];
9+ for i := 0 to 3 do
10+ Out.int(i);
11+ s[i] := i;
12+ end;
13+end;
14+
15+end SliceIndex.

conform/run/SliceIndex.status (history) added +1 -0

@@ -0,0 +1 @@
1+2

conform/run/SlicePtrBackwards.expect (history) added +1 -0

@@ -0,0 +1 @@
1+2 0
\ No newline at end of file

conform/run/SlicePtrBackwards.raz (history) added +16 -0

@@ -0,0 +1,16 @@
1+module SlicePtrBackwards;
2+(* A slice of a pointer isn't checked against a length, but it can't
3+ run backwards *)
4+import Out;
5+
6+proc main*;
7+var a: [8]U8; p: ^U8; hi: I64;
8+begin
9+ p := ADR(a[0]);
10+ for hi := 4 to 0 by -2 do
11+ Out.int(LEN(p[2..hi]));
12+ Out.str(" ");
13+ end;
14+end;
15+
16+end SlicePtrBackwards.

conform/run/SlicePtrBackwards.status (history) added +1 -0

@@ -0,0 +1 @@
1+2

conform/run/Sorted.expect (history) added +4 -0

@@ -0,0 +1,4 @@
1+Bo 7
2+Di 23
3+Ana 41
4+Cy 90

conform/run/Sorted.raz (history) added +51 -0

@@ -0,0 +1,51 @@
1+(* Sort: slices in many orders and of every length up to 40 come out
2+ in order, holding what they held; and a sort by a record's field. *)
3+module Sorted;
4+import Fmt, Rt, Ints := Sort(I64, below), ByAge := Sort(Person, younger);
5+
6+type Person = record name: []U8; age: I64; end;
7+
8+proc below(a, b: I64): BOOL;
9+begin
10+ return a < b;
11+end;
12+
13+proc younger(a, b: Person): BOOL;
14+begin
15+ return a.age < b.age;
16+end;
17+
18+proc main*;
19+var
20+ a: [40]I64; count: [10]I64; n, i, kind, seed: I64;
21+ people: [4]Person;
22+begin
23+ seed := 7;
24+ for n := 0 to 40 do
25+ for kind := 0 to 3 do
26+ for i := 0 to 9 do count[i] := 0; end;
27+ for i := 0 to n - 1 do
28+ seed := (seed * 1103515245 + 12345) & 7FFFFFFFH;
29+ if kind = 0 then a[i] := seed mod 10; (* at random, with repeats *)
30+ elsif kind = 1 then a[i] := i mod 10; (* rising *)
31+ elsif kind = 2 then a[i] := 9 - i mod 10; (* falling *)
32+ else a[i] := 5; (* all equal *)
33+ end;
34+ INC(count[a[i]]);
35+ end;
36+ Ints.sort(a[0..n]);
37+ for i := 0 to n - 1 do
38+ if (i > 0) and (a[i - 1] > a[i]) then Rt.stop("out of order"); end;
39+ DEC(count[a[i]]);
40+ end;
41+ for i := 0 to 9 do
42+ if count[i] # 0 then Rt.stop("not what it held"); end;
43+ end;
44+ end;
45+ end;
46+ people := [{name: "Ana", age: 41}, {name: "Bo", age: 7}, {name: "Cy", age: 90}, {name: "Di", age: 23}];
47+ ByAge.sort(people);
48+ for i := 0 to 3 do Fmt.print("{} {}\n", [Fmt.str(people[i].name), Fmt.int(people[i].age)]); end;
49+end;
50+
51+end Sorted.

conform/run/Strings.expect (history) added +4 -0

@@ -0,0 +1,4 @@
1+eq ne lit arr buf 0 5 2
2+6 100 0
3+threeone
4+é☺A

conform/run/Strings.raz (history) added +39 -0

@@ -0,0 +1,39 @@
1+module Strings;
2+import Out;
3+
4+const greeting = "hello";
5+
6+var buf: [8]U8;
7+
8+proc count(xs: []I64): I64;
9+var i, s: I64;
10+begin
11+ s := 0;
12+ for i := 0 to LEN(xs) - 1 do s := s + xs[i]; end;
13+ return s;
14+end;
15+
16+proc main*;
17+var a: []U8; b: [5]U8; c: [3]I64; d: [][]U8;
18+begin
19+ a := "hello";
20+ if a = greeting then Out.str("eq "); end;
21+ if a # "help" then Out.str("ne "); end;
22+ if "abc" = "abc" then Out.str("lit "); end;
23+ b := "hello";
24+ if b = a then Out.str("arr "); end;
25+ buf := "hi";
26+ if buf[0..2] = "hi" then Out.str("buf "); end;
27+ Out.int(I64(buf[5])); Out.str(" ");
28+ Out.int(LEN(greeting)); Out.str(" ");
29+ Out.int(LEN(a[1..3])); Out.ln;
30+ c := [1, 2, 3];
31+ Out.int(count(c)); Out.str(" ");
32+ Out.int(count([10, 20, 30, 40])); Out.str(" ");
33+ Out.int(count([])); Out.ln;
34+ d := ["one", "two", "three"];
35+ Out.str(d[2]); Out.str(d[0]); Out.ln;
36+ Out.str("é\u{263A}\x41\n");
37+end;
38+
39+end Strings.

conform/run/mods/First.raz (history) added +14 -0

@@ -0,0 +1,14 @@
1+module First;
2+import Out;
3+
4+var count*: I64;
5+
6+proc main*;
7+begin
8+ Out.str("First.main must not run");
9+end;
10+
11+begin
12+ count := 1;
13+ Out.str("First ");
14+end First.

conform/run/mods/Loud.raz (history) added +10 -0

@@ -0,0 +1,10 @@
1+(* A generic module with a body, which runs once for each instance *)
2+module Loud(T);
3+import Out;
4+
5+var size*: I64;
6+
7+begin
8+ size := SIZE(T);
9+ Out.str("an instance of Loud, of size "); Out.int(size); Out.ln;
10+end Loud.

conform/run/mods/Second.raz (history) added +11 -0

@@ -0,0 +1,11 @@
1+module Second;
2+import Out, First;
3+
4+var count*: I64;
5+
6+begin
7+ count := First.count + 1;
8+ Out.str("Second ");
9+ if count = 2 then return; end;
10+ Out.str("not reached");
11+end Second.

conform/run/mods/Stack.raz (history) added +13 -0

@@ -0,0 +1,13 @@
1+module Stack;
2+import Ints := List(I64), Heap;
3+
4+var s*: Ints.List;
5+
6+proc top*(): I64;
7+begin
8+ return s.head^.val;
9+end;
10+
11+begin
12+ Ints.init(ADR(s), Heap.heap);
13+end Stack.

test/check.sh (history) modified +11 -4

@@ -1,6 +1,8 @@
11 #!/bin/sh
2-# Compiles and runs every example and test, and compares what each
3-# prints, and its exit status, with what is expected:
2+# Runs the conformance suite, conform/check.sh, with this compiler's
3+# messages for it in test/msg; then compiles and runs every example
4+# and this compiler's own tests, and compares what each prints, and its
5+# exit status, with what is expected:
46 # X.raz the program
57 # X.expect its standard output
68 # X.args its arguments, one per line (optional)
@@ -22,6 +24,11 @@
2224 pass=0
2325 fail=0
2426
27+conform/check.sh $raz test/msg > $out/conform.out
28+grep -v '^[0-9]* passed' $out/conform.out
29+set -- $(tail -1 $out/conform.out)
30+pass=$1; fail=$3
31+
2532 run() { # run dir name
2633 dir=$1; name=$2
2734 flags=
@@ -69,7 +76,7 @@
6976 if cmp -s $out/run.out ${f%.raz}.expect && [ $status = $want ]; then pass=$((pass + 1))
7077 else echo "FAIL raz run $f: status $status, not $want, or output differs"; fail=$((fail + 1)); fi
7178 }
72-runs test/run/Args.raz 4 one 'two words' é
79+runs conform/run/Args.raz 4 one 'two words' é
7380 runs test/libc/Through.raz 2
7481 for f in test/err/*.raz; do
7582 name=$(basename $f .raz)
@@ -163,7 +170,7 @@
163170 else pass=$((pass + 1)); fi
164171 }
165172 if ./raz -Werror -o $out/Mutate tools/Mutate.raz 2>$out/Mutate.cerr; then
166- for f in examples/*.raz test/run/*.raz lib/Opt.raz; do
173+ for f in examples/*.raz conform/run/*.raz test/run/*.raz lib/Opt.raz; do
167174 $raz -I $(dirname $f)/mods -o $out/mutant $f 2>/dev/null || continue
168175 for seed in ${FUZZ_SEEDS:-1 2 3}; do fuzz $f $seed; done
169176 done

test/err/AmpBools.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/AmpBools.raz:5:10: error: "&" needs integers, found BOOL
2- 5 | b := b & true;
3- | ^
4-help: BOOLs take and
5-raz: 1 error

test/err/AmpBools.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AmpBools;
2-proc main*;
3-var b: BOOL; x: I64;
4-begin
5- b := b & true;
6-end;
7-end AmpBools.

test/err/ArrayEqReal.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/ArrayEqReal.raz:6:8: error: can't compare arrays of reals with "="
2- 6 | if a = b then end;
3- | ^^^^^
4-help: -0.0 = 0.0 and a NaN equals nothing, though their bytes say otherwise: write a loop
5-raz: 1 error

test/err/ArrayEqReal.raz deleted +0 -9

@@ -1,9 +0,0 @@
1-module ArrayEqReal;
2-
3-proc main*;
4-var a, b: [2]F64;
5-begin
6- if a = b then end;
7-end;
8-
9-end ArrayEqReal.

test/err/ArrayEqRecord.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/ArrayEqRecord.raz:6:8: error: can't compare arrays of record with "="
2- 6 | if a = b then end;
3- | ^^^^^
4-help: write a loop
5-raz: 1 error

test/err/ArrayEqRecord.raz deleted +0 -9

@@ -1,9 +0,0 @@
1-module ArrayEqRecord;
2-
3-proc main*;
4-var a, b: [2]record x: I64; end;
5-begin
6- if a = b then end;
7-end;
8-
9-end ArrayEqRecord.

test/err/ArrayEqTypes.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ArrayEqTypes.raz:6:8: error: can't compare an array of I64 with one of I32
2- 6 | if a # b then end;
3- | ^^^^^
4-raz: 1 error

test/err/ArrayEqTypes.raz deleted +0 -9

@@ -1,9 +0,0 @@
1-module ArrayEqTypes;
2-
3-proc main*;
4-var a: [2]I64; b: [2]I32;
5-begin
6- if a # b then end;
7-end;
8-
9-end ArrayEqTypes.

test/err/Assign.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/Assign.raz:5:10: error: can't use I32 as I64
2- 5 | a := b;
3- | ^
4-raz: 1 error

test/err/Assign.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module Assign;
2-proc main*;
3-var a: I64; b: I32;
4-begin
5- a := b;
6-end;
7-end Assign.

test/err/AtAnd.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/AtAnd.raz:5:16: error: "and" needs BOOLs, found I64
2- 5 | b := b and (x + 1);
3- | ^^^^^^^
4-help: the bits of integers take &
5-raz: 1 error

test/err/AtAnd.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtAnd;
2-proc main*;
3-var b: BOOL; x: I64;
4-begin
5- b := b and (x + 1);
6-end;
7-end AtAnd.

test/err/AtArgType.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtArgType.raz:7:8: error: can't use BOOL as I64
2- 7 | Id(b);
3- | ^
4-raz: 1 error

test/err/AtArgType.raz deleted +0 -9

@@ -1,9 +0,0 @@
1-module AtArgType;
2-proc Id(a: I64): I64;
3-begin return a; end;
4-proc main*;
5-var b: BOOL;
6-begin
7- Id(b);
8-end;
9-end AtArgType.

test/err/AtBinary.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtBinary.raz:5:10: error: I64 and BOOL are different types
2- 5 | x := (x + 2) * b;
3- | ^^^^^^^^^^^
4-raz: 1 error

test/err/AtBinary.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtBinary;
2-proc main*;
3-var x: I64; b: BOOL;
4-begin
5- x := (x + 2) * b;
6-end;
7-end AtBinary.

test/err/AtCall.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtCall.raz:5:10: error: expected a procedure, found I64
2- 5 | x := x(1);
3- | ^
4-raz: 1 error

test/err/AtCall.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtCall;
2-proc main*;
3-var x: I64;
4-begin
5- x := x(1);
6-end;
7-end AtCall.

test/err/AtCondition.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtCondition.raz:5:8: error: a condition is a BOOL, found I64
2- 5 | if x + 1 then end;
3- | ^^^^^
4-raz: 1 error

test/err/AtCondition.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtCondition;
2-proc main*;
3-var x: I64;
4-begin
5- if x + 1 then end;
6-end;
7-end AtCondition.

test/err/AtConstFit.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtConstFit.raz:5:10: error: 3000000005 doesn't fit I32
2- 5 | x := 5 + 3000000000;
3- | ^^^^^^^^^^^^^^
4-raz: 1 error

test/err/AtConstFit.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtConstFit;
2-proc main*;
3-var x: I32;
4-begin
5- x := 5 + 3000000000;
6-end;
7-end AtConstFit.

test/err/AtConvert.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtConvert.raz:5:14: error: can't convert BOOL to I64
2- 5 | x := I64(b);
3- | ^
4-raz: 1 error

test/err/AtConvert.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtConvert;
2-proc main*;
3-var b: BOOL; x: I64;
4-begin
5- x := I64(b);
6-end;
7-end AtConvert.

test/err/AtDeref.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtDeref.raz:5:10: error: expected a pointer, found I64
2- 5 | y := x^;
3- | ^
4-raz: 1 error

test/err/AtDeref.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtDeref;
2-proc main*;
3-var x, y: I64;
4-begin
5- y := x^;
6-end;
7-end AtDeref.

test/err/AtDivZero.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtDivZero.raz:5:10: error: division by zero
2- 5 | x := 7 div (3 - 3);
3- | ^^^^^^^^^^^^^
4-raz: 1 error

test/err/AtDivZero.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtDivZero;
2-proc main*;
3-var x: I64;
4-begin
5- x := 7 div (3 - 3);
6-end;
7-end AtDivZero.

test/err/AtIndex.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtIndex.raz:5:12: error: an index is an integer, found BOOL
2- 5 | x := a[b];
3- | ^
4-raz: 1 error

test/err/AtIndex.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtIndex;
2-proc main*;
3-var a: [4]I64; b: BOOL; x: I64;
4-begin
5- x := a[b];
6-end;
7-end AtIndex.

test/err/AtMany.err deleted +0 -7

@@ -1,7 +0,0 @@
1-test/err/AtMany.raz:7:16: error: too many arguments: Id takes 1
2- 7 | x := Id(1, 2 * 3);
3- | ^^^^^
4-test/err/AtMany.raz:2:6: note: the signature is here
5- 2 | proc Id(a: I64): I64;
6- | ^^
7-raz: 1 error

test/err/AtMany.raz deleted +0 -9

@@ -1,9 +0,0 @@
1-module AtMany;
2-proc Id(a: I64): I64;
3-begin return a; end;
4-proc main*;
5-var x: I64;
6-begin
7- x := Id(1, 2 * 3);
8-end;
9-end AtMany.

test/err/AtMatch.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtMatch.raz:5:11: error: match needs a variant or an enumeration, found I64
2- 5 | match x + 1 do end;
3- | ^^^^^
4-raz: 1 error

test/err/AtMatch.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtMatch;
2-proc main*;
3-var x: I64;
4-begin
5- match x + 1 do end;
6-end;
7-end AtMatch.

test/err/AtNegate.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtNegate.raz:5:10: error: can't negate BOOL
2- 5 | x := -b;
3- | ^^
4-raz: 1 error

test/err/AtNegate.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtNegate;
2-proc main*;
3-var b: BOOL; x: I64;
4-begin
5- x := -b;
6-end;
7-end AtNegate.

test/err/AtNot.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtNot.raz:5:14: error: "not" needs a BOOL, found []U8
2- 5 | b := not s;
3- | ^
4-raz: 1 error

test/err/AtNot.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtNot;
2-proc main*;
3-var s: []U8; b: BOOL;
4-begin
5- b := not s;
6-end;
7-end AtNot.

test/err/AtNotValue.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtNotValue.raz:5:10: error: I64 is a type, not a value
2- 5 | x := I64 + 1;
3- | ^^^
4-raz: 1 error

test/err/AtNotValue.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtNotValue;
2-proc main*;
3-var x: I64;
4-begin
5- x := I64 + 1;
6-end;
7-end AtNotValue.

test/err/AtPAdr.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPAdr.raz:5:14: error: ADR needs a variable
2- 5 | p := ADR(1);
3- | ^
4-raz: 1 error

test/err/AtPAdr.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtPAdr;
2-proc main*;
3-var p: ^I64;
4-begin
5- p := ADR(1);
6-end;
7-end AtPAdr.

test/err/AtPArrayLen.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPArrayLen.raz:2:9: error: an array's length is from 1 to 2^40, found 0
2- 2 | var a: [0]I64;
3- | ^
4-raz: 1 error

test/err/AtPArrayLen.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module AtPArrayLen;
2-var a: [0]I64;
3-proc main*;
4-begin
5-end;
6-end AtPArrayLen.

test/err/AtPCantAssign.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPCantAssign.raz:7:8: error: can't assign to k
2- 7 | a, k := two();
3- | ^
4-raz: 1 error

test/err/AtPCantAssign.raz deleted +0 -9

@@ -1,9 +0,0 @@
1-module AtPCantAssign;
2-const k = 1;
3-proc two: (I64, I64); begin return 1, 2; end;
4-proc main*;
5-var a: I64;
6-begin
7- a, k := two();
8-end;
9-end AtPCantAssign.

test/err/AtPChar.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPChar.raz:5:12: error: unexpected character "?"
2- 5 | a := 1 ? 2;
3- | ^
4-raz: 1 error

test/err/AtPChar.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtPChar;
2-proc main*;
3-var a: I64;
4-begin
5- a := 1 ? 2;
6-end;
7-end AtPChar.

test/err/AtPComment.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPComment.raz:5:1: error: comment not closed
2- 5 | (* never closed
3- | ^^
4-raz: 1 error

test/err/AtPComment.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module AtPComment;
2-proc main*;
3-begin
4-end;
5-(* never closed
6-end AtPComment.

test/err/AtPConstExpr.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPConstExpr.raz:4:9: error: expected a constant
2- 4 | var a: [n]I64;
3- | ^
4-raz: 1 error

test/err/AtPConstExpr.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtPConstExpr;
2-proc main*;
3-var n: I64;
4-var a: [n]I64;
5-begin
6-end;
7-end AtPConstExpr.

test/err/AtPElems.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPElems.raz:5:10: error: expected 3 elements, found 2
2- 5 | a := [1, 2];
3- | ^^^^^^
4-raz: 1 error

test/err/AtPElems.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtPElems;
2-proc main*;
3-var a: [3]I64;
4-begin
5- a := [1, 2];
6-end;
7-end AtPElems.

test/err/AtPEscape.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPEscape.raz:5:12: error: unknown escape \q
2- 5 | s := "a\q";
3- | ^^
4-raz: 1 error

test/err/AtPEscape.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtPEscape;
2-proc main*;
3-var s: [8]U8;
4-begin
5- s := "a\q";
6-end;
7-end AtPEscape.

test/err/AtPInc.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPInc.raz:5:9: error: INC needs an integer variable
2- 5 | INC(a);
3- | ^
4-raz: 1 error

test/err/AtPInc.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtPInc;
2-proc main*;
3-var a: BOOL;
4-begin
5- INC(a);
6-end;
7-end AtPInc.

test/err/AtPLen.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPLen.raz:5:14: error: LEN needs an array or a slice, found I64
2- 5 | a := LEN(a);
3- | ^
4-raz: 1 error

test/err/AtPLen.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtPLen;
2-proc main*;
3-var a: I64;
4-begin
5- a := LEN(a);
6-end;
7-end AtPLen.

test/err/AtPNewVar.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPNewVar.raz:5:9: error: NEW needs a pointer variable
2- 5 | NEW(a, a);
3- | ^
4-raz: 1 error

test/err/AtPNewVar.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtPNewVar;
2-proc main*;
3-var a: I64;
4-begin
5- NEW(a, a);
6-end;
7-end AtPNewVar.

test/err/AtPNoResult.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPNoResult.raz:8:10: error: p returns nothing
2- 8 | a := p() + 1;
3- | ^^^
4-raz: 1 error

test/err/AtPNoResult.raz deleted +0 -10

@@ -1,10 +0,0 @@
1-module AtPNoResult;
2-proc p;
3-begin
4-end;
5-proc main*;
6-var a: I64;
7-begin
8- a := p() + 1;
9-end;
10-end AtPNoResult.

test/err/AtPNotRecord.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPNotRecord.raz:5:10: error: expected a record, found I64
2- 5 | a := a.f;
3- | ^
4-raz: 1 error

test/err/AtPNotRecord.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtPNotRecord;
2-proc main*;
3-var a: I64;
4-begin
5- a := a.f;
6-end;
7-end AtPNotRecord.

test/err/AtPNotStmt.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPNotStmt.raz:5:5: error: a isn't a statement
2- 5 | a;
3- | ^
4-raz: 1 error

test/err/AtPNotStmt.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtPNotStmt;
2-proc main*;
3-var a: I64;
4-begin
5- a;
6-end;
7-end AtPNotStmt.

test/err/AtPSetLit.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPSetLit.raz:6:14: error: 1 isn't a name of C
2- 6 | s := {r, 1};
3- | ^
4-raz: 1 error

test/err/AtPSetLit.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module AtPSetLit;
2-type C = (r, g, b);
3-proc main*;
4-var s: set of C;
5-begin
6- s := {r, 1};
7-end;
8-end AtPSetLit.

test/err/AtPStep.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPStep.raz:5:24: error: the step can't be zero
2- 5 | for i := 1 to 5 by 1 - 1 do end;
3- | ^^^^^
4-raz: 1 error

test/err/AtPStep.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtPStep;
2-proc main*;
3-var i: I64;
4-begin
5- for i := 1 to 5 by 1 - 1 do end;
6-end;
7-end AtPStep.

test/err/AtPtrMinus.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtPtrMinus.raz:5:10: error: ^I64 and ^I32 are different types
2- 5 | x := p - q;
3- | ^^^^^
4-raz: 1 error

test/err/AtPtrMinus.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtPtrMinus;
2-proc main*;
3-var p: ^I64; q: ^I32; x: I64;
4-begin
5- x := p - q;
6-end;
7-end AtPtrMinus.

test/err/AtReturn.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtReturn.raz:4:12: error: this procedure returns nothing
2- 4 | return 1 + 2;
3- | ^^^^^
4-raz: 1 error

test/err/AtReturn.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module AtReturn;
2-proc main*;
3-begin
4- return 1 + 2;
5-end;
6-end AtReturn.

test/err/AtSliceHi.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtSliceHi.raz:5:15: error: an index is an integer, found BOOL
2- 5 | s := a[0..b];
3- | ^
4-raz: 1 error

test/err/AtSliceHi.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtSliceHi;
2-proc main*;
3-var a: [4]I64; b: BOOL; s: []I64;
4-begin
5- s := a[0..b];
6-end;
7-end AtSliceHi.

test/err/AtSliceLo.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtSliceLo.raz:5:12: error: an index is an integer, found BOOL
2- 5 | s := a[b..2];
3- | ^
4-raz: 1 error

test/err/AtSliceLo.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtSliceLo;
2-proc main*;
3-var a: [4]I64; b: BOOL; s: []I64;
4-begin
5- s := a[b..2];
6-end;
7-end AtSliceLo.

test/err/AtStrCmp.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtStrCmp.raz:5:8: error: can't compare an array with I64
2- 5 | if s = x + 1 then end;
3- | ^^^^^^^^^
4-raz: 1 error

test/err/AtStrCmp.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module AtStrCmp;
2-proc main*;
3-var s: []U8; x: I64;
4-begin
5- if s = x + 1 then end;
6-end;
7-end AtStrCmp.

test/err/AtVarArg.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/AtVarArg.raz:7:9: error: a var parameter needs a variable
2- 7 | Inc(1 + 2);
3- | ^^^^^
4-raz: 1 error

test/err/AtVarArg.raz deleted +0 -9

@@ -1,9 +0,0 @@
1-module AtVarArg;
2-proc Inc(var a: I64);
3-begin a := a + 1; end;
4-proc main*;
5-var x: I64;
6-begin
7- Inc(1 + 2);
8-end;
9-end AtVarArg.

test/err/BadProc.err deleted +0 -7

@@ -1,7 +0,0 @@
1-test/err/BadProc.raz:2:33: error: cmp doesn't have the signature of hash
2- 2 | import Str, M := Map([]U8, I64, Str.cmp, Str.eq);
3- | ^^^^^^^
4-lib/Map.raz:4:18: note: the signature is here
5- 4 | module Map(K, V; hash: proc(k: K): U64; eq: proc(a, b: K): BOOL);
6- | ^^^^
7-raz: 1 error

test/err/BadProc.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module BadProc;
2-import Str, M := Map([]U8, I64, Str.cmp, Str.eq);
3-
4-var m: M.Map;
5-
6-end BadProc.

test/err/BarBools.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/BarBools.raz:5:10: error: "|" needs integers, found BOOL
2- 5 | b := b | true;
3- | ^
4-help: BOOLs take or
5-raz: 1 error

test/err/BarBools.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module BarBools;
2-proc main*;
3-var b: BOOL; x: I64;
4-begin
5- b := b | true;
6-end;
7-end BarBools.

test/err/BigI64.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/BigI64.raz:5:10: error: can't use U64 as I64
2- 5 | i := 0FFFFFFFFFFFFFFFFH;
3- | ^^^^^^^^^^^^^^^^^^
4-raz: 1 error

test/err/BigI64.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module BigI64;
2-proc main*;
3-var i: I64;
4-begin
5- i := 0FFFFFFFFFFFFFFFFH;
6-end;
7-end BigI64.

test/err/Break.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/Break.raz:4:5: error: break outside a loop
2- 4 | break;
3- | ^^^^^
4-raz: 1 error

test/err/Break.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module Break;
2-proc main*;
3-begin
4- break;
5-end;
6-end Break.

test/err/Cycle.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/mods/CycleB.raz:2:8: error: Cycle imports itself
2- 2 | import Cycle;
3- | ^^^^^
4-raz: 1 error

test/err/Cycle.raz deleted +0 -3

@@ -1,3 +0,0 @@
1-module Cycle;
2-import CycleB;
3-end Cycle.

test/err/DeclArrayUnknown.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeclArrayUnknown.raz:4:8: error: an array literal needs a known array or slice type
2- 4 | if [1] = [1] then end;
3- | ^
4-raz: 1 error

test/err/DeclArrayUnknown.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module DeclArrayUnknown;
2-proc main*;
3-begin
4- if [1] = [1] then end;
5-end;
6-end DeclArrayUnknown.

test/err/DeclAtomicPtr.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeclAtomicPtr.raz:5:15: error: expected a pointer, found I64
2- 5 | n := XADD(n, 1);
3- | ^
4-raz: 1 error

test/err/DeclAtomicPtr.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module DeclAtomicPtr;
2-proc main*;
3-var n: I64;
4-begin
5- n := XADD(n, 1);
6-end;
7-end DeclAtomicPtr.

test/err/DeclEnumNames.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeclEnumNames.raz:2:10: error: an enumeration has at most 256 names
2- 2 | type E = (
3- | ^
4-raz: 1 error

test/err/DeclEnumNames.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module DeclEnumNames;
2-type E = (
3- a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38, a39, a40, a41, a42, a43, a44, a45, a46, a47, a48, a49, a50, a51, a52, a53, a54, a55, a56, a57, a58, a59, a60, a61, a62, a63, a64, a65, a66, a67, a68, a69, a70, a71, a72, a73, a74, a75, a76, a77, a78, a79, a80, a81, a82, a83, a84, a85, a86, a87, a88, a89, a90, a91, a92, a93, a94, a95, a96, a97, a98, a99, a100, a101, a102, a103, a104, a105, a106, a107, a108, a109, a110, a111, a112, a113, a114, a115, a116, a117, a118, a119, a120, a121, a122, a123, a124, a125, a126, a127, a128, a129, a130, a131, a132, a133, a134, a135, a136, a137, a138, a139, a140, a141, a142, a143, a144, a145, a146, a147, a148, a149, a150, a151, a152, a153, a154, a155, a156, a157, a158, a159, a160, a161, a162, a163, a164, a165, a166, a167, a168, a169, a170, a171, a172, a173, a174, a175, a176, a177, a178, a179, a180, a181, a182, a183, a184, a185, a186, a187, a188, a189, a190, a191, a192, a193, a194, a195, a196, a197, a198, a199, a200, a201, a202, a203, a204, a205, a206, a207, a208, a209, a210, a211, a212, a213, a214, a215, a216, a217, a218, a219, a220, a221, a222, a223, a224, a225, a226, a227, a228, a229, a230, a231, a232, a233, a234, a235, a236, a237, a238, a239, a240, a241, a242, a243, a244, a245, a246, a247, a248, a249, a250, a251, a252, a253, a254, a255, a256);
4-proc main*;
5-begin
6-end;
7-end DeclEnumNames.

test/err/DeclFieldTwice.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeclFieldTwice.raz:6:17: error: field a is given twice
2- 6 | r := {a: 1, a: 2};
3- | ^
4-raz: 1 error

test/err/DeclFieldTwice.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module DeclFieldTwice;
2-type R = record a: I64; end;
3-proc main*;
4-var r: R;
5-begin
6- r := {a: 1, a: 2};
7-end;
8-end DeclFieldTwice.

test/err/DeclIntConst.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeclIntConst.raz:3:9: error: expected an integer constant, found 1.5
2- 3 | var a: [1.5]I64;
3- | ^^^
4-raz: 1 error

test/err/DeclIntConst.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module DeclIntConst;
2-proc main*;
3-var a: [1.5]I64;
4-begin
5-end;
6-end DeclIntConst.

test/err/DeclLitNoField.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeclLitNoField.raz:6:11: error: R has no field b
2- 6 | r := {b: 1};
3- | ^
4-raz: 1 error

test/err/DeclLitNoField.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module DeclLitNoField;
2-type R = record a: I64; end;
3-proc main*;
4-var r: R;
5-begin
6- r := {b: 1};
7-end;
8-end DeclLitNoField.

test/err/DeclNeedsFields.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeclNeedsFields.raz:9:10: error: circle needs its fields
2- 9 | s := circle;
3- | ^^^^^^
4-raz: 1 error

test/err/DeclNeedsFields.raz deleted +0 -11

@@ -1,11 +0,0 @@
1-module DeclNeedsFields;
2-type Shape = variant
3- circle(r: F64);
4- dot;
5-end;
6-proc main*;
7-var s: Shape;
8-begin
9- s := circle;
10-end;
11-end DeclNeedsFields.

test/err/DeclNewAllocator.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeclNewAllocator.raz:5:12: error: NEW needs a ^Mem.Allocator, found ^I64
2- 5 | NEW(p, q);
3- | ^
4-raz: 1 error

test/err/DeclNewAllocator.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module DeclNewAllocator;
2-proc main*;
3-var p, q: ^I64;
4-begin
5- NEW(p, q);
6-end;
7-end DeclNewAllocator.

test/err/DeclNoField.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeclNoField.raz:6:7: error: R has no field b
2- 6 | r.b := 1;
3- | ^
4-raz: 1 error

test/err/DeclNoField.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module DeclNoField;
2-type R = record a: I64; end;
3-proc main*;
4-var r: R;
5-begin
6- r.b := 1;
7-end;
8-end DeclNoField.

test/err/DeclNotExported.err deleted +0 -10

@@ -1,10 +0,0 @@
1-test/err/mods/DeclHidden.raz:3:7: warning: constant hidden is never used
2- 3 | const hidden = 2;
3- | ^^^^^^
4-test/err/DeclNotExported.raz:6:21: error: hidden isn't exported by DeclHidden
5- 6 | n := DeclHidden.hidden;
6- | ^^^^^^
7-test/err/mods/DeclHidden.raz:3:7: note: hidden is declared here, without a *
8- 3 | const hidden = 2;
9- | ^^^^^^
10-raz: 1 error, 1 warning

test/err/DeclNotExported.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module DeclNotExported;
2-import DeclHidden;
3-proc main*;
4-var n: I64;
5-begin
6- n := DeclHidden.hidden;
7-end;
8-end DeclNotExported.

test/err/DeclNotType.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeclNotType.raz:4:8: error: n isn't a type
2- 4 | var a: n;
3- | ^
4-raz: 1 error

test/err/DeclNotType.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module DeclNotType;
2-proc main*;
3-var n: I64;
4-var a: n;
5-begin
6-end;
7-end DeclNotType.

test/err/DeclSetLitType.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeclSetLitType.raz:6:10: error: expected a set type, found I64
2- 6 | n := {r};
3- | ^
4-raz: 1 error

test/err/DeclSetLitType.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module DeclSetLitType;
2-type C = (r, g);
3-proc main*;
4-var n: I64;
5-begin
6- n := {r};
7-end;
8-end DeclSetLitType.

test/err/DeclSetNames.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeclSetNames.raz:6:16: error: a set holds names of an enumeration, found 1
2- 6 | s := {} + {1};
3- | ^
4-raz: 1 error

test/err/DeclSetNames.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module DeclSetNames;
2-type C = (r, g);
3-proc main*;
4-var s: set of C;
5-begin
6- s := {} + {1};
7-end;
8-end DeclSetNames.

test/err/DeclSetType.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeclSetType.raz:3:15: error: a set needs an enumeration of at most 64 names, found I64
2- 3 | var s: set of I64;
3- | ^^^
4-raz: 1 error

test/err/DeclSetType.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module DeclSetType;
2-proc main*;
3-var s: set of I64;
4-begin
5-end;
6-end DeclSetType.

test/err/DeclSetUnknown.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeclSetUnknown.raz:4:8: error: {} needs a known set type
2- 4 | if {} = {} then end;
3- | ^^
4-raz: 1 error

test/err/DeclSetUnknown.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module DeclSetUnknown;
2-proc main*;
3-begin
4- if {} = {} then end;
5-end;
6-end DeclSetUnknown.

test/err/DeferBreak.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeferBreak.raz:5:15: error: break outside a loop
2- 5 | defer break;
3- | ^^^^^
4-raz: 1 error

test/err/DeferBreak.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module DeferBreak;
2-proc f;
3-begin
4- while true do
5- defer break;
6- end;
7-end;
8-end DeferBreak.

test/err/DeferDefer.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeferDefer.raz:4:11: error: defer can't be deferred
2- 4 | defer defer f;
3- | ^^^^^
4-raz: 1 error

test/err/DeferDefer.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module DeferDefer;
2-proc f;
3-begin
4- defer defer f;
5-end;
6-end DeferDefer.

test/err/DeferReturn.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/DeferReturn.raz:4:11: error: return can't leave a deferred statement
2- 4 | defer return 1;
3- | ^^^^^^
4-raz: 1 error

test/err/DeferReturn.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module DeferReturn;
2-proc f: I64;
3-begin
4- defer return 1;
5- return 0;
6-end;
7-end DeferReturn.

test/err/ErrOrder.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ErrOrder.raz:5:8: error: "<" doesn't apply to ERROR
2- 5 | if A < B then end;
3- | ^^^^^
4-raz: 1 error

test/err/ErrOrder.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ErrOrder;
2-const A: ERROR = "a"; B: ERROR = "b";
3-proc main*;
4-begin
5- if A < B then end;
6-end;
7-end ErrOrder.

test/err/FirstUseLate.err deleted +0 -7

@@ -1,7 +0,0 @@
1-test/err/FirstUseLate.raz:2:18: error: Later isn't declared
2- 2 | import L := List(Later);
3- | ^^^^^
4-test/err/FirstUseLate.raz:4:8: note: the instance is made here, where it is first used
5- 4 | var l: L.List; (* made here, before Later is declared *)
6- | ^
7-raz: 1 error

test/err/FirstUseLate.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module FirstUseLate;
2-import L := List(Later);
3-
4-var l: L.List; (* made here, before Later is declared *)
5-
6-type Later = I64;
7-
8-end FirstUseLate.

test/err/GenBoolOp.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenBoolOp.raz:6:10: error: "+" doesn't apply to BOOL
2- 6 | b := b + b;
3- | ^^^^^
4-raz: 1 error

test/err/GenBoolOp.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenBoolOp;
2-
3-proc main*;
4-var b: BOOL;
5-begin
6- b := b + b;
7-end;
8-end GenBoolOp.

test/err/GenConstOverflow.err deleted +0 -10

@@ -1,10 +0,0 @@
1-test/err/GenConstOverflow.raz:5:12: error: the constant is too big for I64
2- 5 | Over = Big + 1;
3- | ^^^^^^^
4-test/err/GenConstOverflow.raz:6:13: error: the constant is too big for I64
5- 6 | Twice = 4611686018427387904 * 2;
6- | ^^^^^^^^^^^^^^^^^^^^^^^
7-test/err/GenConstOverflow.raz:7:13: error: the constant is too big for I64
8- 7 | Under = -Big - 2;
9- | ^^^^^^^^
10-raz: 3 errors

test/err/GenConstOverflow.raz deleted +0 -14

@@ -1,14 +0,0 @@
1-module GenConstOverflow;
2-(* An untyped constant doesn't wrap *)
3-const
4- Big = 9223372036854775807;
5- Over = Big + 1;
6- Twice = 4611686018427387904 * 2;
7- Under = -Big - 2;
8- Fine = U8(250) + 10;
9-
10-proc main*;
11-begin
12-end;
13-
14-end GenConstOverflow.

test/err/GenConvertString.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenConvertString.raz:6:14: error: can't convert a string
2- 6 | x := I64("a");
3- | ^^^
4-raz: 1 error

test/err/GenConvertString.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenConvertString;
2-
3-proc main*;
4-var x: I64;
5-begin
6- x := I64("a");
7-end;
8-end GenConvertString.

test/err/GenConvertType.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenConvertType.raz:6:14: error: I64 is a type, not a value
2- 6 | x := I64(I64);
3- | ^^^
4-raz: 1 error

test/err/GenConvertType.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenConvertType;
2-
3-proc main*;
4-var x: I64;
5-begin
6- x := I64(I64);
7-end;
8-end GenConvertType.

test/err/GenDivOverflow.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenDivOverflow.raz:6:10: error: division overflows
2- 6 | x := (-9223372036854775807 - 1) div (0 - 1);
3- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4-raz: 1 error

test/err/GenDivOverflow.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenDivOverflow;
2-
3-proc main*;
4-var x: I64;
5-begin
6- x := (-9223372036854775807 - 1) div (0 - 1);
7-end;
8-end GenDivOverflow.

test/err/GenDotsRecord.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenDotsRecord.raz:7:20: error: only a single value goes to ...
2- 7 | C.printf("%d", r);
3- | ^
4-raz: 1 error

test/err/GenDotsRecord.raz deleted +0 -9

@@ -1,9 +0,0 @@
1-module GenDotsRecord;
2-import C;
3-type R = record a, b: I64; end;
4-proc main*;
5-var r: R;
6-begin
7- C.printf("%d", r);
8-end;
9-end GenDotsRecord.

test/err/GenEnumOp.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenEnumOp.raz:6:10: error: "+" doesn't apply to C
2- 6 | c := c + c;
3- | ^^^^^
4-raz: 1 error

test/err/GenEnumOp.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenEnumOp;
2-type C = (red, green);
3-proc main*;
4-var c: C;
5-begin
6- c := c + c;
7-end;
8-end GenEnumOp.

test/err/GenErrorString.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenErrorString.raz:2:18: error: an error is made from a string
2- 2 | const E: ERROR = 1;
3- | ^
4-raz: 1 error

test/err/GenErrorString.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module GenErrorString;
2-const E: ERROR = 1;
3-proc main*;
4-begin
5-
6-end;
7-end GenErrorString.

test/err/GenIntReal.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/GenIntReal.raz:6:10: error: I64 and F64 are different types
2- 6 | y := x + y;
3- | ^^^^^
4-help: convert one to the other's type, as in I64(y)
5-raz: 1 error

test/err/GenIntReal.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenIntReal;
2-
3-proc main*;
4-var x: I64; y: F64;
5-begin
6- y := x + y;
7-end;
8-end GenIntReal.

test/err/GenIntTypes.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/GenIntTypes.raz:6:10: error: I32 and I64 are different types
2- 6 | b := a + b;
3- | ^^^^^
4-help: convert one to the other's type, as in I32(b)
5-raz: 1 error

test/err/GenIntTypes.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenIntTypes;
2-
3-proc main*;
4-var a: I32; b: I64;
5-begin
6- b := a + b;
7-end;
8-end GenIntTypes.

test/err/GenNotIndexable.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenNotIndexable.raz:6:10: error: expected an array, a slice or a pointer, found I64
2- 6 | x := x[0];
3- | ^
4-raz: 1 error

test/err/GenNotIndexable.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenNotIndexable;
2-
3-proc main*;
4-var x: I64;
5-begin
6- x := x[0];
7-end;
8-end GenNotIndexable.

test/err/GenNotVariable.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenNotVariable.raz:5:7: error: a var parameter needs a variable
2- 5 | P(1);
3- | ^
4-raz: 1 error

test/err/GenNotVariable.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module GenNotVariable;
2-proc P(var a: I64); begin end;
3-proc main*;
4-begin
5- P(1);
6-end;
7-end GenNotVariable.

test/err/GenPosition.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenPosition.raz:6:12: error: 5 isn't a position of C
2- 6 | c := C(5);
3- | ^
4-raz: 1 error

test/err/GenPosition.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenPosition;
2-type C = (red, green);
3-proc main*;
4-var c: C;
5-begin
6- c := C(5);
7-end;
8-end GenPosition.

test/err/GenPtrOp.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenPtrOp.raz:6:10: error: "+" doesn't apply to ^I64
2- 6 | b := p + p;
3- | ^^^^^
4-raz: 1 error

test/err/GenPtrOp.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenPtrOp;
2-
3-proc main*;
4-var p: ^I64; b: BOOL;
5-begin
6- b := p + p;
7-end;
8-end GenPtrOp.

test/err/GenRealOp.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenRealOp.raz:6:10: error: "mod" doesn't apply to F64
2- 6 | x := x mod 2.0;
3- | ^^^^^^^^^
4-raz: 1 error

test/err/GenRealOp.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenRealOp;
2-
3-proc main*;
4-var x: F64;
5-begin
6- x := x mod 2.0;
7-end;
8-end GenRealOp.

test/err/GenReturnNone.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenReturnNone.raz:2:28: error: return needs a result of I64
2- 2 | proc P(): I64; begin return; end;
3- | ^
4-raz: 1 error

test/err/GenReturnNone.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module GenReturnNone;
2-proc P(): I64; begin return; end;
3-proc main*;
4-begin
5- P();
6-end;
7-end GenReturnNone.

test/err/GenReturnNothing.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenReturnNothing.raz:2:22: error: this procedure returns nothing
2- 2 | proc P; begin return 1; end;
3- | ^
4-raz: 1 error

test/err/GenReturnNothing.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module GenReturnNothing;
2-proc P; begin return 1; end;
3-proc main*;
4-begin
5- P();
6-end;
7-end GenReturnNothing.

test/err/GenSetOp.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenSetOp.raz:6:10: error: "<" doesn't apply to CS
2- 6 | b := a < a;
3- | ^^^^^
4-raz: 1 error

test/err/GenSetOp.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenSetOp;
2-type C = (red, green); CS = set of C;
3-proc main*;
4-var a: CS; b: BOOL;
5-begin
6- b := a < a;
7-end;
8-end GenSetOp.

test/err/GenSingleValue.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenSingleValue.raz:6:10: error: expected a single value, found R
2- 6 | x := r + 1;
3- | ^
4-raz: 1 error

test/err/GenSingleValue.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenSingleValue;
2-type R = record a, b: I64; end;
3-proc main*;
4-var r: R; x: I64;
5-begin
6- x := r + 1;
7-end;
8-end GenSingleValue.

test/err/GenSlash.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/GenSlash.raz:6:10: error: "/" divides reals, not integers
2- 6 | x := 6 / 3;
3- | ^^^^^
4-help: to divide integers, write 6 div 3
5-raz: 1 error

test/err/GenSlash.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenSlash;
2-
3-proc main*;
4-var x: I64;
5-begin
6- x := 6 / 3;
7-end;
8-end GenSlash.

test/err/GenSlashVar.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/GenSlashVar.raz:6:10: error: "/" divides reals, not integers
2- 6 | x := x / y;
3- | ^^^^^
4-help: to divide integers, write x div y
5-raz: 1 error

test/err/GenSlashVar.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenSlashVar;
2-
3-proc main*;
4-var x, y: I64;
5-begin
6- x := x / y;
7-end;
8-end GenSlashVar.

test/err/GenStringAs.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenStringAs.raz:6:10: error: can't use a string as I64
2- 6 | x := "a";
3- | ^^^
4-raz: 1 error

test/err/GenStringAs.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenStringAs;
2-
3-proc main*;
4-var x: I64;
5-begin
6- x := "a";
7-end;
8-end GenStringAs.

test/err/GenStringOperand.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenStringOperand.raz:6:10: error: a string can't be an operand
2- 6 | x := "a" + 1;
3- | ^^^
4-raz: 1 error

test/err/GenStringOperand.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenStringOperand;
2-
3-proc main*;
4-var x: I64;
5-begin
6- x := "a" + 1;
7-end;
8-end GenStringOperand.

test/err/GenTooFew.err deleted +0 -7

@@ -1,7 +0,0 @@
1-test/err/GenTooFew.raz:6:14: error: too few arguments: Id takes 1
2- 6 | x := Id();
3- | ^
4-test/err/GenTooFew.raz:2:6: note: the signature is here
5- 2 | proc Id(a: I64): I64; begin return a; end;
6- | ^^
7-raz: 1 error

test/err/GenTooFew.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenTooFew;
2-proc Id(a: I64): I64; begin return a; end;
3-proc main*;
4-var x: I64;
5-begin
6- x := Id();
7-end;
8-end GenTooFew.

test/err/GenTooFewValue.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenTooFewValue.raz:6:8: error: too few arguments
2- 6 | f();
3- | ^
4-raz: 1 error

test/err/GenTooFewValue.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenTooFewValue;
2-type F = proc(a: I64);
3-proc main*;
4-var f: F;
5-begin
6- f();
7-end;
8-end GenTooFewValue.

test/err/GenTooManyValue.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenTooManyValue.raz:6:10: error: too many arguments
2- 6 | f(1, 2);
3- | ^
4-raz: 1 error

test/err/GenTooManyValue.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenTooManyValue;
2-type F = proc(a: I64);
3-proc main*;
4-var f: F;
5-begin
6- f(1, 2);
7-end;
8-end GenTooManyValue.

test/err/GenVarExact.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenVarExact.raz:6:7: error: a var parameter needs exactly I64, found I32
2- 6 | P(x);
3- | ^
4-raz: 1 error

test/err/GenVarExact.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenVarExact;
2-proc P(var a: I64); begin end;
3-proc main*;
4-var x: I32;
5-begin
6- P(x);
7-end;
8-end GenVarExact.

test/err/GenVolCompare.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenVolCompare.raz:6:10: error: can't compare through a volatile pointer
2- 6 | b := p^ = "a";
3- | ^^
4-raz: 1 error

test/err/GenVolCompare.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenVolCompare;
2-
3-proc main*;
4-var p: ^VOLATILE [4]U8; b: BOOL;
5-begin
6- b := p^ = "a";
7-end;
8-end GenVolCompare.

test/err/GenVolCopy.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenVolCopy.raz:6:10: error: can't copy through a volatile pointer
2- 6 | r := p^;
3- | ^^
4-raz: 1 error

test/err/GenVolCopy.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenVolCopy;
2-type R = record a, b: I64; end;
3-proc main*;
4-var p: ^VOLATILE R; r: R;
5-begin
6- r := p^;
7-end;
8-end GenVolCopy.

test/err/GenVolSlice.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenVolSlice.raz:6:10: error: can't make a slice through a volatile pointer
2- 6 | s := p^;
3- | ^^
4-raz: 1 error

test/err/GenVolSlice.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenVolSlice;
2-
3-proc main*;
4-var p: ^VOLATILE [4]I64; s: []I64;
5-begin
6- s := p^;
7-end;
8-end GenVolSlice.

test/err/GenVolVar.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/GenVolVar.raz:6:7: error: can't pass through a volatile pointer to a var parameter
2- 6 | P(p^);
3- | ^^
4-raz: 1 error

test/err/GenVolVar.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module GenVolVar;
2-proc P(var a: I64); begin end;
3-proc main*;
4-var p: ^VOLATILE I64;
5-begin
6- P(p^);
7-end;
8-end GenVolVar.

test/err/Match.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/Match.raz:9:5: error: no arm for c
2- 9 | end;
3- | ^^^
4-raz: 1 error

test/err/Match.raz deleted +0 -11

@@ -1,11 +0,0 @@
1-module Match;
2-type S = variant a; b; c; end;
3-proc main*;
4-var s: S;
5-begin
6- match s of
7- | a: s := b;
8- | b:
9- end;
10-end;
11-end Match.

test/err/Mixed.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/Mixed.raz:6:10: error: F32 and F64 are different types
2- 6 | y := x + y;
3- | ^^^^^
4-help: convert one to the other's type, as in F32(y)
5-raz: 1 error

test/err/Mixed.raz deleted +0 -9

@@ -1,9 +0,0 @@
1-module Mixed;
2-
3-proc main*;
4-var x: F32; y: F64;
5-begin
6- y := x + y;
7-end;
8-
9-end Mixed.

test/err/NegU64.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/NegU64.raz:5:10: error: -1 doesn't fit U64
2- 5 | u := -1;
3- | ^^
4-raz: 1 error

test/err/NegU64.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module NegU64;
2-proc main*;
3-var u: U64;
4-begin
5- u := -1;
6-end;
7-end NegU64.

test/err/NoArgs.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/NoArgs.raz:2:8: error: List needs a type for T
2- 2 | import List;
3- | ^^^^
4-raz: 1 error

test/err/NoArgs.raz deleted +0 -3

@@ -1,3 +0,0 @@
1-module NoArgs;
2-import List;
3-end NoArgs.

test/err/NotGeneric.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/NotGeneric.raz:2:8: error: Str isn't generic
2- 2 | import S := Str(I64);
3- | ^^^^^^^^^^^^^
4-raz: 1 error

test/err/NotGeneric.raz deleted +0 -9

@@ -1,9 +0,0 @@
1-module NotGeneric;
2-import S := Str(I64);
3-
4-proc f(a, b: []U8): I64;
5-begin
6- return S.cmp(a, b);
7-end;
8-
9-end NotGeneric.

test/err/NotInt.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/NotInt.raz:5:14: error: "not" needs a BOOL, found I64
2- 5 | x := not x;
3- | ^
4-help: the bits of an integer flip with ~
5-raz: 1 error

test/err/NotInt.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module NotInt;
2-proc main*;
3-var b: BOOL; x: I64;
4-begin
5- x := not x;
6-end;
7-end NotInt.

test/err/NoteBuiltin.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/NoteBuiltin.raz:5:10: error: len isn't declared
2- 5 | x := len(y);
3- | ^^^
4-help: did you mean LEN?
5-raz: 1 error

test/err/NoteBuiltin.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module NoteBuiltin;
2-proc main*;
3-var x, y: I64;
4-begin
5- x := len(y);
6-end;
7-end NoteBuiltin.

test/err/NoteExport.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/NoteExport.raz:6:9: error: Int isn't exported by Out
2- 6 | Out.Int(x);
3- | ^^^
4-help: did you mean int?
5-raz: 1 error

test/err/NoteExport.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module NoteExport;
2-import Out;
3-proc main*;
4-var x, y: I64;
5-begin
6- Out.Int(x);
7-end;
8-end NoteExport.

test/err/NoteField.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/NoteField.raz:6:7: error: P has no field cuont
2- 6 | p.cuont := 1;
3- | ^^^^^
4-help: did you mean count?
5-raz: 1 error

test/err/NoteField.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module NoteField;
2-type P = record count: I64; end;
3-proc main*;
4-var p: P;
5-begin
6- p.cuont := 1;
7-end;
8-end NoteField.

test/err/NoteImport.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/NoteImport.raz:5:5: error: Fmt isn't declared
2- 5 | Fmt.print(x);
3- | ^^^
4-help: Fmt is a module: import Fmt
5-raz: 1 error

test/err/NoteImport.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module NoteImport;
2-proc main*;
3-var x, y: I64;
4-begin
5- Fmt.print(x);
6-end;
7-end NoteImport.

test/err/NoteLocal.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/NoteLocal.raz:6:5: error: cuont isn't declared
2- 6 | cuont := 1;
3- | ^^^^^
4-help: did you mean count?
5-raz: 1 error

test/err/NoteLocal.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module NoteLocal;
2-proc main*;
3-var x, y, count: I64;
4-begin
5-
6- cuont := 1;
7-end;
8-end NoteLocal.

test/err/OrInts.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/OrInts.raz:5:10: error: "or" needs BOOLs, found I64
2- 5 | x := x or 1;
3- | ^
4-help: the bits of integers take |
5-raz: 1 error

test/err/OrInts.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module OrInts;
2-proc main*;
3-var b: BOOL; x: I64;
4-begin
5- x := x or 1;
6-end;
7-end OrInts.

test/err/PackedAddress.err deleted +0 -13

@@ -1,13 +0,0 @@
1-test/err/PackedAddress.raz:15:14: error: a field of a packed record has no address
2- 15 | p := ADR(h.len);
3- | ^^^^^
4-test/err/PackedAddress.raz:16:9: error: a field of a packed record can't be a var parameter
5- 16 | put(h.len);
6- | ^^^^^
7-test/err/PackedAddress.raz:17:10: error: can't make a slice of a field of a packed record
8- 17 | s := h.vals[0..1];
9- | ^^^^^^
10-test/err/PackedAddress.raz:19:5: error: a field of a packed record can't be volatile
11- 19 | q^.len := 2;
12- | ^^
13-raz: 4 errors

test/err/PackedAddress.raz deleted +0 -24

@@ -1,24 +0,0 @@
1-module PackedAddress;
2-(* A field of a packed record may be misaligned: it has no address,
3- and no volatile access *)
4-type
5- Header = packed record kind: U8; len: U32; tag: U8; vals: [2]U16; end;
6-
7-proc put(var n: U32);
8-begin
9- n := 1;
10-end;
11-
12-proc main*;
13-var h: Header; p: ^U32; q: ^VOLATILE Header; k: ^U8; s: []U16;
14-begin
15- p := ADR(h.len);
16- put(h.len);
17- s := h.vals[0..1];
18- q := ADR(h);
19- q^.len := 2;
20- k := ADR(h.tag);
21- h.len := 3;
22-end;
23-
24-end PackedAddress.

test/err/PassOnTypes.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/PassOnTypes.raz:10:12: error: expected the results (BOOL, I64), found (I64, BOOL)
2- 10 | return two(n);
3- | ^^^^^^
4-raz: 1 error

test/err/PassOnTypes.raz deleted +0 -19

@@ -1,19 +0,0 @@
1-module PassOnTypes;
2-
3-proc two(n: I64): (I64, BOOL);
4-begin
5- return n, n = 0;
6-end;
7-
8-proc swapped(n: I64): (BOOL, I64);
9-begin
10- return two(n);
11-end;
12-
13-proc main*;
14-var b: BOOL; i: I64;
15-begin
16- b, i := swapped(1);
17-end;
18-
19-end PassOnTypes.

test/err/PtrArray.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/PtrArray.raz:6:5: error: a pointer to an array is indexed as p^[i]
2- 6 | p[1] := 0;
3- | ^
4-raz: 1 error

test/err/PtrArray.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module PtrArray;
2-proc main*;
3-var a: [4]I64; p: ^[4]I64;
4-begin
5- p := ADR(a);
6- p[1] := 0;
7-end;
8-end PtrArray.

test/err/Recover.err deleted +0 -31

@@ -1,31 +0,0 @@
1-test/err/Recover.raz:6:27: error: Foo isn't declared
2- 6 | P = record a: I64; b: Foo; end;
3- | ^^^
4-test/err/Recover.raz:9:8: error: Bar isn't declared
5- 9 | var g: Bar;
6- | ^^^
7-test/err/Recover.raz:15:10: error: can't use I64 as BOOL
8- 15 | b := x;
9- | ^
10-test/err/Recover.raz:16:10: error: y isn't declared
11- 16 | x := y + 1;
12- | ^
13-test/err/Recover.raz:19:14: error: I64 and BOOL are different types
14- 19 | x := (x + 2) * b;
15- | ^^^^^^^^^^^
16-test/err/Recover.raz:20:17: error: z isn't declared
17- 20 | Out.int(z);
18- | ^
19-test/err/Recover.raz:22:12: error: I64 and BOOL are different types
20- 22 | return x + true;
21- | ^^^^^^^^
22-test/err/Recover.raz:28:7: error: Q has no field c
23- 28 | q.c := 1;
24- | ^
25-test/err/Recover.raz:30:18: error: expected ";", found "return"
26- 30 | Out.str("hi")
27- | ^
28-test/err/Recover.raz:37:13: error: nope isn't declared
29- 37 | Out.int(nope(2));
30- | ^^^^
31-raz: 10 errors

test/err/Recover.raz deleted +0 -40

@@ -1,40 +0,0 @@
1-module Recover;
2-
3-import Out;
4-
5-type
6- P = record a: I64; b: Foo; end;
7- Q = record a: I64; end;
8-
9-var g: Bar;
10- h: I64;
11-
12-proc f(x: I64): I64;
13-var b: BOOL;
14-begin
15- b := x;
16- x := y + 1;
17- x := y * 2;
18- if x = 1 then
19- x := (x + 2) * b;
20- Out.int(z);
21- end;
22- return x + true;
23-end f;
24-
25-proc g2(): Q;
26-var q: Q;
27-begin
28- q.c := 1;
29- h := g;
30- Out.str("hi")
31- return q;
32-end g2;
33-
34-proc main*();
35-begin
36- Out.int(f(1));
37- Out.int(nope(2));
38-end main;
39-
40-end Recover.

test/err/Resync.err deleted +0 -22

@@ -1,22 +0,0 @@
1-test/err/Resync.raz:10:5: error: expected ";", found a
2- 10 | end a;
3- | ^
4-test/err/Resync.raz:14:31: error: expected ";", found "end"
5- 14 | while x > 0 do x := x - 1 end;
6- | ^^^
7-test/err/Resync.raz:15:10: error: expected an expression, found ")"
8- 15 | x := ) + 2;
9- | ^
10-test/err/Resync.raz:16:11: error: match needs a variant or an enumeration, found I64
11- 16 | match x
12- | ^
13-test/err/Resync.raz:23:13: error: expected an expression, found ";"
14- 23 | x := 1 +;
15- | ^
16-test/err/Resync.raz:23:14: error: expected "end", found "proc"
17- 23 | x := 1 +;
18- | ^
19-test/err/Resync.raz:27:10: error: can't use BOOL as I64
20- 27 | x := false;
21- | ^^^^^
22-raz: 7 errors

test/err/Resync.raz deleted +0 -35

@@ -1,35 +0,0 @@
1-module Resync;
2-
3-import Out;
4-
5-proc a(x: I64);
6-begin
7- if x = 1 then
8- x := 2;
9- Out.int(x);
10-end a;
11-
12-proc b(x: I64);
13-begin
14- while x > 0 do x := x - 1 end;
15- x := ) + 2;
16- match x
17- | 1: x := true;
18- end;
19-end b;
20-
21-proc c(x: I64);
22-begin
23- x := 1 +;
24-
25-proc d(x: I64);
26-begin
27- x := false;
28-end d;
29-
30-proc main*();
31-begin
32- a(1); b(2); c(3); d(4);
33-end main;
34-
35-end Resync.

test/err/ScanBigDec.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanBigDec.raz:5:10: error: 9223372036854775808 is too big for I64
2- 5 | x := 9223372036854775808;
3- | ^^^^^^^^^^^^^^^^^^^
4-raz: 1 error

test/err/ScanBigDec.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanBigDec;
2-proc main*;
3-var x: I64;
4-begin
5- x := 9223372036854775808;
6-end;
7-end ScanBigDec.

test/err/ScanBigHex.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanBigHex.raz:5:10: error: 10000000000000000 is too big for U64
2- 5 | x := 10000000000000000H;
3- | ^^^^^^^^^^^^^^^^^
4-raz: 1 error

test/err/ScanBigHex.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanBigHex;
2-proc main*;
3-var x: U64;
4-begin
5- x := 10000000000000000H;
6-end;
7-end ScanBigHex.

test/err/ScanCharEmpty.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanCharEmpty.raz:5:10: error: empty character
2- 5 | c := '';
3- | ^
4-raz: 1 error

test/err/ScanCharEmpty.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanCharEmpty;
2-proc main*;
3-var c: U8;
4-begin
5- c := '';
6-end;
7-end ScanCharEmpty.

test/err/ScanCharOpen.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanCharOpen.raz:5:10: error: character not closed
2- 5 | c := 'ab';
3- | ^^
4-raz: 1 error

test/err/ScanCharOpen.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanCharOpen;
2-proc main*;
3-var c: U8;
4-begin
5- c := 'ab';
6-end;
7-end ScanCharOpen.

test/err/ScanCodePoint.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanCodePoint.raz:5:11: error: 110000 isn't a code point
2- 5 | s := "\u{110000}";
3- | ^^^^^^^^^^
4-raz: 1 error

test/err/ScanCodePoint.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanCodePoint;
2-proc main*;
3-var s: [4]U8;
4-begin
5- s := "\u{110000}";
6-end;
7-end ScanCodePoint.

test/err/ScanComment.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanComment.raz:4:5: error: comment not closed
2- 4 | (* never closed
3- | ^^
4-raz: 1 error

test/err/ScanComment.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module ScanComment;
2-proc main*;
3-begin
4- (* never closed
5-end;
6-end ScanComment.

test/err/ScanExponent.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanExponent.raz:5:10: error: expected a digit in the exponent
2- 5 | x := 1.5E+;
3- | ^^^^^
4-raz: 1 error

test/err/ScanExponent.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanExponent;
2-proc main*;
3-var x: F64;
4-begin
5- x := 1.5E+;
6-end;
7-end ScanExponent.

test/err/ScanHexChar.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanHexChar.raz:5:11: error: \x is only for strings
2- 5 | c := '\x41';
3- | ^^
4-raz: 1 error

test/err/ScanHexChar.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanHexChar;
2-proc main*;
3-var c: U8;
4-begin
5- c := '\x41';
6-end;
7-end ScanHexChar.

test/err/ScanHexDigits.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanHexDigits.raz:5:11: error: \x needs two hex digits
2- 5 | s := "\xZ1";
3- | ^^^^
4-raz: 1 error

test/err/ScanHexDigits.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanHexDigits;
2-proc main*;
3-var s: [4]U8;
4-begin
5- s := "\xZ1";
6-end;
7-end ScanHexDigits.

test/err/ScanHexH.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanHexH.raz:5:10: error: a hex number ends with H
2- 5 | x := 12A;
3- | ^^^
4-raz: 1 error

test/err/ScanHexH.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanHexH;
2-proc main*;
3-var x: I64;
4-begin
5- x := 12A;
6-end;
7-end ScanHexH.

test/err/ScanMain.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanMain.raz:2:6: error: main must be proc main* or proc main*: I64
2- 2 | proc main*(_n: I64);
3- | ^^^^
4-raz: 1 error

test/err/ScanMain.raz deleted +0 -5

@@ -1,5 +0,0 @@
1-module ScanMain;
2-proc main*(_n: I64);
3-begin
4-end;
5-end ScanMain.

test/err/ScanName.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanName.raz:4:5: error: a name has at most 63 characters
2- 4 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
3- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4-raz: 1 error

test/err/ScanName.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module ScanName;
2-proc main*;
3-begin
4- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
5-end;
6-end ScanName.

test/err/ScanNameDigit.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanNameDigit.raz:5:10: error: a name can't start with a digit
2- 5 | x := 12abc;
3- | ^^
4-raz: 1 error

test/err/ScanNameDigit.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanNameDigit;
2-proc main*;
3-var x: I64;
4-begin
5- x := 12abc;
6-end;
7-end ScanNameDigit.

test/err/ScanNul.err deleted

Binary file; the patch has it.

test/err/ScanNul.raz deleted

Binary file; the patch has it.

test/err/ScanRealBig.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanRealBig.raz:5:10: error: 1.8E308 is out of the range of F64
2- 5 | x := 1.8E308;
3- | ^^^^^^^
4-raz: 1 error

test/err/ScanRealBig.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanRealBig;
2-proc main*;
3-var x: F64;
4-begin
5- x := 1.8E308;
6-end;
7-end ScanRealBig.

test/err/ScanRealHex.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanRealHex.raz:5:10: error: a decimal number has only the digits 0 to 9
2- 5 | x := 1A.5;
3- | ^^
4-raz: 1 error

test/err/ScanRealHex.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanRealHex;
2-proc main*;
3-var x: F64;
4-begin
5- x := 1A.5;
6-end;
7-end ScanRealHex.

test/err/ScanStringOpen.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanStringOpen.raz:5:10: error: string not closed
2- 5 | s := "abc;
3- | ^^^^^
4-raz: 1 error

test/err/ScanStringOpen.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanStringOpen;
2-proc main*;
3-var s: [4]U8;
4-begin
5- s := "abc;
6-end;
7-end ScanStringOpen.

test/err/ScanTwice.err deleted +0 -7

@@ -1,7 +0,0 @@
1-test/err/ScanTwice.raz:4:5: error: x is declared twice
2- 4 | x: I64;
3- | ^
4-test/err/ScanTwice.raz:3:5: note: the first one is here
5- 3 | var x: I64;
6- | ^
7-raz: 1 error

test/err/ScanTwice.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module ScanTwice;
2-proc main*;
3-var x: I64;
4- x: I64;
5-begin
6-
7-end;
8-end ScanTwice.

test/err/ScanUBad.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanUBad.raz:5:11: error: expected hex digits and "}" after \u{
2- 5 | s := "\u{41";
3- | ^^^^^
4-raz: 1 error

test/err/ScanUBad.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanUBad;
2-proc main*;
3-var s: [4]U8;
4-begin
5- s := "\u{41";
6-end;
7-end ScanUBad.

test/err/ScanUBig.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanUBig.raz:5:11: error: a code point has at most 6 hex digits
2- 5 | s := "\u{1234567}";
3- | ^^^^^^^^^^
4-raz: 1 error

test/err/ScanUBig.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanUBig;
2-proc main*;
3-var s: [4]U8;
4-begin
5- s := "\u{1234567}";
6-end;
7-end ScanUBig.

test/err/ScanUBrace.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanUBrace.raz:5:11: error: expected "{" after \u
2- 5 | s := "\u0041";
3- | ^^
4-raz: 1 error

test/err/ScanUBrace.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanUBrace;
2-proc main*;
3-var s: [4]U8;
4-begin
5- s := "\u0041";
6-end;
7-end ScanUBrace.

test/err/ScanUtf8.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/ScanUtf8.raz:5:11: error: invalid UTF-8
2- 5 | s := "ÿ";
3- | ^
4-raz: 1 error

test/err/ScanUtf8.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module ScanUtf8;
2-proc main*;
3-var s: [4]U8;
4-begin
5- s := "ÿ";
6-end;
7-end ScanUtf8.

test/err/SlipAnd.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/SlipAnd.raz:5:16: error: "and" is written and, not &&
2- 5 | if (x = 1) && (y = 2) then x := 2; end;
3- | ^^
4-raz: 1 error

test/err/SlipAnd.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module SlipAnd;
2-proc main*;
3-var x, y: I64;
4-begin
5- if (x = 1) && (y = 2) then x := 2; end;
6-end;
7-end SlipAnd.

test/err/SlipAssign.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/SlipAssign.raz:5:5: error: x isn't a statement
2- 5 | x = 1;
3- | ^
4-help: assignment is written :=
5-raz: 1 error

test/err/SlipAssign.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module SlipAssign;
2-proc main*;
3-var x, y: I64;
4-begin
5- x = 1;
6-end;
7-end SlipAssign.

test/err/SlipBrace.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/SlipBrace.raz:5:14: error: expected "then", found "{"
2- 5 | if x = 1 { x := 2 }
3- | ^
4-help: a block is written "then" ... end
5-raz: 1 error

test/err/SlipBrace.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module SlipBrace;
2-proc main*;
3-var x, y: I64;
4-begin
5- if x = 1 { x := 2 }
6-end;
7-end SlipBrace.

test/err/SlipDo.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/SlipDo.raz:5:17: error: expected "do", found "{"
2- 5 | while x < 3 { x := x + 1 }
3- | ^
4-help: a block is written "do" ... end
5-raz: 1 error

test/err/SlipDo.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module SlipDo;
2-proc main*;
3-var x, y: I64;
4-begin
5- while x < 3 { x := x + 1 }
6-end;
7-end SlipDo.

test/err/SlipElif.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/SlipElif.raz:5:27: error: elif isn't declared
2- 5 | if x = 1 then x := 2; elif x = 3 then x := 4; end;
3- | ^^^^
4-help: raz writes elsif
5-raz: 1 error

test/err/SlipElif.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module SlipElif;
2-proc main*;
3-var x, y: I64;
4-begin
5- if x = 1 then x := 2; elif x = 3 then x := 4; end;
6-end;
7-end SlipElif.

test/err/SlipEql.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/SlipEql.raz:5:10: error: comparing is written =, not ==
2- 5 | if x == 1 then x := 2; end;
3- | ^^
4-raz: 1 error

test/err/SlipEql.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module SlipEql;
2-proc main*;
3-var x, y: I64;
4-begin
5- if x == 1 then x := 2; end;
6-end;
7-end SlipEql.

test/err/SlipMany.err deleted +0 -10

@@ -1,10 +0,0 @@
1-test/err/SlipMany.raz:5:10: error: "not equal" is written #, not !=
2- 5 | if x != 1 && z then x := y; end;
3- | ^^
4-test/err/SlipMany.raz:5:15: error: "and" is written and, not &&
5- 5 | if x != 1 && z then x := y; end;
6- | ^^
7-test/err/SlipMany.raz:5:18: error: z isn't declared
8- 5 | if x != 1 && z then x := y; end;
9- | ^
10-raz: 3 errors

test/err/SlipMany.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module SlipMany;
2-proc main*;
3-var x, y: I64;
4-begin
5- if x != 1 && z then x := y; end;
6-end;
7-end SlipMany.

test/err/SlipNeq.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/SlipNeq.raz:5:10: error: "not equal" is written #, not !=
2- 5 | if x != 1 then x := 2; end;
3- | ^^
4-raz: 1 error

test/err/SlipNeq.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module SlipNeq;
2-proc main*;
3-var x, y: I64;
4-begin
5- if x != 1 then x := 2; end;
6-end;
7-end SlipNeq.

test/err/SlipNot.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/SlipNot.raz:5:8: error: "not" is written not, not !
2- 5 | if ! (x = 1) then x := 2; end;
3- | ^
4-raz: 1 error

test/err/SlipNot.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module SlipNot;
2-proc main*;
3-var x, y: I64;
4-begin
5- if ! (x = 1) then x := 2; end;
6-end;
7-end SlipNot.

test/err/SlipOr.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/SlipOr.raz:5:16: error: "or" is written or, not ||
2- 5 | if (x = 1) || (y = 2) then x := 2; end;
3- | ^^
4-raz: 1 error

test/err/SlipOr.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module SlipOr;
2-proc main*;
3-var x, y: I64;
4-begin
5- if (x = 1) || (y = 2) then x := 2; end;
6-end;
7-end SlipOr.

test/err/StmtArgKind.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtArgKind.raz:2:23: error: Page isn't a type or a procedure
2- 2 | import Mem, L := List(Mem.Page);
3- | ^^^^^^^^
4-raz: 1 error

test/err/StmtArgKind.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module StmtArgKind;
2-import Mem, L := List(Mem.Page);
3-
4-var l: L.List;
5-
6-end StmtArgKind.

test/err/StmtAssignConst.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtAssignConst.raz:5:5: error: can't assign to k
2- 5 | k := 2;
3- | ^
4-raz: 1 error

test/err/StmtAssignConst.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module StmtAssignConst;
2-const k = 1;
3-proc main*;
4-begin
5- k := 2;
6-end;
7-end StmtAssignConst.

test/err/StmtAssignValue.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtAssignValue.raz:7:8: error: can't assign to a value
2- 7 | r, f().a := f(), f().a;
3- | ^^^^^
4-raz: 1 error

test/err/StmtAssignValue.raz deleted +0 -9

@@ -1,9 +0,0 @@
1-module StmtAssignValue;
2-type R = record a: I64; end;
3-proc f(): R; var r: R; begin return r; end;
4-proc main*;
5-var r: R;
6-begin
7- r, f().a := f(), f().a;
8-end;
9-end StmtAssignValue.

test/err/StmtCaseName.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtCaseName.raz:11:7: error: expected a case, found a number
2- 11 | | 5:
3- | ^
4-raz: 1 error

test/err/StmtCaseName.raz deleted +0 -14

@@ -1,14 +0,0 @@
1-module StmtCaseName;
2-type S = variant
3- circle(r: F64);
4- rect(w, h: F64);
5- dot;
6-end;
7-proc main*;
8-var s: S;
9-begin
10- match s of
11- | 5:
12- end;
13-end;
14-end StmtCaseName.

test/err/StmtCaseTwice.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtCaseTwice.raz:12:7: error: dot has two arms
2- 12 | | dot:
3- | ^^^
4-raz: 1 error

test/err/StmtCaseTwice.raz deleted +0 -16

@@ -1,16 +0,0 @@
1-module StmtCaseTwice;
2-type S = variant
3- circle(r: F64);
4- rect(w, h: F64);
5- dot;
6-end;
7-proc main*;
8-var s: S;
9-begin
10- match s of
11- | dot:
12- | dot:
13- | else:
14- end;
15-end;
16-end StmtCaseTwice.

test/err/StmtDot.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtDot.raz:2:12: error: expected ".", found ";"
2- 2 | end StmtDot;
3- | ^
4-raz: 1 error

test/err/StmtDot.raz deleted +0 -2

@@ -1,2 +0,0 @@
1-module StmtDot;
2-end StmtDot;

test/err/StmtElseLast.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtElseLast.raz:12:7: error: else must be the last arm
2- 12 | | dot:
3- | ^^^
4-raz: 1 error

test/err/StmtElseLast.raz deleted +0 -15

@@ -1,15 +0,0 @@
1-module StmtElseLast;
2-type S = variant
3- circle(r: F64);
4- rect(w, h: F64);
5- dot;
6-end;
7-proc main*;
8-var s: S;
9-begin
10- match s of
11- | else:
12- | dot:
13- end;
14-end;
15-end StmtElseLast.

test/err/StmtEnd.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtEnd.raz:5:12: error: expected "end", found ")"
2- 5 | a := 1;
3- | ^
4-raz: 1 error

test/err/StmtEnd.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module StmtEnd;
2-proc main*;
3-var a: I64;
4-begin
5- a := 1;
6-)
7-end;
8-end StmtEnd.

test/err/StmtEndName.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtEndName.raz:2:5: error: expected StmtEndName, found Other
2- 2 | end Other.
3- | ^^^^^
4-raz: 1 error

test/err/StmtEndName.raz deleted +0 -2

@@ -1,2 +0,0 @@
1-module StmtEndName;
2-end Other.

test/err/StmtErrType.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtErrType.raz:2:10: error: only an ERROR constant has a type
2- 2 | const k: I64 = "a";
3- | ^^^
4-raz: 1 error

test/err/StmtErrType.raz deleted +0 -3

@@ -1,3 +0,0 @@
1-module StmtErrType;
2-const k: I64 = "a";
3-end StmtErrType.

test/err/StmtFewFields.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtFewFields.raz:11:13: error: name all the fields of rect, or none
2- 11 | | rect(w):
3- | ^
4-raz: 1 error

test/err/StmtFewFields.raz deleted +0 -15

@@ -1,15 +0,0 @@
1-module StmtFewFields;
2-type S = variant
3- circle(r: F64);
4- rect(w, h: F64);
5- dot;
6-end;
7-proc main*;
8-var s: S;
9-begin
10- match s of
11- | rect(w):
12- | else:
13- end;
14-end;
15-end StmtFewFields.

test/err/StmtFieldName.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtFieldName.raz:11:14: error: expected a name, found a number
2- 11 | | circle(5):
3- | ^
4-raz: 1 error

test/err/StmtFieldName.raz deleted +0 -15

@@ -1,15 +0,0 @@
1-module StmtFieldName;
2-type S = variant
3- circle(r: F64);
4- rect(w, h: F64);
5- dot;
6-end;
7-proc main*;
8-var s: S;
9-begin
10- match s of
11- | circle(5):
12- | else:
13- end;
14-end;
15-end StmtFieldName.

test/err/StmtForName.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtForName.raz:5:9: error: k isn't a variable
2- 5 | for k := 1 to 2 do end;
3- | ^
4-raz: 1 error

test/err/StmtForName.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module StmtForName;
2-const k = 1;
3-proc main*;
4-begin
5- for k := 1 to 2 do end;
6-end;
7-end StmtForName.

test/err/StmtForType.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtForType.raz:5:9: error: a for loop needs an integer or enumeration variable, found BOOL
2- 5 | for b := 1 to 2 do end;
3- | ^
4-raz: 1 error

test/err/StmtForType.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module StmtForType;
2-proc main*;
3-var b: BOOL;
4-begin
5- for b := 1 to 2 do end;
6-end;
7-end StmtForType.

test/err/StmtForwardTwice.err deleted +0 -7

@@ -1,7 +0,0 @@
1-test/err/StmtForwardTwice.raz:3:9: error: f is declared forward twice
2- 3 | proc f; forward;
3- | ^^^^^^^
4-test/err/StmtForwardTwice.raz:4:21: error: f is declared forward but never defined
5- 4 | end StmtForwardTwice.
6- | ^
7-raz: 2 errors

test/err/StmtForwardTwice.raz deleted +0 -4

@@ -1,4 +0,0 @@
1-module StmtForwardTwice;
2-proc f; forward;
3-proc f; forward;
4-end StmtForwardTwice.

test/err/StmtFwdPtr.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtFwdPtr.raz:2:11: error: Missing isn't declared
2- 2 | type P = ^Missing;
3- | ^^^^^^^
4-raz: 1 error

test/err/StmtFwdPtr.raz deleted +0 -3

@@ -1,3 +0,0 @@
1-module StmtFwdPtr;
2-type P = ^Missing;
3-end StmtFwdPtr.

test/err/StmtImportName.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtImportName.raz:2:8: error: expected a module name, found a number
2- 2 | import 5;
3- | ^
4-raz: 1 error

test/err/StmtImportName.raz deleted +0 -3

@@ -1,3 +0,0 @@
1-module StmtImportName;
2-import 5;
3-end StmtImportName.

test/err/StmtManyFields.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtManyFields.raz:11:17: error: more names than circle has fields
2- 11 | | circle(r, x):
3- | ^
4-raz: 1 error

test/err/StmtManyFields.raz deleted +0 -15

@@ -1,15 +0,0 @@
1-module StmtManyFields;
2-type S = variant
3- circle(r: F64);
4- rect(w, h: F64);
5- dot;
6-end;
7-proc main*;
8-var s: S;
9-begin
10- match s of
11- | circle(r, x):
12- | else:
13- end;
14-end;
15-end StmtManyFields.

test/err/StmtManyTypeArgs.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtManyTypeArgs.raz:2:8: error: too many type arguments for List
2- 2 | import L := List(I64, I64);
3- | ^^^^^^^^^^^^^^^^^^^
4-raz: 1 error

test/err/StmtManyTypeArgs.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module StmtManyTypeArgs;
2-import L := List(I64, I64);
3-
4-var l: L.List;
5-
6-end StmtManyTypeArgs.

test/err/StmtNeedProc.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtNeedProc.raz:2:33: error: Map needs a procedure for hash
2- 2 | import Str, M := Map([]U8, I64, I64, Str.eq);
3- | ^^^
4-raz: 1 error

test/err/StmtNeedProc.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module StmtNeedProc;
2-import Str, M := Map([]U8, I64, I64, Str.eq);
3-
4-var m: M.Map;
5-
6-end StmtNeedProc.

test/err/StmtNeedType.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtNeedType.raz:2:22: error: Map needs a type for K
2- 2 | import Str, M := Map(Str.cmp, I64, Str.cmp, Str.eq);
3- | ^^^^^^^
4-raz: 1 error

test/err/StmtNeedType.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module StmtNeedType;
2-import Str, M := Map(Str.cmp, I64, Str.cmp, Str.eq);
3-
4-var m: M.Map;
5-
6-end StmtNeedType.

test/err/StmtNest.err deleted +0 -7

@@ -1,7 +0,0 @@
1-test/err/StmtNest.raz:3:3: error: procedures don't nest
2- 3 | proc inner; forward;
3- | ^^^^
4-test/err/StmtNest.raz:5:5: error: expected "begin", found "end"
5- 5 | end;
6- | ^
7-raz: 2 errors

test/err/StmtNest.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module StmtNest;
2-proc main*;
3- proc inner; forward;
4-begin
5-end;
6-end StmtNest.

test/err/StmtNeverDefined.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtNeverDefined.raz:3:21: error: f is declared forward but never defined
2- 3 | end StmtNeverDefined.
3- | ^
4-raz: 1 error

test/err/StmtNeverDefined.raz deleted +0 -3

@@ -1,3 +0,0 @@
1-module StmtNeverDefined;
2-proc f; forward;
3-end StmtNeverDefined.

test/err/StmtNoModule.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtNoModule.raz:2:8: error: can't find module Nothing
2- 2 | import Nothing;
3- | ^^^^^^^
4-raz: 1 error

test/err/StmtNoModule.raz deleted +0 -3

@@ -1,3 +0,0 @@
1-module StmtNoModule;
2-import Nothing;
3-end StmtNoModule.

test/err/StmtNotCase.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtNotCase.raz:11:7: error: square isn't a case of S
2- 11 | | square: s := dot;
3- | ^^^^^^
4-raz: 1 error

test/err/StmtNotCase.raz deleted +0 -15

@@ -1,15 +0,0 @@
1-module StmtNotCase;
2-type S = variant
3- circle(r: F64);
4- rect(w, h: F64);
5- dot;
6-end;
7-proc main*;
8-var s: S;
9-begin
10- match s of
11- | square: s := dot;
12- | else:
13- end;
14-end;
15-end StmtNotCase.

test/err/StmtNotStmt.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtNotStmt.raz:6:5: error: a value isn't a statement
2- 6 | r.a;
3- | ^^^
4-raz: 1 error

test/err/StmtNotStmt.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module StmtNotStmt;
2-type R = record a: I64; end;
3-proc main*;
4-var r: R;
5-begin
6- r.a;
7-end;
8-end StmtNotStmt.

test/err/StmtParamName.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/mods/StmtParam.raz:1:18: error: expected a name, found a number
2- 1 | module StmtParam(5);
3- | ^
4-raz: 1 error

test/err/StmtParamName.raz deleted +0 -6

@@ -1,6 +0,0 @@
1-module StmtParamName;
2-import L := StmtParam(I64);
3-
4-var l: L.T;
5-
6-end StmtParamName.

test/err/StmtProcName.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtProcName.raz:2:23: error: expected main, found mian
2- 2 | proc main*; begin end mian;
3- | ^^^^
4-raz: 1 error

test/err/StmtProcName.raz deleted +0 -3

@@ -1,3 +0,0 @@
1-module StmtProcName;
2-proc main*; begin end mian;
3-end StmtProcName.

test/err/StmtResults.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtResults.raz:6:16: error: expected a call with 3 results
2- 6 | a, b, c := two();
3- | ^^^^^
4-raz: 1 error

test/err/StmtResults.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module StmtResults;
2-proc two: (I64, I64); begin return 1, 2; end;
3-proc main*;
4-var a, b, c: I64;
5-begin
6- a, b, c := two();
7-end;
8-end StmtResults.

test/err/StmtSigForward.err deleted +0 -10

@@ -1,10 +0,0 @@
1-test/err/StmtSigForward.raz:3:6: error: f doesn't have the signature it was declared forward with
2- 3 | proc f(a: BOOL); begin end;
3- | ^
4-test/err/StmtSigForward.raz:2:6: note: the signature is here
5- 2 | proc f(a: I64); forward;
6- | ^
7-test/err/StmtSigForward.raz:4:19: error: f is declared forward but never defined
8- 4 | end StmtSigForward.
9- | ^
10-raz: 2 errors

test/err/StmtSigForward.raz deleted +0 -4

@@ -1,4 +0,0 @@
1-module StmtSigForward;
2-proc f(a: I64); forward;
3-proc f(a: BOOL); begin end;
4-end StmtSigForward.

test/err/StmtStatement.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtStatement.raz:5:13: error: expected a statement, found ")"
2- 5 | a := 1; )
3- | ^
4-raz: 1 error

test/err/StmtStatement.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module StmtStatement;
2-proc main*;
3-var a: I64;
4-begin
5- a := 1; )
6-end;
7-end StmtStatement.

test/err/StmtVarOrProc.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/StmtVarOrProc.raz:2:8: error: expected "proc" or "var", found a number
2- 2 | extern 5;
3- | ^
4-raz: 1 error

test/err/StmtVarOrProc.raz deleted +0 -3

@@ -1,3 +0,0 @@
1-module StmtVarOrProc;
2-extern 5;
3-end StmtVarOrProc.

test/err/StmtWrongModule.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/mods/StmtOther.raz:1:8: error: expected module StmtOther, found StmtWrong
2- 1 | module StmtWrong;
3- | ^^^^^^^^^
4-raz: 1 error

test/err/StmtWrongModule.raz deleted +0 -3

@@ -1,3 +0,0 @@
1-module StmtWrongModule;
2-import StmtOther;
3-end StmtWrongModule.

test/err/TildeBool.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/TildeBool.raz:5:11: error: "~" needs an integer, found BOOL
2- 5 | b := ~b;
3- | ^
4-help: a BOOL is negated with not
5-raz: 1 error

test/err/TildeBool.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module TildeBool;
2-proc main*;
3-var b: BOOL; x: I64;
4-begin
5- b := ~b;
6-end;
7-end TildeBool.

test/err/Tuple.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/Tuple.raz:6:10: error: two returns several results
2- 6 | a := two() + 1;
3- | ^^^^^
4-help: they go to variables: a, b := two(...)
5-raz: 1 error

test/err/Tuple.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module Tuple;
2-proc two: (I64, I64); begin return 1, 2; end;
3-proc main*;
4-var a: I64;
5-begin
6- a := two() + 1;
7-end;
8-end Tuple.

test/err/TwoTypes.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/TwoTypes.raz:6:10: error: can't use List(I32).List as List(I64).List
2- 6 | a := b;
3- | ^
4-raz: 1 error

test/err/TwoTypes.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module TwoTypes;
2-import A := List(I64), B := List(I32);
3-proc main*;
4-var a: A.List; b: B.List;
5-begin
6- a := b;
7-end;
8-end TwoTypes.

test/err/Utf.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/Utf.raz:2:5: error: only ASCII outside strings, characters and comments
2- 2 | var é: I64;
3- | ^
4-raz: 1 error

test/err/Utf.raz deleted +0 -3

@@ -1,3 +0,0 @@
1-module Utf;
2-var é: I64;
3-end Utf.

test/err/Volatile.err deleted +0 -4

@@ -1,4 +0,0 @@
1-test/err/Volatile.raz:6:10: error: can't use ^VOLATILE I64 as ^I64
2- 6 | q := p;
3- | ^
4-raz: 1 error

test/err/Volatile.raz deleted +0 -8

@@ -1,8 +0,0 @@
1-module Volatile;
2-proc main*;
3-var x: I64; p: ^VOLATILE I64; q: ^I64;
4-begin
5- p := ADR(x);
6- q := p;
7-end;
8-end Volatile.

test/err/XorBools.err deleted +0 -5

@@ -1,5 +0,0 @@
1-test/err/XorBools.raz:5:10: error: "xor" needs integers, found BOOL
2- 5 | b := b xor true;
3- | ^
4-help: BOOLs that differ are #
5-raz: 1 error

test/err/XorBools.raz deleted +0 -7

@@ -1,7 +0,0 @@
1-module XorBools;
2-proc main*;
3-var b: BOOL; x: I64;
4-begin
5- b := b xor true;
6-end;
7-end XorBools.

test/err/mods/Cycle.raz deleted +0 -3

@@ -1,3 +0,0 @@
1-module Cycle;
2-import CycleB;
3-end Cycle.

test/err/mods/CycleB.raz deleted +0 -3

@@ -1,3 +0,0 @@
1-module CycleB;
2-import Cycle;
3-end CycleB.

test/err/mods/DeclHidden.raz deleted +0 -4

@@ -1,4 +0,0 @@
1-module DeclHidden;
2-const shown* = 1;
3-const hidden = 2;
4-end DeclHidden.

test/err/mods/StmtOther.raz deleted +0 -2

@@ -1,2 +0,0 @@
1-module StmtWrong;
2-end StmtWrong.

test/err/mods/StmtParam.raz deleted +0 -2

@@ -1,2 +0,0 @@
1-module StmtParam(5);
2-end StmtParam.

test/gdb.sh (history) modified +5 -5

@@ -4,11 +4,11 @@
44 # caller.
55 out=build/check
66 mkdir -p $out
7-./raz -I test/run/mods -o $out/Procs test/run/Procs.raz || exit 1
8-gdb -batch -ex 'break test/run/Procs.raz:13' -ex run -ex bt $out/Procs > $out/gdb.out 2>&1
9-for want in 'Breakpoint 1, Procs.odd () at test/run/Procs.raz:13' \
10- 'in Procs.even () at test/run/Procs.raz:20' \
11- 'in Procs.main () at test/run/Procs.raz:'; do
7+./raz -I conform/run/mods -o $out/Procs conform/run/Procs.raz || exit 1
8+gdb -batch -ex 'break conform/run/Procs.raz:13' -ex run -ex bt $out/Procs > $out/gdb.out 2>&1
9+for want in 'Breakpoint 1, Procs.odd () at conform/run/Procs.raz:13' \
10+ 'in Procs.even () at conform/run/Procs.raz:20' \
11+ 'in Procs.main () at conform/run/Procs.raz:'; do
1212 if ! grep -qF "$want" $out/gdb.out; then
1313 echo "FAIL gdb: no \"$want\""; cat $out/gdb.out; exit 1
1414 fi

test/msg/AmpBools.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/AmpBools.raz:5:10: error: "&" needs integers, found BOOL
2+ 5 | b := b & true;
3+ | ^
4+help: BOOLs take and
5+raz: 1 error

test/msg/ArrayEqReal.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/ArrayEqReal.raz:6:8: error: can't compare arrays of reals with "="
2+ 6 | if a = b then end;
3+ | ^^^^^
4+help: -0.0 = 0.0 and a NaN equals nothing, though their bytes say otherwise: write a loop
5+raz: 1 error

test/msg/ArrayEqRecord.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/ArrayEqRecord.raz:6:8: error: can't compare arrays of record with "="
2+ 6 | if a = b then end;
3+ | ^^^^^
4+help: write a loop
5+raz: 1 error

test/msg/ArrayEqTypes.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ArrayEqTypes.raz:6:8: error: can't compare an array of I64 with one of I32
2+ 6 | if a # b then end;
3+ | ^^^^^
4+raz: 1 error

test/msg/Assign.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/Assign.raz:5:10: error: can't use I32 as I64
2+ 5 | a := b;
3+ | ^
4+raz: 1 error

test/msg/AtAnd.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/AtAnd.raz:5:16: error: "and" needs BOOLs, found I64
2+ 5 | b := b and (x + 1);
3+ | ^^^^^^^
4+help: the bits of integers take &
5+raz: 1 error

test/msg/AtArgType.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtArgType.raz:7:8: error: can't use BOOL as I64
2+ 7 | Id(b);
3+ | ^
4+raz: 1 error

test/msg/AtBinary.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtBinary.raz:5:10: error: I64 and BOOL are different types
2+ 5 | x := (x + 2) * b;
3+ | ^^^^^^^^^^^
4+raz: 1 error

test/msg/AtCall.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtCall.raz:5:10: error: expected a procedure, found I64
2+ 5 | x := x(1);
3+ | ^
4+raz: 1 error

test/msg/AtCondition.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtCondition.raz:5:8: error: a condition is a BOOL, found I64
2+ 5 | if x + 1 then end;
3+ | ^^^^^
4+raz: 1 error

test/msg/AtConstFit.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtConstFit.raz:5:10: error: 3000000005 doesn't fit I32
2+ 5 | x := 5 + 3000000000;
3+ | ^^^^^^^^^^^^^^
4+raz: 1 error

test/msg/AtConvert.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtConvert.raz:5:14: error: can't convert BOOL to I64
2+ 5 | x := I64(b);
3+ | ^
4+raz: 1 error

test/msg/AtDeref.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtDeref.raz:5:10: error: expected a pointer, found I64
2+ 5 | y := x^;
3+ | ^
4+raz: 1 error

test/msg/AtDivZero.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtDivZero.raz:5:10: error: division by zero
2+ 5 | x := 7 div (3 - 3);
3+ | ^^^^^^^^^^^^^
4+raz: 1 error

test/msg/AtIndex.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtIndex.raz:5:12: error: an index is an integer, found BOOL
2+ 5 | x := a[b];
3+ | ^
4+raz: 1 error

test/msg/AtMany.err (history) added +7 -0

@@ -0,0 +1,7 @@
1+conform/err/AtMany.raz:7:16: error: too many arguments: Id takes 1
2+ 7 | x := Id(1, 2 * 3);
3+ | ^^^^^
4+conform/err/AtMany.raz:2:6: note: the signature is here
5+ 2 | proc Id(a: I64): I64;
6+ | ^^
7+raz: 1 error

test/msg/AtMatch.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtMatch.raz:5:11: error: match needs a variant or an enumeration, found I64
2+ 5 | match x + 1 do end;
3+ | ^^^^^
4+raz: 1 error

test/msg/AtNegate.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtNegate.raz:5:10: error: can't negate BOOL
2+ 5 | x := -b;
3+ | ^^
4+raz: 1 error

test/msg/AtNot.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtNot.raz:5:14: error: "not" needs a BOOL, found []U8
2+ 5 | b := not s;
3+ | ^
4+raz: 1 error

test/msg/AtNotValue.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtNotValue.raz:5:10: error: I64 is a type, not a value
2+ 5 | x := I64 + 1;
3+ | ^^^
4+raz: 1 error

test/msg/AtPAdr.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPAdr.raz:5:14: error: ADR needs a variable
2+ 5 | p := ADR(1);
3+ | ^
4+raz: 1 error

test/msg/AtPArrayLen.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPArrayLen.raz:2:9: error: an array's length is from 1 to 2^40, found 0
2+ 2 | var a: [0]I64;
3+ | ^
4+raz: 1 error

test/msg/AtPCantAssign.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPCantAssign.raz:7:8: error: can't assign to k
2+ 7 | a, k := two();
3+ | ^
4+raz: 1 error

test/msg/AtPChar.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPChar.raz:5:12: error: unexpected character "?"
2+ 5 | a := 1 ? 2;
3+ | ^
4+raz: 1 error

test/msg/AtPComment.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPComment.raz:5:1: error: comment not closed
2+ 5 | (* never closed
3+ | ^^
4+raz: 1 error

test/msg/AtPConstExpr.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPConstExpr.raz:4:9: error: expected a constant
2+ 4 | var a: [n]I64;
3+ | ^
4+raz: 1 error

test/msg/AtPElems.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPElems.raz:5:10: error: expected 3 elements, found 2
2+ 5 | a := [1, 2];
3+ | ^^^^^^
4+raz: 1 error

test/msg/AtPEscape.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPEscape.raz:5:12: error: unknown escape \q
2+ 5 | s := "a\q";
3+ | ^^
4+raz: 1 error

test/msg/AtPInc.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPInc.raz:5:9: error: INC needs an integer variable
2+ 5 | INC(a);
3+ | ^
4+raz: 1 error

test/msg/AtPLen.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPLen.raz:5:14: error: LEN needs an array or a slice, found I64
2+ 5 | a := LEN(a);
3+ | ^
4+raz: 1 error

test/msg/AtPNewVar.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPNewVar.raz:5:9: error: NEW needs a pointer variable
2+ 5 | NEW(a, a);
3+ | ^
4+raz: 1 error

test/msg/AtPNoResult.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPNoResult.raz:8:10: error: p returns nothing
2+ 8 | a := p() + 1;
3+ | ^^^
4+raz: 1 error

test/msg/AtPNotRecord.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPNotRecord.raz:5:10: error: expected a record, found I64
2+ 5 | a := a.f;
3+ | ^
4+raz: 1 error

test/msg/AtPNotStmt.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPNotStmt.raz:5:5: error: a isn't a statement
2+ 5 | a;
3+ | ^
4+raz: 1 error

test/msg/AtPSetLit.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPSetLit.raz:6:14: error: 1 isn't a name of C
2+ 6 | s := {r, 1};
3+ | ^
4+raz: 1 error

test/msg/AtPStep.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPStep.raz:5:24: error: the step can't be zero
2+ 5 | for i := 1 to 5 by 1 - 1 do end;
3+ | ^^^^^
4+raz: 1 error

test/msg/AtPtrMinus.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtPtrMinus.raz:5:10: error: ^I64 and ^I32 are different types
2+ 5 | x := p - q;
3+ | ^^^^^
4+raz: 1 error

test/msg/AtReturn.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtReturn.raz:4:12: error: this procedure returns nothing
2+ 4 | return 1 + 2;
3+ | ^^^^^
4+raz: 1 error

test/msg/AtSliceHi.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtSliceHi.raz:5:15: error: an index is an integer, found BOOL
2+ 5 | s := a[0..b];
3+ | ^
4+raz: 1 error

test/msg/AtSliceLo.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtSliceLo.raz:5:12: error: an index is an integer, found BOOL
2+ 5 | s := a[b..2];
3+ | ^
4+raz: 1 error

test/msg/AtStrCmp.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtStrCmp.raz:5:8: error: can't compare an array with I64
2+ 5 | if s = x + 1 then end;
3+ | ^^^^^^^^^
4+raz: 1 error

test/msg/AtVarArg.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/AtVarArg.raz:7:9: error: a var parameter needs a variable
2+ 7 | Inc(1 + 2);
3+ | ^^^^^
4+raz: 1 error

test/msg/BadProc.err (history) added +7 -0

@@ -0,0 +1,7 @@
1+conform/err/BadProc.raz:2:33: error: cmp doesn't have the signature of hash
2+ 2 | import Str, M := Map([]U8, I64, Str.cmp, Str.eq);
3+ | ^^^^^^^
4+lib/Map.raz:4:18: note: the signature is here
5+ 4 | module Map(K, V; hash: proc(k: K): U64; eq: proc(a, b: K): BOOL);
6+ | ^^^^
7+raz: 1 error

test/msg/BarBools.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/BarBools.raz:5:10: error: "|" needs integers, found BOOL
2+ 5 | b := b | true;
3+ | ^
4+help: BOOLs take or
5+raz: 1 error

test/msg/BigI64.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/BigI64.raz:5:10: error: can't use U64 as I64
2+ 5 | i := 0FFFFFFFFFFFFFFFFH;
3+ | ^^^^^^^^^^^^^^^^^^
4+raz: 1 error

test/msg/Bounds.stderr (history) added +1 -0

@@ -0,0 +1 @@
1+conform/run/Bounds.raz:8:11: index 4 is out of range for a length of 4

test/msg/Break.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/Break.raz:4:5: error: break outside a loop
2+ 4 | break;
3+ | ^^^^^
4+raz: 1 error

test/msg/Cycle.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/mods/CycleB.raz:2:8: error: Cycle imports itself
2+ 2 | import Cycle;
3+ | ^^^^^
4+raz: 1 error

test/msg/DeclArrayUnknown.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeclArrayUnknown.raz:4:8: error: an array literal needs a known array or slice type
2+ 4 | if [1] = [1] then end;
3+ | ^
4+raz: 1 error

test/msg/DeclAtomicPtr.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeclAtomicPtr.raz:5:15: error: expected a pointer, found I64
2+ 5 | n := XADD(n, 1);
3+ | ^
4+raz: 1 error

test/msg/DeclEnumNames.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeclEnumNames.raz:2:10: error: an enumeration has at most 256 names
2+ 2 | type E = (
3+ | ^
4+raz: 1 error

test/msg/DeclFieldTwice.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeclFieldTwice.raz:6:17: error: field a is given twice
2+ 6 | r := {a: 1, a: 2};
3+ | ^
4+raz: 1 error

test/msg/DeclIntConst.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeclIntConst.raz:3:9: error: expected an integer constant, found 1.5
2+ 3 | var a: [1.5]I64;
3+ | ^^^
4+raz: 1 error

test/msg/DeclLitNoField.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeclLitNoField.raz:6:11: error: R has no field b
2+ 6 | r := {b: 1};
3+ | ^
4+raz: 1 error

test/msg/DeclNeedsFields.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeclNeedsFields.raz:9:10: error: circle needs its fields
2+ 9 | s := circle;
3+ | ^^^^^^
4+raz: 1 error

test/msg/DeclNewAllocator.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeclNewAllocator.raz:5:12: error: NEW needs a ^Mem.Allocator, found ^I64
2+ 5 | NEW(p, q);
3+ | ^
4+raz: 1 error

test/msg/DeclNoField.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeclNoField.raz:6:7: error: R has no field b
2+ 6 | r.b := 1;
3+ | ^
4+raz: 1 error

test/msg/DeclNotExported.err (history) added +10 -0

@@ -0,0 +1,10 @@
1+conform/err/mods/DeclHidden.raz:3:7: warning: constant hidden is never used
2+ 3 | const hidden = 2;
3+ | ^^^^^^
4+conform/err/DeclNotExported.raz:6:21: error: hidden isn't exported by DeclHidden
5+ 6 | n := DeclHidden.hidden;
6+ | ^^^^^^
7+conform/err/mods/DeclHidden.raz:3:7: note: hidden is declared here, without a *
8+ 3 | const hidden = 2;
9+ | ^^^^^^
10+raz: 1 error, 1 warning

test/msg/DeclNotType.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeclNotType.raz:4:8: error: n isn't a type
2+ 4 | var a: n;
3+ | ^
4+raz: 1 error

test/msg/DeclSetLitType.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeclSetLitType.raz:6:10: error: expected a set type, found I64
2+ 6 | n := {r};
3+ | ^
4+raz: 1 error

test/msg/DeclSetNames.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeclSetNames.raz:6:16: error: a set holds names of an enumeration, found 1
2+ 6 | s := {} + {1};
3+ | ^
4+raz: 1 error

test/msg/DeclSetType.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeclSetType.raz:3:15: error: a set needs an enumeration of at most 64 names, found I64
2+ 3 | var s: set of I64;
3+ | ^^^
4+raz: 1 error

test/msg/DeclSetUnknown.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeclSetUnknown.raz:4:8: error: {} needs a known set type
2+ 4 | if {} = {} then end;
3+ | ^^
4+raz: 1 error

test/msg/DeferBreak.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeferBreak.raz:5:15: error: break outside a loop
2+ 5 | defer break;
3+ | ^^^^^
4+raz: 1 error

test/msg/DeferDefer.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeferDefer.raz:4:11: error: defer can't be deferred
2+ 4 | defer defer f;
3+ | ^^^^^
4+raz: 1 error

test/msg/DeferReturn.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/DeferReturn.raz:4:11: error: return can't leave a deferred statement
2+ 4 | defer return 1;
3+ | ^^^^^^
4+raz: 1 error

test/msg/ErrOrder.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ErrOrder.raz:5:8: error: "<" doesn't apply to ERROR
2+ 5 | if A < B then end;
3+ | ^^^^^
4+raz: 1 error

test/msg/FirstUseLate.err (history) added +7 -0

@@ -0,0 +1,7 @@
1+conform/err/FirstUseLate.raz:2:18: error: Later isn't declared
2+ 2 | import L := List(Later);
3+ | ^^^^^
4+conform/err/FirstUseLate.raz:4:8: note: the instance is made here, where it is first used
5+ 4 | var l: L.List; (* made here, before Later is declared *)
6+ | ^
7+raz: 1 error

test/msg/GenBoolOp.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenBoolOp.raz:6:10: error: "+" doesn't apply to BOOL
2+ 6 | b := b + b;
3+ | ^^^^^
4+raz: 1 error

test/msg/GenConstOverflow.err (history) added +10 -0

@@ -0,0 +1,10 @@
1+conform/err/GenConstOverflow.raz:5:12: error: the constant is too big for I64
2+ 5 | Over = Big + 1;
3+ | ^^^^^^^
4+conform/err/GenConstOverflow.raz:6:13: error: the constant is too big for I64
5+ 6 | Twice = 4611686018427387904 * 2;
6+ | ^^^^^^^^^^^^^^^^^^^^^^^
7+conform/err/GenConstOverflow.raz:7:13: error: the constant is too big for I64
8+ 7 | Under = -Big - 2;
9+ | ^^^^^^^^
10+raz: 3 errors

test/msg/GenConvertString.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenConvertString.raz:6:14: error: can't convert a string
2+ 6 | x := I64("a");
3+ | ^^^
4+raz: 1 error

test/msg/GenConvertType.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenConvertType.raz:6:14: error: I64 is a type, not a value
2+ 6 | x := I64(I64);
3+ | ^^^
4+raz: 1 error

test/msg/GenDivOverflow.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenDivOverflow.raz:6:10: error: division overflows
2+ 6 | x := (-9223372036854775807 - 1) div (0 - 1);
3+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+raz: 1 error

test/msg/GenDotsRecord.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenDotsRecord.raz:7:20: error: only a single value goes to ...
2+ 7 | C.printf("%d", r);
3+ | ^
4+raz: 1 error

test/msg/GenEnumOp.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenEnumOp.raz:6:10: error: "+" doesn't apply to C
2+ 6 | c := c + c;
3+ | ^^^^^
4+raz: 1 error

test/msg/GenErrorString.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenErrorString.raz:2:18: error: an error is made from a string
2+ 2 | const E: ERROR = 1;
3+ | ^
4+raz: 1 error

test/msg/GenIntReal.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/GenIntReal.raz:6:10: error: I64 and F64 are different types
2+ 6 | y := x + y;
3+ | ^^^^^
4+help: convert one to the other's type, as in I64(y)
5+raz: 1 error

test/msg/GenIntTypes.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/GenIntTypes.raz:6:10: error: I32 and I64 are different types
2+ 6 | b := a + b;
3+ | ^^^^^
4+help: convert one to the other's type, as in I32(b)
5+raz: 1 error

test/msg/GenNotIndexable.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenNotIndexable.raz:6:10: error: expected an array, a slice or a pointer, found I64
2+ 6 | x := x[0];
3+ | ^
4+raz: 1 error

test/msg/GenNotVariable.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenNotVariable.raz:5:7: error: a var parameter needs a variable
2+ 5 | P(1);
3+ | ^
4+raz: 1 error

test/msg/GenPosition.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenPosition.raz:6:12: error: 5 isn't a position of C
2+ 6 | c := C(5);
3+ | ^
4+raz: 1 error

test/msg/GenPtrOp.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenPtrOp.raz:6:10: error: "+" doesn't apply to ^I64
2+ 6 | b := p + p;
3+ | ^^^^^
4+raz: 1 error

test/msg/GenRealOp.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenRealOp.raz:6:10: error: "mod" doesn't apply to F64
2+ 6 | x := x mod 2.0;
3+ | ^^^^^^^^^
4+raz: 1 error

test/msg/GenReturnNone.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenReturnNone.raz:2:28: error: return needs a result of I64
2+ 2 | proc P(): I64; begin return; end;
3+ | ^
4+raz: 1 error

test/msg/GenReturnNothing.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenReturnNothing.raz:2:22: error: this procedure returns nothing
2+ 2 | proc P; begin return 1; end;
3+ | ^
4+raz: 1 error

test/msg/GenSetOp.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenSetOp.raz:6:10: error: "<" doesn't apply to CS
2+ 6 | b := a < a;
3+ | ^^^^^
4+raz: 1 error

test/msg/GenSingleValue.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenSingleValue.raz:6:10: error: expected a single value, found R
2+ 6 | x := r + 1;
3+ | ^
4+raz: 1 error

test/msg/GenSlash.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/GenSlash.raz:6:10: error: "/" divides reals, not integers
2+ 6 | x := 6 / 3;
3+ | ^^^^^
4+help: to divide integers, write 6 div 3
5+raz: 1 error

test/msg/GenSlashVar.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/GenSlashVar.raz:6:10: error: "/" divides reals, not integers
2+ 6 | x := x / y;
3+ | ^^^^^
4+help: to divide integers, write x div y
5+raz: 1 error

test/msg/GenStringAs.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenStringAs.raz:6:10: error: can't use a string as I64
2+ 6 | x := "a";
3+ | ^^^
4+raz: 1 error

test/msg/GenStringOperand.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenStringOperand.raz:6:10: error: a string can't be an operand
2+ 6 | x := "a" + 1;
3+ | ^^^
4+raz: 1 error

test/msg/GenTooFew.err (history) added +7 -0

@@ -0,0 +1,7 @@
1+conform/err/GenTooFew.raz:6:14: error: too few arguments: Id takes 1
2+ 6 | x := Id();
3+ | ^
4+conform/err/GenTooFew.raz:2:6: note: the signature is here
5+ 2 | proc Id(a: I64): I64; begin return a; end;
6+ | ^^
7+raz: 1 error

test/msg/GenTooFewValue.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenTooFewValue.raz:6:8: error: too few arguments
2+ 6 | f();
3+ | ^
4+raz: 1 error

test/msg/GenTooManyValue.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenTooManyValue.raz:6:10: error: too many arguments
2+ 6 | f(1, 2);
3+ | ^
4+raz: 1 error

test/msg/GenVarExact.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenVarExact.raz:6:7: error: a var parameter needs exactly I64, found I32
2+ 6 | P(x);
3+ | ^
4+raz: 1 error

test/msg/GenVolCompare.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenVolCompare.raz:6:10: error: can't compare through a volatile pointer
2+ 6 | b := p^ = "a";
3+ | ^^
4+raz: 1 error

test/msg/GenVolCopy.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenVolCopy.raz:6:10: error: can't copy through a volatile pointer
2+ 6 | r := p^;
3+ | ^^
4+raz: 1 error

test/msg/GenVolSlice.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenVolSlice.raz:6:10: error: can't make a slice through a volatile pointer
2+ 6 | s := p^;
3+ | ^^
4+raz: 1 error

test/msg/GenVolVar.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/GenVolVar.raz:6:7: error: can't pass through a volatile pointer to a var parameter
2+ 6 | P(p^);
3+ | ^^
4+raz: 1 error

test/msg/Kinds.stderr (history) added +1 -0

@@ -0,0 +1 @@
1+conform/run/Kinds.raz:92:16: 5 isn't a position of Color

test/msg/Match.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/Match.raz:9:5: error: no arm for c
2+ 9 | end;
3+ | ^^^
4+raz: 1 error

test/msg/Mixed.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/Mixed.raz:6:10: error: F32 and F64 are different types
2+ 6 | y := x + y;
3+ | ^^^^^
4+help: convert one to the other's type, as in F32(y)
5+raz: 1 error

test/msg/NegU64.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/NegU64.raz:5:10: error: -1 doesn't fit U64
2+ 5 | u := -1;
3+ | ^^
4+raz: 1 error

test/msg/NoArgs.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/NoArgs.raz:2:8: error: List needs a type for T
2+ 2 | import List;
3+ | ^^^^
4+raz: 1 error

test/msg/NotGeneric.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/NotGeneric.raz:2:8: error: Str isn't generic
2+ 2 | import S := Str(I64);
3+ | ^^^^^^^^^^^^^
4+raz: 1 error

test/msg/NotInt.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/NotInt.raz:5:14: error: "not" needs a BOOL, found I64
2+ 5 | x := not x;
3+ | ^
4+help: the bits of an integer flip with ~
5+raz: 1 error

test/msg/NoteBuiltin.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/NoteBuiltin.raz:5:10: error: len isn't declared
2+ 5 | x := len(y);
3+ | ^^^
4+help: did you mean LEN?
5+raz: 1 error

test/msg/NoteExport.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/NoteExport.raz:6:9: error: Int isn't exported by Out
2+ 6 | Out.Int(x);
3+ | ^^^
4+help: did you mean int?
5+raz: 1 error

test/msg/NoteField.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/NoteField.raz:6:7: error: P has no field cuont
2+ 6 | p.cuont := 1;
3+ | ^^^^^
4+help: did you mean count?
5+raz: 1 error

test/msg/NoteImport.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/NoteImport.raz:5:5: error: Fmt isn't declared
2+ 5 | Fmt.print(x);
3+ | ^^^
4+help: Fmt is a module: import Fmt
5+raz: 1 error

test/msg/NoteLocal.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/NoteLocal.raz:6:5: error: cuont isn't declared
2+ 6 | cuont := 1;
3+ | ^^^^^
4+help: did you mean count?
5+raz: 1 error

test/msg/OrInts.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/OrInts.raz:5:10: error: "or" needs BOOLs, found I64
2+ 5 | x := x or 1;
3+ | ^
4+help: the bits of integers take |
5+raz: 1 error

test/msg/PackedAddress.err (history) added +13 -0

@@ -0,0 +1,13 @@
1+conform/err/PackedAddress.raz:15:14: error: a field of a packed record has no address
2+ 15 | p := ADR(h.len);
3+ | ^^^^^
4+conform/err/PackedAddress.raz:16:9: error: a field of a packed record can't be a var parameter
5+ 16 | put(h.len);
6+ | ^^^^^
7+conform/err/PackedAddress.raz:17:10: error: can't make a slice of a field of a packed record
8+ 17 | s := h.vals[0..1];
9+ | ^^^^^^
10+conform/err/PackedAddress.raz:19:5: error: a field of a packed record can't be volatile
11+ 19 | q^.len := 2;
12+ | ^^
13+raz: 4 errors

test/msg/PassOnTypes.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/PassOnTypes.raz:10:12: error: expected the results (BOOL, I64), found (I64, BOOL)
2+ 10 | return two(n);
3+ | ^^^^^^
4+raz: 1 error

test/msg/PtrArray.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/PtrArray.raz:6:5: error: a pointer to an array is indexed as p^[i]
2+ 6 | p[1] := 0;
3+ | ^
4+raz: 1 error

test/msg/Recover.err (history) added +31 -0

@@ -0,0 +1,31 @@
1+conform/err/Recover.raz:6:27: error: Foo isn't declared
2+ 6 | P = record a: I64; b: Foo; end;
3+ | ^^^
4+conform/err/Recover.raz:9:8: error: Bar isn't declared
5+ 9 | var g: Bar;
6+ | ^^^
7+conform/err/Recover.raz:15:10: error: can't use I64 as BOOL
8+ 15 | b := x;
9+ | ^
10+conform/err/Recover.raz:16:10: error: y isn't declared
11+ 16 | x := y + 1;
12+ | ^
13+conform/err/Recover.raz:19:14: error: I64 and BOOL are different types
14+ 19 | x := (x + 2) * b;
15+ | ^^^^^^^^^^^
16+conform/err/Recover.raz:20:17: error: z isn't declared
17+ 20 | Out.int(z);
18+ | ^
19+conform/err/Recover.raz:22:12: error: I64 and BOOL are different types
20+ 22 | return x + true;
21+ | ^^^^^^^^
22+conform/err/Recover.raz:28:7: error: Q has no field c
23+ 28 | q.c := 1;
24+ | ^
25+conform/err/Recover.raz:30:18: error: expected ";", found "return"
26+ 30 | Out.str("hi")
27+ | ^
28+conform/err/Recover.raz:37:13: error: nope isn't declared
29+ 37 | Out.int(nope(2));
30+ | ^^^^
31+raz: 10 errors

test/msg/Resync.err (history) added +22 -0

@@ -0,0 +1,22 @@
1+conform/err/Resync.raz:10:5: error: expected ";", found a
2+ 10 | end a;
3+ | ^
4+conform/err/Resync.raz:14:31: error: expected ";", found "end"
5+ 14 | while x > 0 do x := x - 1 end;
6+ | ^^^
7+conform/err/Resync.raz:15:10: error: expected an expression, found ")"
8+ 15 | x := ) + 2;
9+ | ^
10+conform/err/Resync.raz:16:11: error: match needs a variant or an enumeration, found I64
11+ 16 | match x
12+ | ^
13+conform/err/Resync.raz:23:13: error: expected an expression, found ";"
14+ 23 | x := 1 +;
15+ | ^
16+conform/err/Resync.raz:23:14: error: expected "end", found "proc"
17+ 23 | x := 1 +;
18+ | ^
19+conform/err/Resync.raz:27:10: error: can't use BOOL as I64
20+ 27 | x := false;
21+ | ^^^^^
22+raz: 7 errors

test/msg/ScanBigDec.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanBigDec.raz:5:10: error: 9223372036854775808 is too big for I64
2+ 5 | x := 9223372036854775808;
3+ | ^^^^^^^^^^^^^^^^^^^
4+raz: 1 error

test/msg/ScanBigHex.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanBigHex.raz:5:10: error: 10000000000000000 is too big for U64
2+ 5 | x := 10000000000000000H;
3+ | ^^^^^^^^^^^^^^^^^
4+raz: 1 error

test/msg/ScanCharEmpty.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanCharEmpty.raz:5:10: error: empty character
2+ 5 | c := '';
3+ | ^
4+raz: 1 error

test/msg/ScanCharOpen.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanCharOpen.raz:5:10: error: character not closed
2+ 5 | c := 'ab';
3+ | ^^
4+raz: 1 error

test/msg/ScanCodePoint.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanCodePoint.raz:5:11: error: 110000 isn't a code point
2+ 5 | s := "\u{110000}";
3+ | ^^^^^^^^^^
4+raz: 1 error

test/msg/ScanComment.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanComment.raz:4:5: error: comment not closed
2+ 4 | (* never closed
3+ | ^^
4+raz: 1 error

test/msg/ScanExponent.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanExponent.raz:5:10: error: expected a digit in the exponent
2+ 5 | x := 1.5E+;
3+ | ^^^^^
4+raz: 1 error

test/msg/ScanHexChar.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanHexChar.raz:5:11: error: \x is only for strings
2+ 5 | c := '\x41';
3+ | ^^
4+raz: 1 error

test/msg/ScanHexDigits.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanHexDigits.raz:5:11: error: \x needs two hex digits
2+ 5 | s := "\xZ1";
3+ | ^^^^
4+raz: 1 error

test/msg/ScanHexH.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanHexH.raz:5:10: error: a hex number ends with H
2+ 5 | x := 12A;
3+ | ^^^
4+raz: 1 error

test/msg/ScanMain.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanMain.raz:2:6: error: main must be proc main* or proc main*: I64
2+ 2 | proc main*(_n: I64);
3+ | ^^^^
4+raz: 1 error

test/msg/ScanName.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanName.raz:4:5: error: a name has at most 63 characters
2+ 4 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
3+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+raz: 1 error

test/msg/ScanNameDigit.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanNameDigit.raz:5:10: error: a name can't start with a digit
2+ 5 | x := 12abc;
3+ | ^^
4+raz: 1 error

test/msg/ScanNul.err (history) added

Binary file; the patch has it.

test/msg/ScanRealBig.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanRealBig.raz:5:10: error: 1.8E308 is out of the range of F64
2+ 5 | x := 1.8E308;
3+ | ^^^^^^^
4+raz: 1 error

test/msg/ScanRealHex.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanRealHex.raz:5:10: error: a decimal number has only the digits 0 to 9
2+ 5 | x := 1A.5;
3+ | ^^
4+raz: 1 error

test/msg/ScanStringOpen.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanStringOpen.raz:5:10: error: string not closed
2+ 5 | s := "abc;
3+ | ^^^^^
4+raz: 1 error

test/msg/ScanTwice.err (history) added +7 -0

@@ -0,0 +1,7 @@
1+conform/err/ScanTwice.raz:4:5: error: x is declared twice
2+ 4 | x: I64;
3+ | ^
4+conform/err/ScanTwice.raz:3:5: note: the first one is here
5+ 3 | var x: I64;
6+ | ^
7+raz: 1 error

test/msg/ScanUBad.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanUBad.raz:5:11: error: expected hex digits and "}" after \u{
2+ 5 | s := "\u{41";
3+ | ^^^^^
4+raz: 1 error

test/msg/ScanUBig.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanUBig.raz:5:11: error: a code point has at most 6 hex digits
2+ 5 | s := "\u{1234567}";
3+ | ^^^^^^^^^^
4+raz: 1 error

test/msg/ScanUBrace.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanUBrace.raz:5:11: error: expected "{" after \u
2+ 5 | s := "\u0041";
3+ | ^^
4+raz: 1 error

test/msg/ScanUtf8.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/ScanUtf8.raz:5:11: error: invalid UTF-8
2+ 5 | s := "ÿ";
3+ | ^
4+raz: 1 error

test/msg/SliceBounds.stderr (history) added +1 -0

@@ -0,0 +1 @@
1+conform/run/SliceBounds.raz:10:23: slice 9..6 is out of range for a length of 8

test/msg/SliceIndex.stderr (history) added +1 -0

@@ -0,0 +1 @@
1+conform/run/SliceIndex.raz:11:11: index 3 is out of range for a length of 3

test/msg/SlicePtrBackwards.stderr (history) added +1 -0

@@ -0,0 +1 @@
1+conform/run/SlicePtrBackwards.raz:11:23: slice 2..0 runs backwards

test/msg/SlipAnd.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/SlipAnd.raz:5:16: error: "and" is written and, not &&
2+ 5 | if (x = 1) && (y = 2) then x := 2; end;
3+ | ^^
4+raz: 1 error

test/msg/SlipAssign.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/SlipAssign.raz:5:5: error: x isn't a statement
2+ 5 | x = 1;
3+ | ^
4+help: assignment is written :=
5+raz: 1 error

test/msg/SlipBrace.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/SlipBrace.raz:5:14: error: expected "then", found "{"
2+ 5 | if x = 1 { x := 2 }
3+ | ^
4+help: a block is written "then" ... end
5+raz: 1 error

test/msg/SlipDo.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/SlipDo.raz:5:17: error: expected "do", found "{"
2+ 5 | while x < 3 { x := x + 1 }
3+ | ^
4+help: a block is written "do" ... end
5+raz: 1 error

test/msg/SlipElif.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/SlipElif.raz:5:27: error: elif isn't declared
2+ 5 | if x = 1 then x := 2; elif x = 3 then x := 4; end;
3+ | ^^^^
4+help: raz writes elsif
5+raz: 1 error

test/msg/SlipEql.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/SlipEql.raz:5:10: error: comparing is written =, not ==
2+ 5 | if x == 1 then x := 2; end;
3+ | ^^
4+raz: 1 error

test/msg/SlipMany.err (history) added +10 -0

@@ -0,0 +1,10 @@
1+conform/err/SlipMany.raz:5:10: error: "not equal" is written #, not !=
2+ 5 | if x != 1 && z then x := y; end;
3+ | ^^
4+conform/err/SlipMany.raz:5:15: error: "and" is written and, not &&
5+ 5 | if x != 1 && z then x := y; end;
6+ | ^^
7+conform/err/SlipMany.raz:5:18: error: z isn't declared
8+ 5 | if x != 1 && z then x := y; end;
9+ | ^
10+raz: 3 errors

test/msg/SlipNeq.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/SlipNeq.raz:5:10: error: "not equal" is written #, not !=
2+ 5 | if x != 1 then x := 2; end;
3+ | ^^
4+raz: 1 error

test/msg/SlipNot.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/SlipNot.raz:5:8: error: "not" is written not, not !
2+ 5 | if ! (x = 1) then x := 2; end;
3+ | ^
4+raz: 1 error

test/msg/SlipOr.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/SlipOr.raz:5:16: error: "or" is written or, not ||
2+ 5 | if (x = 1) || (y = 2) then x := 2; end;
3+ | ^^
4+raz: 1 error

test/msg/StmtArgKind.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtArgKind.raz:2:23: error: Page isn't a type or a procedure
2+ 2 | import Mem, L := List(Mem.Page);
3+ | ^^^^^^^^
4+raz: 1 error

test/msg/StmtAssignConst.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtAssignConst.raz:5:5: error: can't assign to k
2+ 5 | k := 2;
3+ | ^
4+raz: 1 error

test/msg/StmtAssignValue.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtAssignValue.raz:7:8: error: can't assign to a value
2+ 7 | r, f().a := f(), f().a;
3+ | ^^^^^
4+raz: 1 error

test/msg/StmtCaseName.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtCaseName.raz:11:7: error: expected a case, found a number
2+ 11 | | 5:
3+ | ^
4+raz: 1 error

test/msg/StmtCaseTwice.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtCaseTwice.raz:12:7: error: dot has two arms
2+ 12 | | dot:
3+ | ^^^
4+raz: 1 error

test/msg/StmtDot.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtDot.raz:2:12: error: expected ".", found ";"
2+ 2 | end StmtDot;
3+ | ^
4+raz: 1 error

test/msg/StmtElseLast.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtElseLast.raz:12:7: error: else must be the last arm
2+ 12 | | dot:
3+ | ^^^
4+raz: 1 error

test/msg/StmtEnd.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtEnd.raz:5:12: error: expected "end", found ")"
2+ 5 | a := 1;
3+ | ^
4+raz: 1 error

test/msg/StmtEndName.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtEndName.raz:2:5: error: expected StmtEndName, found Other
2+ 2 | end Other.
3+ | ^^^^^
4+raz: 1 error

test/msg/StmtErrType.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtErrType.raz:2:10: error: only an ERROR constant has a type
2+ 2 | const k: I64 = "a";
3+ | ^^^
4+raz: 1 error

test/msg/StmtFewFields.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtFewFields.raz:11:13: error: name all the fields of rect, or none
2+ 11 | | rect(w):
3+ | ^
4+raz: 1 error

test/msg/StmtFieldName.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtFieldName.raz:11:14: error: expected a name, found a number
2+ 11 | | circle(5):
3+ | ^
4+raz: 1 error

test/msg/StmtForName.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtForName.raz:5:9: error: k isn't a variable
2+ 5 | for k := 1 to 2 do end;
3+ | ^
4+raz: 1 error

test/msg/StmtForType.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtForType.raz:5:9: error: a for loop needs an integer or enumeration variable, found BOOL
2+ 5 | for b := 1 to 2 do end;
3+ | ^
4+raz: 1 error

test/msg/StmtForwardTwice.err (history) added +7 -0

@@ -0,0 +1,7 @@
1+conform/err/StmtForwardTwice.raz:3:9: error: f is declared forward twice
2+ 3 | proc f; forward;
3+ | ^^^^^^^
4+conform/err/StmtForwardTwice.raz:4:21: error: f is declared forward but never defined
5+ 4 | end StmtForwardTwice.
6+ | ^
7+raz: 2 errors

test/msg/StmtFwdPtr.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtFwdPtr.raz:2:11: error: Missing isn't declared
2+ 2 | type P = ^Missing;
3+ | ^^^^^^^
4+raz: 1 error

test/msg/StmtImportName.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtImportName.raz:2:8: error: expected a module name, found a number
2+ 2 | import 5;
3+ | ^
4+raz: 1 error

test/msg/StmtManyFields.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtManyFields.raz:11:17: error: more names than circle has fields
2+ 11 | | circle(r, x):
3+ | ^
4+raz: 1 error

test/msg/StmtManyTypeArgs.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtManyTypeArgs.raz:2:8: error: too many type arguments for List
2+ 2 | import L := List(I64, I64);
3+ | ^^^^^^^^^^^^^^^^^^^
4+raz: 1 error

test/msg/StmtNeedProc.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtNeedProc.raz:2:33: error: Map needs a procedure for hash
2+ 2 | import Str, M := Map([]U8, I64, I64, Str.eq);
3+ | ^^^
4+raz: 1 error

test/msg/StmtNeedType.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtNeedType.raz:2:22: error: Map needs a type for K
2+ 2 | import Str, M := Map(Str.cmp, I64, Str.cmp, Str.eq);
3+ | ^^^^^^^
4+raz: 1 error

test/msg/StmtNest.err (history) added +7 -0

@@ -0,0 +1,7 @@
1+conform/err/StmtNest.raz:3:3: error: procedures don't nest
2+ 3 | proc inner; forward;
3+ | ^^^^
4+conform/err/StmtNest.raz:5:5: error: expected "begin", found "end"
5+ 5 | end;
6+ | ^
7+raz: 2 errors

test/msg/StmtNeverDefined.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtNeverDefined.raz:3:21: error: f is declared forward but never defined
2+ 3 | end StmtNeverDefined.
3+ | ^
4+raz: 1 error

test/msg/StmtNoModule.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtNoModule.raz:2:8: error: can't find module Nothing
2+ 2 | import Nothing;
3+ | ^^^^^^^
4+raz: 1 error

test/msg/StmtNotCase.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtNotCase.raz:11:7: error: square isn't a case of S
2+ 11 | | square: s := dot;
3+ | ^^^^^^
4+raz: 1 error

test/msg/StmtNotStmt.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtNotStmt.raz:6:5: error: a value isn't a statement
2+ 6 | r.a;
3+ | ^^^
4+raz: 1 error

test/msg/StmtParamName.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/mods/StmtParam.raz:1:18: error: expected a name, found a number
2+ 1 | module StmtParam(5);
3+ | ^
4+raz: 1 error

test/msg/StmtProcName.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtProcName.raz:2:23: error: expected main, found mian
2+ 2 | proc main*; begin end mian;
3+ | ^^^^
4+raz: 1 error

test/msg/StmtResults.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtResults.raz:6:16: error: expected a call with 3 results
2+ 6 | a, b, c := two();
3+ | ^^^^^
4+raz: 1 error

test/msg/StmtSigForward.err (history) added +10 -0

@@ -0,0 +1,10 @@
1+conform/err/StmtSigForward.raz:3:6: error: f doesn't have the signature it was declared forward with
2+ 3 | proc f(a: BOOL); begin end;
3+ | ^
4+conform/err/StmtSigForward.raz:2:6: note: the signature is here
5+ 2 | proc f(a: I64); forward;
6+ | ^
7+conform/err/StmtSigForward.raz:4:19: error: f is declared forward but never defined
8+ 4 | end StmtSigForward.
9+ | ^
10+raz: 2 errors

test/msg/StmtStatement.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtStatement.raz:5:13: error: expected a statement, found ")"
2+ 5 | a := 1; )
3+ | ^
4+raz: 1 error

test/msg/StmtVarOrProc.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/StmtVarOrProc.raz:2:8: error: expected "proc" or "var", found a number
2+ 2 | extern 5;
3+ | ^
4+raz: 1 error

test/msg/StmtWrongModule.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/mods/StmtOther.raz:1:8: error: expected module StmtOther, found StmtWrong
2+ 1 | module StmtWrong;
3+ | ^^^^^^^^^
4+raz: 1 error

test/msg/TildeBool.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/TildeBool.raz:5:11: error: "~" needs an integer, found BOOL
2+ 5 | b := ~b;
3+ | ^
4+help: a BOOL is negated with not
5+raz: 1 error

test/msg/Tuple.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/Tuple.raz:6:10: error: two returns several results
2+ 6 | a := two() + 1;
3+ | ^^^^^
4+help: they go to variables: a, b := two(...)
5+raz: 1 error

test/msg/TwoTypes.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/TwoTypes.raz:6:10: error: can't use List(I32).List as List(I64).List
2+ 6 | a := b;
3+ | ^
4+raz: 1 error

test/msg/Utf.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/Utf.raz:2:5: error: only ASCII outside strings, characters and comments
2+ 2 | var é: I64;
3+ | ^
4+raz: 1 error

test/msg/Volatile.err (history) added +4 -0

@@ -0,0 +1,4 @@
1+conform/err/Volatile.raz:6:10: error: can't use ^VOLATILE I64 as ^I64
2+ 6 | q := p;
3+ | ^
4+raz: 1 error

test/msg/XorBools.err (history) added +5 -0

@@ -0,0 +1,5 @@
1+conform/err/XorBools.raz:5:10: error: "xor" needs integers, found BOOL
2+ 5 | b := b xor true;
3+ | ^
4+help: BOOLs that differ are #
5+raz: 1 error

test/run/Alloc.expect (history) deleted +0 -5

@@ -1,5 +0,0 @@
1-1001000
2-1001000
3-7
4-10100
5-nil again 0

test/run/Alloc.raz (history) deleted +0 -66

@@ -1,66 +0,0 @@
1-module Alloc;
2-import Out, Mem, Arena, Heap;
3-
4-type
5- Node = record next: ^Node; val: I64; pad: [5]I64; end;
6- Big = record data: [1000]I64; end;
7-
8-proc build(a: ^Mem.Allocator; n: I64): ^Node;
9-var head, p: ^Node; i: I64;
10-begin
11- head := nil;
12- for i := 1 to n do
13- NEW(p, a);
14- if p = nil then return nil; end;
15- if p^.val # 0 then Out.str("not zeroed "); end;
16- p^.val := i;
17- p^.pad[4] := i;
18- p^.next := head;
19- head := p;
20- end;
21- return head;
22-end;
23-
24-proc sum(p: ^Node): I64;
25-var s: I64;
26-begin
27- s := 0;
28- while p # nil do s := s + p^.val + p^.pad[4]; p := p^.next; end;
29- return s;
30-end;
31-
32-proc release(a: ^Mem.Allocator; p: ^Node);
33-var next: ^Node;
34-begin
35- while p # nil do
36- next := p^.next;
37- Mem.free(a, ^U8(p));
38- p := next;
39- end;
40-end;
41-
42-proc main*;
43-var ar: Arena.Arena; l, m: ^Node; b: ^Big; i: I64; small: ^U8; again: ^Node;
44-begin
45- l := build(Heap.heap, 1000);
46- Out.int(sum(l)); Out.ln;
47- release(Heap.heap, l);
48- m := build(Heap.heap, 1000);
49- Out.int(sum(m)); Out.ln;
50- NEW(b, Heap.heap);
51- b^.data[999] := 7;
52- Out.int(b^.data[999] + b^.data[0]); Out.ln;
53- Mem.free(Heap.heap, ^U8(b));
54- if not Arena.init(ADR(ar), 8192) then Out.str("no arena"); end;
55- l := build(ADR(ar.base), 100);
56- Out.int(sum(l)); Out.ln;
57- l := build(ADR(ar.base), 1000);
58- if l = nil then Out.str("nil "); end;
59- Arena.reset(ADR(ar));
60- NEW(again, ADR(ar.base));
61- if again # nil then Out.str("again "); Out.int(again^.val); end;
62- Out.ln;
63- Arena.done(ADR(ar));
64-end;
65-
66-end Alloc.

test/run/Args.args deleted +0 -3

@@ -1,3 +0,0 @@
1-one
2-two words
3-é

test/run/Args.expect deleted +0 -3

@@ -1,3 +0,0 @@
1-one
2-two words
3-é

test/run/Args.raz deleted +0 -18

@@ -1,18 +0,0 @@
1-module Args;
2-import Out;
3-
4-proc main*: I64;
5-var i, n: I64; a: ^^U8; s: ^U8;
6-begin
7- a := ARGV();
8- for i := 1 to ARGC() - 1 do
9- s := a[i];
10- n := 0;
11- while s[n] # 0 do n := n + 1; end;
12- Out.str(s[0..n]);
13- Out.ln;
14- end;
15- return ARGC();
16-end;
17-
18-end Args.

test/run/Args.status deleted +0 -1

@@ -1 +0,0 @@
1-4

test/run/Arith.expect deleted +0 -35

@@ -1,35 +0,0 @@
1-M 32
2-add 22
3-sub 12
4-mul 85
5-div -3
6-mod -1
7-divv -3
8-modv -2
9-prec 14
10-neg -85
11-u8wrap 44
12-i8wrap -128
13-u32wrap 1
14-u64>i 1
15-i64< 1
16-shl 1024
17-shr -4
18-ushr 15
19-and 8
20-or 15
21-xor 6
22-not -1
23-real 85
24-trunc -2
25-nan 0
26-rlt 1
27-u64real 18
28-bool 1
29-shortcut 1
30-global 42
31-char 65
32-utf8 233
33-hexconst 255
34-cut 44
35-sext -1

test/run/Arith.raz deleted +0 -74

@@ -1,74 +0,0 @@
1-module Arith;
2-import Out;
3-
4-const
5- K = 10;
6- M = K * 3 + 2;
7- Big = 0FFFFFFFFFFFFFFFFH;
8-
9-var g: I64;
10-
11-proc show(s: []U8; n: I64);
12-begin
13- Out.str(s); Out.str(" "); Out.int(n); Out.ln;
14-end;
15-
16-proc showb(s: []U8; t: BOOL);
17-begin
18- if t then show(s, 1); else show(s, 0); end;
19-end;
20-
21-proc main*;
22-var a, b: I64; u: U8; i8: I8; w: U32; x: U64; r: F64; t: BOOL;
23-begin
24- show("M", M);
25- a := 17; b := 5;
26- show("add", a + b);
27- show("sub", a - b);
28- show("mul", a * b);
29- show("div", -7 div 2);
30- show("mod", -7 mod 2);
31- show("divv", (0 - a) div b);
32- show("modv", (0 - a) mod b);
33- show("prec", 2 + 3 * 4);
34- show("neg", -a * b);
35- u := 200;
36- u := u + 100;
37- show("u8wrap", I64(u));
38- i8 := 127;
39- i8 := i8 + 1;
40- show("i8wrap", I64(i8));
41- w := 0FFFFFFFFH;
42- w := w + 2;
43- show("u32wrap", I64(w));
44- x := Big;
45- showb("u64>i", x > 5);
46- showb("i64<", -1 < 5);
47- show("shl", 1 shl 10);
48- show("shr", -16 shr 2);
49- show("ushr", I64(U64(-16) shr 60));
50- show("and", 12 & 10);
51- show("or", 12 | 3);
52- show("xor", 12 xor 10);
53- show("not", ~0);
54- r := F64(a) / 2.0;
55- show("real", I64(r * 10.0));
56- r := -2.75;
57- show("trunc", I64(r));
58- showb("nan", 0.0 / 0.0 = 0.0 / 0.0);
59- showb("rlt", 1.5 < 2.5);
60- show("u64real", I64(F64(x) / 1.0E18));
61- t := (a > 3) and (b < 3);
62- if not t then show("bool", 1); end;
63- t := (a > 3) or (g div 0 = 1);
64- if t then show("shortcut", 1); end;
65- g := 42;
66- show("global", g);
67- show("char", 'A');
68- show("utf8", 'é');
69- show("hexconst", 0FFH);
70- show("cut", I64(U8(300)));
71- show("sext", I64(I8(U8(255))));
72-end;
73-
74-end Arith.

test/run/ArrayEq.expect deleted +0 -1

@@ -1 +0,0 @@
1-TFFTTFTTTTFTTFTFTFTTTTT

test/run/ArrayEq.raz deleted +0 -41

@@ -1,41 +0,0 @@
1-module ArrayEq;
2-import Out;
3-
4-type Colour = (red, green, blue);
5-
6-proc say(b: BOOL);
7-begin
8- if b then Out.str("T"); else Out.str("F"); end;
9-end;
10-
11-proc main*;
12-var
13- a, b: [4]I64; s: []I64; e: []I64;
14- w: [3]U16; c, d: [2]Colour; f: [3]BOOL;
15- m, n: [2]set of Colour; p, q: [2]^I64; x: I64;
16- t: [5]U8;
17-begin
18- a := [1, 2, 3, 4]; b := [1, 2, 3, 4];
19- say(a = b); say(a # b);
20- b[3] := 5;
21- say(a = b); say(a # b);
22- s := a[0..3];
23- say(s = a[0..3]); say(s = a); (* of different lengths *)
24- say(a[1..1] = e); say(e = s[0..0]); (* empty *)
25- w := [1, 256, 65535];
26- say(w = [U16(1), 256, 65535]); say(w[2..3] = [U16(65535)]);
27- c := [red, blue]; d := [red, green];
28- say(c = d); d[1] := blue; say(c = d);
29- f := [true, false, true];
30- say(f[0..1] = f[2..3]); say(f[0..1] = [true, false]);
31- m := [{red}, {green, blue}]; n := m;
32- say(m = n); n[1] := {blue}; say(m = n);
33- p := [ADR(x), nil]; q := p;
34- say(p = q); q[1] := ADR(x); say(p = q);
35- t := [104, 101, 108, 108, 111];
36- say(t = "hello"); say("hello" = t[0..5]); say("hell" = t[0..4]);
37- say("help" # t[0..4]); say("" = t[0..0]);
38- Out.ln;
39-end;
40-
41-end ArrayEq.

test/run/AtExit.expect deleted +0 -5

@@ -1,5 +0,0 @@
1-12 refused
2-main ends
3-third
4-second, which exits again
5-first

test/run/AtExit.raz deleted +0 -41

@@ -1,41 +0,0 @@
1-(* Rt.exit runs what Rt.atExit registered, the last first, each once,
2- then ends the program with main's status. *)
3-module AtExit;
4-import Out, Rt;
5-
6-proc first;
7-begin
8- Out.str("first\n");
9-end;
10-
11-proc second;
12-begin
13- Out.str("second, which exits again\n");
14- Rt.exit(5); (* the rest still run, once each; the status is now 5 *)
15-end;
16-
17-proc third;
18-begin
19- Out.str("third\n");
20-end;
21-
22-proc nothing;
23-begin
24-end;
25-
26-proc main*: I64;
27-var i, full: I64;
28-begin
29- Rt.atExit(first);
30- Rt.atExit(second);
31- Rt.atExit(third);
32- full := 0;
33- for i := 1 to 40 do
34- if Rt.atExit(nothing) = Rt.Full then INC(full); end;
35- end;
36- Out.int(full); Out.str(" refused\n");
37- Out.str("main ends\n");
38- return 3;
39-end;
40-
41-end AtExit.

test/run/AtExit.status deleted +0 -1

@@ -1 +0,0 @@
1-5

test/run/Bodies.expect deleted +0 -1

@@ -1 +0,0 @@
1-First Second Bodies main 12

test/run/Bodies.raz deleted +0 -11

@@ -1,11 +0,0 @@
1-module Bodies;
2-import Out, A := First, Second;
3-
4-proc main*;
5-begin
6- Out.str("main "); Out.int(A.count); Out.int(Second.count); Out.ln;
7-end;
8-
9-begin
10- Out.str("Bodies ");
11-end Bodies.

test/run/Bounds.expect deleted +0 -1

@@ -1 +0,0 @@
1-0123
\ No newline at end of file

test/run/Bounds.raz deleted +0 -13

@@ -1,13 +0,0 @@
1-module Bounds;
2-import Out;
3-
4-proc main*;
5-var a: [4]I64; i: I64;
6-begin
7- for i := 0 to 4 do
8- a[i] := i;
9- Out.int(a[i]);
10- end;
11-end;
12-
13-end Bounds.

test/run/Bounds.status deleted +0 -1

@@ -1 +0,0 @@
1-2

test/run/Bounds.stderr deleted +0 -1

@@ -1 +0,0 @@
1-test/run/Bounds.raz:8:11: index 4 is out of range for a length of 4

test/run/Control.expect deleted +0 -8

@@ -1,8 +0,0 @@
1-12345
2-10 7 4 1
3-0 4 8
4-6
5-3
6-0 1 10 11 20 21
7-4
8-one two three many

test/run/Control.raz deleted +0 -42

@@ -1,42 +0,0 @@
1-module Control;
2-import Out;
3-
4-proc main*;
5-var i, j, n: I64; u: U8; k: I8;
6-begin
7- for i := 1 to 5 do Out.int(i); end; Out.ln;
8- for i := 10 to 1 by -3 do Out.int(i); Out.str(" "); end; Out.ln;
9- for i := 0 to 10 by 4 do Out.int(i); Out.str(" "); end; Out.ln;
10- for i := 5 to 1 do Out.str("never"); end;
11- n := 0;
12- for u := 250 to 255 do n := n + 1; end;
13- Out.int(n); Out.ln;
14- n := 0;
15- for k := 120 to 127 by 3 do n := n + 1; end;
16- Out.int(n); Out.ln;
17- i := 0;
18- while i < 3 do
19- j := 0;
20- while true do
21- if j = 2 then break; end;
22- Out.int(i * 10 + j); Out.str(" ");
23- j := j + 1;
24- end;
25- i := i + 1;
26- end;
27- Out.ln;
28- i := 0;
29- repeat i := i + 1; if i = 4 then break; end; until i = 10;
30- Out.int(i); Out.ln;
31- for i := 1 to 4 do
32- if i = 1 then Out.str("one");
33- elsif i = 2 then Out.str("two");
34- elsif i = 3 then Out.str("three");
35- else Out.str("many");
36- end;
37- Out.str(" ");
38- end;
39- Out.ln;
40-end;
41-
42-end Control.

test/run/Defers.expect deleted +0 -5

@@ -1,5 +0,0 @@
1-body body done
2-()30
3-56
4-[...*][...+**]
5-0

test/run/Defers.raz deleted +0 -71

@@ -1,71 +0,0 @@
1-module Defers;
2-import Out;
3-
4-type Pair = record a, b: I64; end;
5-
6-var depth: I64;
7-
8-proc enter(s: []U8);
9-begin
10- Out.str(s); INC(depth);
11-end;
12-
13-proc leave(s: []U8);
14-begin
15- Out.str(s); DEC(depth);
16-end;
17-
18-proc real(x: F64): F64;
19-begin
20- enter("(");
21- defer leave(")");
22- return x * 2.0;
23-end;
24-
25-proc pair(n: I64): Pair;
26-var p: Pair;
27-begin
28- defer p.a := 99;
29- p.a := n; p.b := n + 1;
30- return p;
31-end;
32-
33-proc begin_end(i: I64);
34-var k: I64;
35-begin
36- defer for k := 1 to i do Out.str("*"); end;
37- if i = 1 then return; end;
38- Out.str("+");
39-end;
40-
41-proc nested;
42-var i, j: I64;
43-begin
44- for i := 1 to 2 do
45- enter("[");
46- defer leave("]");
47- defer begin_end(i);
48- j := 0;
49- while true do
50- defer Out.str(".");
51- INC(j);
52- if j = 3 then break; end;
53- end;
54- end;
55-end;
56-
57-proc main*;
58-var p: Pair;
59-begin
60- Out.int(I64(real(1.5) * 10.0)); Out.ln;
61- p := pair(5);
62- Out.int(p.a); Out.int(p.b); Out.ln;
63- nested;
64- Out.ln;
65- Out.int(depth); Out.ln;
66-end;
67-
68-begin
69- defer Out.str("body done\n");
70- Out.str("body ");
71-end Defers.

test/run/FirstUse.expect deleted +0 -6

@@ -1,6 +0,0 @@
1-an instance of Loud, of size 1
2-an empty list
3-in main, Ones has size 1
4-sky not red
5-rose red
6-grass -

test/run/FirstUse.raz deleted +0 -34

@@ -1,34 +0,0 @@
1-module FirstUse;
2-import Out, Str, Heap, Table := Map([]U8, Colour, Str.hash, Str.eq),
3- Ints := List(I64), More := List(I64), Never := Loud(I64), Ones := Loud(U8);
4-
5-type Colour = (red, green, blue);
6-
7-var names: Table.Map; (* Table is made here, after Colour *)
8-
9-proc show(k: []U8);
10-var c: Colour; found: BOOL;
11-begin
12- c, found := Table.get(ADR(names), k);
13- Out.str(k);
14- if not found then Out.str(" -"); elsif c = red then Out.str(" red"); else Out.str(" not red"); end;
15- Out.ln;
16-end;
17-
18-(* Ones is first used in a procedure, and made before its code *)
19-proc main*;
20-var a: Ints.List; b: More.List;
21-begin
22- a := b; (* two imports, one instance *)
23- if a.head = nil then Out.str("an empty list\n"); end;
24- Out.str("in main, Ones has size "); Out.int(Ones.size); Out.ln;
25- show("sky");
26- show("rose");
27- show("grass");
28-end;
29-
30-begin
31- Table.init(ADR(names), Heap.heap);
32- Table.put(ADR(names), "rose", red);
33- Table.put(ADR(names), "sky", blue);
34-end FirstUse.

test/run/Generic.expect deleted +0 -6

@@ -1,6 +0,0 @@
1-8 2 true
2-8 1
3-abtrue
4-[] false
5-157 152 -1
6-{ BEEF } x18446744073709551615

test/run/Generic.raz deleted +0 -30

@@ -1,30 +0,0 @@
1-module Generic;
2-import Fmt, Buf, Str, Heap, Stack, Ints := List(I64), More := List(I64), Strs := List([]U8);
3-
4-proc twice(x: I64): I64; begin return x * 2; end;
5-
6-proc main*;
7-var l: Strs.List; v: I64; s: []U8; ok: BOOL; b: Buf.Buf; n: ^Ints.Node;
8-begin
9- ok := Ints.push(ADR(Stack.s), 7);
10- ok := More.push(ADR(Stack.s), 8);
11- Fmt.print("{} {} {}\n", [Fmt.int(Stack.top()), Fmt.int(Stack.s.len), Fmt.bool(ok)]);
12- n := Stack.s.head;
13- v, ok := Ints.pop(ADR(Stack.s));
14- Fmt.print("{} {}\n", [Fmt.int(v), Fmt.int(Stack.s.len)]);
15- Strs.init(ADR(l), Heap.heap);
16- ok := Strs.push(ADR(l), "b");
17- ok := Strs.push(ADR(l), "a");
18- s, ok := Strs.pop(ADR(l));
19- Fmt.print("{}{}{}\n", [Fmt.str(s), Fmt.str(l.head^.val), Fmt.bool(ok)]);
20- s, ok := Strs.pop(ADR(l));
21- s, ok := Strs.pop(ADR(l));
22- Fmt.print("[{}] {}\n", [Fmt.str(s), Fmt.bool(ok)]);
23- Buf.init(ADR(b), Heap.heap);
24- for v := 1 to 40 do Fmt.write(ADR(b), "{},", [Fmt.int(v * v)]); end;
25- Fmt.print("{} {} {}\n", [Fmt.int(b.len), Fmt.int(Str.find(Buf.bytes(ADR(b)), "1600")), Fmt.int(Str.cmp("ab", "b"))]);
26- Buf.done(ADR(b));
27- Fmt.print("{{ {} }} {}{}\n", [Fmt.hex(48879), Fmt.char('x'), Fmt.uint(0FFFFFFFFFFFFFFFFH)]);
28-end;
29-
30-end Generic.

test/run/HeapCheck.expect (history) deleted +0 -10

@@ -1,10 +0,0 @@
1-nil
2-nil
3-nil
4-nil
5-nil
6-nil
7-a block
8-aligned
9-a block
10-freeing it again

test/run/HeapCheck.raz (history) deleted +0 -34

@@ -1,34 +0,0 @@
1-(* The heap refuses bad sizes and alignments, and stops the program
2- when a block is freed twice. *)
3-module HeapCheck;
4-import Out, Heap, Mem;
5-
6-proc show(p: ^U8);
7-begin
8- if p = nil then Out.str("nil\n"); else Out.str("a block\n"); end;
9-end;
10-
11-proc main*;
12-var p, q: ^U8;
13-begin
14- show(Mem.alloc(Heap.heap, -1, 8));
15- show(Mem.alloc(Heap.heap, 1 shl 60, 8));
16- show(Mem.alloc(Heap.heap, 7FFFFFFFFFFFFFF0H, 8));
17- show(Mem.alloc(Heap.heap, 10, 3));
18- show(Mem.alloc(Heap.heap, 10, 0));
19- show(Mem.alloc(Heap.heap, 10, 8192));
20- p := Mem.alloc(Heap.heap, 10, 64);
21- show(p);
22- if I64(p) mod 64 = 0 then Out.str("aligned\n"); end;
23- Mem.free(Heap.heap, p);
24- q := Mem.alloc(Heap.heap, 100000, 8);
25- show(q);
26- Mem.free(Heap.heap, q);
27- p := Mem.alloc(Heap.heap, 24, 8);
28- Mem.free(Heap.heap, p);
29- Out.str("freeing it again\n");
30- Mem.free(Heap.heap, p);
31- Out.str("not reached\n");
32-end;
33-
34-end HeapCheck.

test/run/HeapCheck.status (history) deleted +0 -1

@@ -1 +0,0 @@
1-2

test/run/HeapStray.expect (history) deleted +0 -1

@@ -1 +0,0 @@
1-freeing a stray pointer

test/run/HeapStray.raz (history) deleted +0 -14

@@ -1,14 +0,0 @@
1-(* Freeing what the heap never gave out stops the program. *)
2-module HeapStray;
3-import Out, Heap, Mem;
4-
5-var a: [4]I64;
6-
7-proc main*;
8-begin
9- Out.str("freeing a stray pointer\n");
10- Mem.free(Heap.heap, ^U8(ADR(a[2])));
11- Out.str("not reached\n");
12-end;
13-
14-end HeapStray.

test/run/HeapStray.status (history) deleted +0 -1

@@ -1 +0,0 @@
1-2

test/run/Kinds.expect deleted +0 -8

@@ -1,8 +0,0 @@
1-023 2 0 in out sub sup ne eq
2-13 10 1 2 lt green other
3-120 0 2
4-47mid
5-24
6-50 LLCBA
7--1 LLDBA
8-3
\ No newline at end of file

test/run/Kinds.raz deleted +0 -95

@@ -1,95 +0,0 @@
1-module Kinds;
2-import Out;
3-
4-type
5- Color* = (red, green, blue, black);
6- Colors* = set of Color;
7- Cell = record ch: U8; attr: U8; fg: Color; end;
8- Point = record x, y: I64; name: []U8; end;
9- Line = record a, b: Point; end;
10-
11-var log: [8]U8; nlog: I64;
12-
13-proc note(c: U8);
14-begin
15- log[nlog] := c;
16- INC(nlog);
17-end;
18-
19-proc show(s: Colors);
20-var c: Color;
21-begin
22- for c := red to black do
23- if c in s then Out.int(I64(c)); end;
24- end;
25- Out.str(" ");
26-end;
27-
28-proc name(c: Color): []U8;
29-begin
30- match c of
31- | red: return "red";
32- | green: return "green";
33- | else: return "other";
34- end;
35-end;
36-
37-proc deferred(n: I64): I64;
38-var i: I64;
39-begin
40- defer note('A');
41- defer note('B');
42- for i := 1 to 3 do
43- defer note('L');
44- if i = 2 then break; end;
45- end;
46- if n > 0 then
47- defer note('C');
48- return n * 10;
49- end;
50- note('D');
51- return -1;
52-end;
53-
54-proc mid(a, b: Point): Point;
55-begin
56- return {x: (a.x + b.x) div 2, y: (a.y + b.y) div 2, name: "mid"};
57-end;
58-
59-proc main*;
60-var s, t: Colors; c: Color; cell: Cell; p: Point; l: Line; r: I64; one: Colors;
61-begin
62- s := {red, blue};
63- t := {blue, black};
64- show(s + t); show(s * t); show(s - t); show({});
65- if red in s then Out.str("in "); end;
66- if not (green in s) then Out.str("out "); end;
67- if s * t <= t then Out.str("sub "); end;
68- if s + t >= s then Out.str("sup "); end;
69- if s # t then Out.str("ne "); end;
70- if s = {blue, red} then Out.str("eq"); end;
71- Out.ln;
72- c := green;
73- one := {c, black};
74- show(one);
75- Out.int(I64(U8(one))); Out.str(" ");
76- Out.int(SIZE(Colors)); Out.str(" ");
77- Out.int(I64(Color(2))); Out.str(" ");
78- if c < blue then Out.str("lt "); end;
79- Out.str(name(c)); Out.str(" "); Out.str(name(black)); Out.ln;
80- cell := {ch: 'x', fg: blue};
81- Out.int(I64(cell.ch)); Out.str(" "); Out.int(I64(cell.attr)); Out.str(" "); Out.int(I64(cell.fg)); Out.ln;
82- p := mid({x: 2, y: 4}, {y: 10, x: 6});
83- Out.int(p.x); Out.int(p.y); Out.str(p.name); Out.ln;
84- l := {a: {x: 1, y: 2}, b: p};
85- Out.int(l.a.y); Out.int(l.b.x); Out.ln;
86- r := deferred(5);
87- Out.int(r); Out.str(" "); Out.str(log[0..nlog]); Out.ln;
88- nlog := 0;
89- r := deferred(0);
90- Out.int(r); Out.str(" "); Out.str(log[0..nlog]); Out.ln;
91- Out.int(I64(Color(I64(c) + 2)));
92- c := Color(nlog);
93-end;
94-
95-end Kinds.

test/run/Kinds.status deleted +0 -1

@@ -1 +0,0 @@
1-2

test/run/Kinds.stderr deleted +0 -1

@@ -1 +0,0 @@
1-test/run/Kinds.raz:92:16: 5 isn't a position of Color

test/run/MapRemove.expect (history) deleted +0 -2

@@ -1,2 +0,0 @@
1-341 entries, 341 of them, summing 6658308
2-walked 341, summing 6658308

test/run/MapRemove.raz (history) deleted +0 -56

@@ -1,56 +0,0 @@
1-(* Map's remove and next, against an array that holds the same: keys
2- hashed into runs of eight, so that removing moves entries back,
3- around the end of the slots too. *)
4-module MapRemove;
5-import Fmt, Heap, Rt, Ints := Map(I64, I64, near, same);
6-
7-const N = 500;
8-
9-proc near(k: I64): U64;
10-begin
11- return U64(k div 8 * 977);
12-end;
13-
14-proc same(a, b: I64): BOOL;
15-begin
16- return a = b;
17-end;
18-
19-proc main*;
20-var
21- m: Ints.Map; want: [N]I64; i, k, v, n, sum, seed: I64;
22- found, _ok: BOOL;
23-begin
24- Ints.init(ADR(m), Heap.heap);
25- seed := 1;
26- for i := 1 to 20000 do
27- seed := (seed * 1103515245 + 12345) & 7FFFFFFFH;
28- k := seed mod N;
29- if seed div N mod 3 = 0 then
30- if Ints.remove(ADR(m), k) # (want[k] # 0) then Rt.stop("remove: wrong answer"); end;
31- want[k] := 0;
32- else
33- _ok := Ints.put(ADR(m), k, i);
34- want[k] := i;
35- end;
36- end;
37- for k := 0 to N - 1 do
38- v, found := Ints.get(ADR(m), k);
39- if (found # (want[k] # 0)) or (v # want[k]) then Rt.stop("get: not what was put"); end;
40- if found then INC(n); INC(sum, v); end;
41- end;
42- if Ints.remove(ADR(m), N) then Rt.stop("remove: a key never put"); end;
43- Fmt.print("{} entries, {} of them, summing {}\n", [Fmt.int(m.len), Fmt.int(n), Fmt.int(sum)]);
44- (* the walk sees each entry once *)
45- n := 0; sum := 0;
46- i, k, v := Ints.next(ADR(m), 0);
47- while i >= 0 do
48- if want[k] # v then Rt.stop("next: not what was put"); end;
49- want[k] := 0;
50- INC(n); INC(sum, v);
51- i, k, v := Ints.next(ADR(m), i);
52- end;
53- Fmt.print("walked {}, summing {}\n", [Fmt.int(n), Fmt.int(sum)]);
54-end;
55-
56-end MapRemove.

test/run/PackedFields.expect deleted +0 -2

@@ -1,2 +0,0 @@
1-14 7 DEADBEF0 -5 9
2-240

test/run/PackedFields.raz deleted +0 -23

@@ -1,23 +0,0 @@
1-module PackedFields;
2-(* A packed record's fields are read and written wherever they sit *)
3-import Out;
4-
5-type
6- Header = packed record kind: U8; len: U32; big: I64; tag: U8; end;
7-
8-proc main*;
9-var h, g: Header; b: ^U8;
10-begin
11- h.kind := 7; h.len := 0DEADBEEFH; h.big := -5; h.tag := 9;
12- INC(h.len);
13- g := h;
14- Out.int(SIZE(Header)); Out.str(" ");
15- Out.int(I64(g.kind)); Out.str(" ");
16- Out.hex(U64(g.len), 8); Out.str(" ");
17- Out.int(g.big); Out.str(" ");
18- Out.int(I64(g.tag)); Out.ln;
19- b := ADR(g.kind);
20- Out.int(I64(b[1])); Out.ln;
21-end;
22-
23-end PackedFields.

test/run/PassOn.expect deleted +0 -5

@@ -1,5 +0,0 @@
1-42
2-2 whole
3-2 part
4-3 part
5-65 66 67 -65

test/run/PassOn.raz deleted +0 -42

@@ -1,42 +0,0 @@
1-module PassOn;
2-import Out;
3-
4-type Pair = record a, b: I64; end;
5-
6-proc one(n: I64): I64;
7-begin
8- return n * 2;
9-end;
10-
11-proc two(n: I64): (I64, BOOL);
12-begin
13- return n div 7, n mod 7 = 0;
14-end;
15-
16-proc three(n: I64): (U8, Pair, I64);
17-begin
18- return U8(n), {a: n + 1, b: n + 2}, -n;
19-end;
20-
21-(* each passes on what the one below returns *)
22-proc one1(n: I64): I64; begin return one(n); end;
23-proc one2(n: I64): I64; begin return one1(n); end;
24-proc two1(n: I64): (I64, BOOL); begin return two(n + 1); end;
25-proc two2(n: I64): (I64, BOOL); begin return two1(n + 1); end;
26-proc three1(n: I64): (U8, Pair, I64); begin return three(n); end;
27-proc three2(n: I64): (U8, Pair, I64); begin return three1(n); end;
28-
29-proc main*;
30-var i, q: I64; z: BOOL; c: U8; p: Pair;
31-begin
32- Out.int(one2(21)); Out.ln;
33- for i := 0 to 2 do
34- q, z := two2(i * 5 + 12);
35- Out.int(q); Out.str(" "); if z then Out.str("whole"); else Out.str("part"); end; Out.ln;
36- end;
37- c, p, i := three2(65);
38- Out.int(I64(c)); Out.str(" "); Out.int(p.a); Out.str(" "); Out.int(p.b);
39- Out.str(" "); Out.int(i); Out.ln;
40-end;
41-
42-end PassOn.

test/run/Pow2.expect deleted +0 -2

@@ -1,2 +0,0 @@
1--7 div 2 = -3, -7 mod 2 = -1
2-0 wrong

test/run/Pow2.raz deleted +0 -68

@@ -1,68 +0,0 @@
1-(* div, mod and * by a power of two are shifts; they must agree with
2- idiv and imul, which a divisor in a variable still gets. *)
3-module Pow2;
4-import Out;
5-
6-var bad: I64;
7-
8-proc check(s: []U8; x, got, want: I64);
9-begin
10- if got # want then
11- Out.str(s); Out.str(" "); Out.int(x); Out.str(": ");
12- Out.int(got); Out.str(" # "); Out.int(want); Out.ln;
13- bad := bad + 1;
14- end;
15-end;
16-
17-proc i64s(x: I64);
18-var d1, d2, d8, d62: I64;
19-begin
20- d1 := 1; d2 := 2; d8 := 8; d62 := 4000000000000000H;
21- check("div 1", x, x div 1, x div d1);
22- check("mod 1", x, x mod 1, x mod d1);
23- check("div 2", x, x div 2, x div d2);
24- check("mod 2", x, x mod 2, x mod d2);
25- check("div 8", x, x div 8, x div d8);
26- check("mod 8", x, x mod 8, x mod d8);
27- check("div 2^62", x, x div 4000000000000000H, x div d62);
28- check("mod 2^62", x, x mod 4000000000000000H, x mod d62);
29- check("* 8", x, x * 8, x * d8);
30- check("div -8", x, x div (0 - 8), x div (0 - d8));
31-end;
32-
33-proc u64s(x: U64);
34-var d2, d8, d62: U64;
35-begin
36- d2 := 2; d8 := 8; d62 := 4000000000000000H;
37- check("u div 2", I64(x), I64(x div 2), I64(x div d2));
38- check("u mod 2", I64(x), I64(x mod 2), I64(x mod d2));
39- check("u div 8", I64(x), I64(x div 8), I64(x div d8));
40- check("u mod 8", I64(x), I64(x mod 8), I64(x mod d8));
41- check("u div 2^62", I64(x), I64(x div 4000000000000000H), I64(x div d62));
42- check("u mod 2^62", I64(x), I64(x mod 4000000000000000H), I64(x mod d62));
43-end;
44-
45-proc main*;
46-var i: I64; b: I8; d: I8; w: U8; dw: U8;
47-begin
48- for i := -300 to 300 do i64s(i); u64s(U64(i)); end;
49- i64s(07FFFFFFFFFFFFFFFH); i64s(-07FFFFFFFFFFFFFFFH - 1);
50- i64s(4000000000000001H); i64s(-4000000000000001H);
51- u64s(0FFFFFFFFFFFFFFFFH); u64s(8000000000000000H);
52- d := 8; dw := 8;
53- for i := -128 to 127 do
54- b := I8(i); w := U8(i + 128);
55- check("i8 div 8", i, I64(b div 8), I64(b div d));
56- check("i8 mod 8", i, I64(b mod 8), I64(b mod d));
57- check("i8 * 8", i, I64(b * 8), I64(b * d));
58- check("u8 div 8", i, I64(w div 8), I64(w div dw));
59- check("u8 mod 8", i, I64(w mod 8), I64(w mod dw));
60- check("u8 * 8", i, I64(w * 8), I64(w * dw));
61- end;
62- i := -7;
63- Out.str("-7 div 2 = "); Out.int(i div 2);
64- Out.str(", -7 mod 2 = "); Out.int(i mod 2); Out.ln;
65- Out.int(bad); Out.str(" wrong\n");
66-end;
67-
68-end Pow2.

test/run/Procs.expect deleted +0 -13

@@ -1,13 +0,0 @@
1-parity ok
2-21
3-10 11 21
4-22
5-7 12
6-same
7-nil
8-3245
9-2432902008176640000
10-95 5
11-0
12-16 0
13-15

test/run/Procs.raz deleted +0 -117

@@ -1,117 +0,0 @@
1-module Procs;
2-import Out;
3-
4-type
5- Pair = record x, y: I64; end;
6- Op = proc(a, b: I64): I64;
7- Big = record a: [10]I64; end;
8-
9-proc even(n: I64): BOOL; forward;
10-
11-proc odd(n: I64): BOOL;
12-begin
13- if n = 0 then return false; end;
14- return even(n - 1);
15-end;
16-
17-proc even(n: I64): BOOL;
18-begin
19- if n = 0 then return true; end;
20- return odd(n - 1);
21-end;
22-
23-proc swap(var a, b: I64);
24-var t: I64;
25-begin
26- t := a; a := b; b := t;
27-end;
28-
29-proc bump(p: Pair): Pair;
30-begin
31- p.x := p.x + 1;
32- p.y := p.y + 1;
33- return p;
34-end;
35-
36-proc add(a, b: I64): I64; begin return a + b; end;
37-proc mul(a, b: I64): I64; begin return a * b; end;
38-
39-proc apply(f: Op; a, b: I64): I64;
40-begin
41- return f(a, b);
42-end;
43-
44-proc many(a, b, c, d, e, f, g, h: I64; x: F64; i: I64; y: F64): I64;
45-begin
46- return a + 2 * b + 3 * c + 4 * d + 5 * e + 6 * f + 7 * g + 8 * h + I64(x) * 100 + 9 * i + I64(y) * 1000;
47-end;
48-
49-proc fact(n: I64): I64;
50-begin
51- if n <= 1 then return 1; end;
52- return n * fact(n - 1);
53-end;
54-
55-proc fill(var b: Big; v: I64);
56-var i: I64;
57-begin
58- for i := 0 to 9 do b.a[i] := v + i; end;
59-end;
60-
61-proc total(b: Big): I64;
62-var i, s: I64;
63-begin
64- s := 0;
65- for i := 0 to 9 do s := s + b.a[i]; end;
66- b.a[0] := 1000;
67- return s;
68-end;
69-
70-proc noresult(n: I64): I64;
71-begin
72- if n > 100 then return 1; end;
73-end;
74-
75-proc mk(n: I64): Big;
76-var b: Big;
77-begin
78- fill(b, n);
79- return b;
80-end;
81-
82-proc mkzero(n: I64): Big;
83-begin
84-end;
85-
86-proc fsum(a, b: F64): F64;
87-begin
88- return a + b;
89-end;
90-
91-proc main*: I64;
92-var a, b: I64; p, q: Pair; f: Op; bg: Big;
93-begin
94- if even(10) and odd(7) and not even(3) then Out.str("parity ok"); Out.ln; end;
95- a := 1; b := 2;
96- swap(a, b);
97- Out.int(a); Out.int(b); Out.ln;
98- p.x := 10; p.y := 20;
99- q := bump(p);
100- Out.int(p.x); Out.str(" "); Out.int(q.x); Out.str(" "); Out.int(q.y); Out.ln;
101- Out.int(bump(bump(p)).y); Out.ln;
102- f := add;
103- Out.int(apply(f, 3, 4)); Out.str(" "); Out.int(apply(mul, 3, 4)); Out.ln;
104- if f = add then Out.str("same"); Out.ln; end;
105- f := nil;
106- if f = nil then Out.str("nil"); Out.ln; end;
107- Out.int(many(1, 1, 1, 1, 1, 1, 1, 1, 2.5, 1, 3.9)); Out.ln;
108- Out.int(fact(20)); Out.ln;
109- fill(bg, 5);
110- Out.int(total(bg)); Out.str(" "); Out.int(bg.a[0]); Out.ln;
111- Out.int(noresult(5)); Out.ln;
112- Out.int(mk(7).a[9]); Out.str(" "); Out.int(mkzero(1).a[3]); Out.ln;
113- Out.int(I64(fsum(1.25, 2.5) * 4.0)); Out.ln;
114- return 7;
115-end;
116-
117-end Procs.

test/run/Procs.status deleted +0 -1

@@ -1 +0,0 @@
1-7

test/run/RealRead.expect deleted +0 -12

@@ -1,12 +0,0 @@
1-7506AC5B262CA1FF
2-3FB999999999999A
3-FFFFFFFFFFFFF
4-1
5-1
6-0
7-0
8-7FEFFFFFFFFFFFFF
9-4340000000000000
10-4340000000000002
11-3FF0000000000000
12-3FF0000000000001

test/run/RealRead.raz deleted +0 -34

@@ -1,34 +0,0 @@
1-(* Real literals read to the nearest F64, ties to the even one: their
2- bits, for numbers a reader of decimals easily gets one off. *)
3-module RealRead;
4-import Fmt;
5-
6-proc bits(x: F64): U64;
7-var p: ^U64;
8-begin
9- p := ^U64(ADR(x));
10- return p^;
11-end;
12-
13-proc show(x: F64);
14-begin
15- Fmt.print("{}\n", [Fmt.hex(bits(x))]);
16-end;
17-
18-proc main*;
19-begin
20- show(5.319372648326541E255);
21- show(0.1);
22- show(2.2250738585072011E-308); (* just below the least normal *)
23- show(4.9E-324); (* the least F64 *)
24- show(2.4703282292062328E-324); (* just over half of it: up *)
25- show(2.4703282292062327E-324); (* just under: 0 *)
26- show(1.0E-400);
27- show(1.7976931348623157E308); (* the largest *)
28- show(9007199254740993.0); (* 2^53 + 1, a tie: down to even *)
29- show(9007199254740995.0); (* 2^53 + 3, a tie: up to even *)
30- show(1.00000000000000011102230246251565404236316680908203125); (* 1 + 2^-53, a tie *)
31- show(1.00000000000000011102230246251565404236316680908203126);
32-end;
33-
34-end RealRead.

test/run/SliceBounds.expect deleted +0 -1

@@ -1 +0,0 @@
1-6 3 0
\ No newline at end of file

test/run/SliceBounds.raz deleted +0 -15

@@ -1,15 +0,0 @@
1-module SliceBounds;
2-(* A slice must have 0 <= lo <= hi <= the length *)
3-import Out;
4-
5-proc main*;
6-var a: [8]I64; s: []I64; lo: I64;
7-begin
8- s := a[0..8];
9- for lo := 0 to 9 by 3 do
10- Out.int(LEN(s[lo..6]));
11- Out.str(" ");
12- end;
13-end;
14-
15-end SliceBounds.

test/run/SliceBounds.status deleted +0 -1

@@ -1 +0,0 @@
1-2

test/run/SliceBounds.stderr deleted +0 -1

@@ -1 +0,0 @@
1-test/run/SliceBounds.raz:10:23: slice 9..6 is out of range for a length of 8

test/run/SliceIndex.expect deleted +0 -1

@@ -1 +0,0 @@
1-0123
\ No newline at end of file

test/run/SliceIndex.raz deleted +0 -15

@@ -1,15 +0,0 @@
1-module SliceIndex;
2-(* An index checked against a slice's length, which is in memory *)
3-import Out;
4-
5-proc main*;
6-var a: [8]I64; s: []I64; i: I64;
7-begin
8- s := a[2..5];
9- for i := 0 to 3 do
10- Out.int(i);
11- s[i] := i;
12- end;
13-end;
14-
15-end SliceIndex.

test/run/SliceIndex.status deleted +0 -1

@@ -1 +0,0 @@
1-2

test/run/SliceIndex.stderr deleted +0 -1

@@ -1 +0,0 @@
1-test/run/SliceIndex.raz:11:11: index 3 is out of range for a length of 3

test/run/SlicePtrBackwards.expect deleted +0 -1

@@ -1 +0,0 @@
1-2 0
\ No newline at end of file

test/run/SlicePtrBackwards.raz deleted +0 -16

@@ -1,16 +0,0 @@
1-module SlicePtrBackwards;
2-(* A slice of a pointer isn't checked against a length, but it can't
3- run backwards *)
4-import Out;
5-
6-proc main*;
7-var a: [8]U8; p: ^U8; hi: I64;
8-begin
9- p := ADR(a[0]);
10- for hi := 4 to 0 by -2 do
11- Out.int(LEN(p[2..hi]));
12- Out.str(" ");
13- end;
14-end;
15-
16-end SlicePtrBackwards.

test/run/SlicePtrBackwards.status deleted +0 -1

@@ -1 +0,0 @@
1-2

test/run/SlicePtrBackwards.stderr deleted +0 -1

@@ -1 +0,0 @@
1-test/run/SlicePtrBackwards.raz:11:23: slice 2..0 runs backwards

test/run/Sorted.expect deleted +0 -4

@@ -1,4 +0,0 @@
1-Bo 7
2-Di 23
3-Ana 41
4-Cy 90

test/run/Sorted.raz deleted +0 -51

@@ -1,51 +0,0 @@
1-(* Sort: slices in many orders and of every length up to 40 come out
2- in order, holding what they held; and a sort by a record's field. *)
3-module Sorted;
4-import Fmt, Rt, Ints := Sort(I64, below), ByAge := Sort(Person, younger);
5-
6-type Person = record name: []U8; age: I64; end;
7-
8-proc below(a, b: I64): BOOL;
9-begin
10- return a < b;
11-end;
12-
13-proc younger(a, b: Person): BOOL;
14-begin
15- return a.age < b.age;
16-end;
17-
18-proc main*;
19-var
20- a: [40]I64; count: [10]I64; n, i, kind, seed: I64;
21- people: [4]Person;
22-begin
23- seed := 7;
24- for n := 0 to 40 do
25- for kind := 0 to 3 do
26- for i := 0 to 9 do count[i] := 0; end;
27- for i := 0 to n - 1 do
28- seed := (seed * 1103515245 + 12345) & 7FFFFFFFH;
29- if kind = 0 then a[i] := seed mod 10; (* at random, with repeats *)
30- elsif kind = 1 then a[i] := i mod 10; (* rising *)
31- elsif kind = 2 then a[i] := 9 - i mod 10; (* falling *)
32- else a[i] := 5; (* all equal *)
33- end;
34- INC(count[a[i]]);
35- end;
36- Ints.sort(a[0..n]);
37- for i := 0 to n - 1 do
38- if (i > 0) and (a[i - 1] > a[i]) then Rt.stop("out of order"); end;
39- DEC(count[a[i]]);
40- end;
41- for i := 0 to 9 do
42- if count[i] # 0 then Rt.stop("not what it held"); end;
43- end;
44- end;
45- end;
46- people := [{name: "Ana", age: 41}, {name: "Bo", age: 7}, {name: "Cy", age: 90}, {name: "Di", age: 23}];
47- ByAge.sort(people);
48- for i := 0 to 3 do Fmt.print("{} {}\n", [Fmt.str(people[i].name), Fmt.int(people[i].age)]); end;
49-end;
50-
51-end Sorted.

test/run/Strings.expect deleted +0 -4

@@ -1,4 +0,0 @@
1-eq ne lit arr buf 0 5 2
2-6 100 0
3-threeone
4-é☺A

test/run/Strings.raz deleted +0 -39

@@ -1,39 +0,0 @@
1-module Strings;
2-import Out;
3-
4-const greeting = "hello";
5-
6-var buf: [8]U8;
7-
8-proc count(xs: []I64): I64;
9-var i, s: I64;
10-begin
11- s := 0;
12- for i := 0 to LEN(xs) - 1 do s := s + xs[i]; end;
13- return s;
14-end;
15-
16-proc main*;
17-var a: []U8; b: [5]U8; c: [3]I64; d: [][]U8;
18-begin
19- a := "hello";
20- if a = greeting then Out.str("eq "); end;
21- if a # "help" then Out.str("ne "); end;
22- if "abc" = "abc" then Out.str("lit "); end;
23- b := "hello";
24- if b = a then Out.str("arr "); end;
25- buf := "hi";
26- if buf[0..2] = "hi" then Out.str("buf "); end;
27- Out.int(I64(buf[5])); Out.str(" ");
28- Out.int(LEN(greeting)); Out.str(" ");
29- Out.int(LEN(a[1..3])); Out.ln;
30- c := [1, 2, 3];
31- Out.int(count(c)); Out.str(" ");
32- Out.int(count([10, 20, 30, 40])); Out.str(" ");
33- Out.int(count([])); Out.ln;
34- d := ["one", "two", "three"];
35- Out.str(d[2]); Out.str(d[0]); Out.ln;
36- Out.str("é\u{263A}\x41\n");
37-end;
38-
39-end Strings.

test/run/mods/First.raz deleted +0 -14

@@ -1,14 +0,0 @@
1-module First;
2-import Out;
3-
4-var count*: I64;
5-
6-proc main*;
7-begin
8- Out.str("First.main must not run");
9-end;
10-
11-begin
12- count := 1;
13- Out.str("First ");
14-end First.

test/run/mods/Loud.raz deleted +0 -10

@@ -1,10 +0,0 @@
1-(* A generic module with a body, which runs once for each instance *)
2-module Loud(T);
3-import Out;
4-
5-var size*: I64;
6-
7-begin
8- size := SIZE(T);
9- Out.str("an instance of Loud, of size "); Out.int(size); Out.ln;
10-end Loud.

test/run/mods/Second.raz deleted +0 -11

@@ -1,11 +0,0 @@
1-module Second;
2-import Out, First;
3-
4-var count*: I64;
5-
6-begin
7- count := First.count + 1;
8- Out.str("Second ");
9- if count = 2 then return; end;
10- Out.str("not reached");
11-end Second.

test/run/mods/Stack.raz deleted +0 -13

@@ -1,13 +0,0 @@
1-module Stack;
2-import Ints := List(I64), Heap;
3-
4-var s*: Ints.List;
5-
6-proc top*(): I64;
7-begin
8- return s.head^.val;
9-end;
10-
11-begin
12- Ints.init(ADR(s), Heap.heap);
13-end Stack.