From 4ed90e7f7c9d9fc2184ae8d3a6404580d1b173ac Mon Sep 17 00:00:00 2001 From: David Pearce Date: Fri, 20 Dec 2024 11:47:51 +1300 Subject: [PATCH] feat: specify error for invalid tests (#467) * Trying to extract errors * Embed errors in test files This puts in place the mechanism for embedding error messages into the invalid tests themselves. That way, anything which changes what errors are reported results in a failing test. * Fixes for error checking This puts through a few more fixes for the error checking mechanism, and adds errors for basic and constant tests. There's a fair way to go yet though. * Updated all invalid tests This updates all the existing invalid tests to include specific information about the expected errors. Overall, this seems to be working well. --- pkg/cmd/util.go | 9 +- pkg/corset/resolver.go | 13 +-- pkg/test/invalid_corset_test.go | 165 +++++++++++++++++++++++++++- pkg/test/valid_corset_test.go | 64 +---------- pkg/util/files.go | 63 +++++++++++ testdata/alias_invalid_01.lisp | 1 + testdata/alias_invalid_02.lisp | 1 + testdata/alias_invalid_03.lisp | 1 + testdata/alias_invalid_04.lisp | 1 + testdata/alias_invalid_05.lisp | 1 + testdata/alias_invalid_06.lisp | 2 + testdata/alias_invalid_07.lisp | 1 + testdata/array_invalid_01.lisp | 2 +- testdata/array_invalid_02.lisp | 2 +- testdata/array_invalid_03.lisp | 2 +- testdata/array_invalid_04.lisp | 3 +- testdata/array_invalid_05.lisp | 3 +- testdata/basic_invalid_01.lisp | 1 + testdata/basic_invalid_02.lisp | 1 + testdata/basic_invalid_03.lisp | 1 + testdata/basic_invalid_04.lisp | 1 + testdata/basic_invalid_05.lisp | 1 + testdata/basic_invalid_06.lisp | 1 + testdata/basic_invalid_07.lisp | 1 + testdata/basic_invalid_08.lisp | 1 + testdata/basic_invalid_09.lisp | 1 + testdata/basic_invalid_10.lisp | 2 + testdata/basic_invalid_11.lisp | 3 +- testdata/basic_invalid_12.lisp | 1 + testdata/constant_invalid_01.lisp | 1 + testdata/constant_invalid_02.lisp | 1 + testdata/constant_invalid_03.lisp | 1 + testdata/constant_invalid_04.lisp | 1 + testdata/constant_invalid_05.lisp | 1 + testdata/constant_invalid_06.lisp | 1 + testdata/constant_invalid_07.lisp | 1 + testdata/constant_invalid_08.lisp | 1 + testdata/constant_invalid_09.lisp | 1 + testdata/constant_invalid_10.lisp | 1 + testdata/constant_invalid_11.lisp | 4 +- testdata/constant_invalid_12.lisp | 3 + testdata/constant_invalid_13.lisp | 3 + testdata/constant_invalid_14.lisp | 3 + testdata/constant_invalid_15.lisp | 1 + testdata/constant_invalid_16.lisp | 2 + testdata/constant_invalid_17.lisp | 2 + testdata/debug_invalid_01.lisp | 2 + testdata/debug_invalid_02.lisp | 2 + testdata/for_invalid_01.lisp | 1 + testdata/for_invalid_02.lisp | 1 + testdata/for_invalid_03.lisp | 4 + testdata/fun_invalid_01.lisp | 1 + testdata/fun_invalid_02.lisp | 2 + testdata/fun_invalid_03.lisp | 1 + testdata/fun_invalid_04.lisp | 1 + testdata/funalias_invalid_01.lisp | 1 + testdata/funalias_invalid_02.lisp | 1 + testdata/funalias_invalid_03.lisp | 1 + testdata/funalias_invalid_04.lisp | 1 + testdata/funalias_invalid_05.lisp | 1 + testdata/if_invalid_01.lisp | 1 + testdata/if_invalid_02.lisp | 1 + testdata/if_invalid_03.lisp | 3 + testdata/interleave_invalid_01.lisp | 1 + testdata/interleave_invalid_02.lisp | 1 + testdata/interleave_invalid_03.lisp | 1 + testdata/interleave_invalid_04.lisp | 1 + testdata/interleave_invalid_05.lisp | 1 + testdata/interleave_invalid_06.lisp | 2 + testdata/interleave_invalid_07.lisp | 1 + testdata/interleave_invalid_08.lisp | 1 + testdata/interleave_invalid_09.lisp | 2 + testdata/interleave_invalid_10.lisp | 2 + testdata/interleave_invalid_11.lisp | 1 + testdata/interleave_invalid_12.lisp | 1 + testdata/lookup_invalid_01.lisp | 1 + testdata/lookup_invalid_02.lisp | 1 + testdata/lookup_invalid_03.lisp | 1 + testdata/lookup_invalid_04.lisp | 1 + testdata/lookup_invalid_05.lisp | 1 + testdata/lookup_invalid_06.lisp | 2 + testdata/lookup_invalid_07.lisp | 2 + testdata/lookup_invalid_08.lisp | 1 + testdata/lookup_invalid_09.lisp | 1 + testdata/module_invalid_01.lisp | 1 + testdata/norm_invalid_01.lisp | 1 + testdata/permute_invalid_01.lisp | 1 + testdata/permute_invalid_02.lisp | 2 + testdata/permute_invalid_03.lisp | 1 + testdata/permute_invalid_04.lisp | 1 + testdata/permute_invalid_05.lisp | 1 + testdata/permute_invalid_06.lisp | 1 + testdata/permute_invalid_07.lisp | 1 + testdata/permute_invalid_08.lisp | 1 + testdata/property_invalid_01.lisp | 1 + testdata/property_invalid_02.lisp | 1 + testdata/purefun_invalid_01.lisp | 1 + testdata/purefun_invalid_02.lisp | 1 + testdata/purefun_invalid_03.lisp | 2 + testdata/purefun_invalid_04.lisp | 1 + testdata/purefun_invalid_05.lisp | 1 + testdata/purefun_invalid_06.lisp | 1 + testdata/purefun_invalid_07.lisp | 1 + testdata/purefun_invalid_08.lisp | 1 + testdata/purefun_invalid_09.lisp | 2 + testdata/purefun_invalid_10.lisp | 1 + testdata/purefun_invalid_11.lisp | 1 + testdata/purefun_invalid_12.lisp | 1 + testdata/purefun_invalid_13.lisp | 1 + testdata/range_invalid_01.lisp | 1 + testdata/range_invalid_02.lisp | 1 + testdata/range_invalid_03.lisp | 1 + testdata/range_invalid_04.lisp | 1 + testdata/reduce_invalid_01.lisp | 1 + testdata/reduce_invalid_02.lisp | 1 + testdata/reduce_invalid_03.lisp | 1 + testdata/reduce_invalid_04.lisp | 1 + testdata/reduce_invalid_05.lisp | 1 + testdata/shift_invalid_01.lisp | 3 +- testdata/shift_invalid_02.lisp | 1 + testdata/type_invalid_01.lisp | 1 + testdata/type_invalid_02.lisp | 1 + testdata/type_invalid_03.lisp | 1 + testdata/type_invalid_04.lisp | 1 + testdata/type_invalid_05.lisp | 1 + testdata/type_invalid_06.lisp | 1 + testdata/type_invalid_07.lisp | 1 + testdata/type_invalid_08.lisp | 1 + testdata/type_invalid_09.lisp | 1 + testdata/type_invalid_10.lisp | 1 + testdata/type_invalid_11.lisp | 1 + testdata/type_invalid_12.lisp | 1 + testdata/type_invalid_13.lisp | 1 + 133 files changed, 399 insertions(+), 83 deletions(-) create mode 100644 pkg/util/files.go create mode 100644 testdata/if_invalid_03.lisp diff --git a/pkg/cmd/util.go b/pkg/cmd/util.go index 5002e431..68d2ed49 100644 --- a/pkg/cmd/util.go +++ b/pkg/cmd/util.go @@ -203,17 +203,18 @@ func readSourceFiles(stdlib bool, debug bool, filenames []string) *hir.Schema { func printSyntaxError(err *sexp.SyntaxError) { span := err.Span() line := err.FirstEnclosingLine() + lineOffset := span.Start() - line.Start() + // Calculate length (ensures don't overflow line) + length := min(line.Length()-lineOffset, span.Length()) // Print error + line number - fmt.Printf("%s:%d: %s\n", err.SourceFile().Filename(), line.Number(), err.Message()) + fmt.Printf("%s:%d:%d-%d %s\n", err.SourceFile().Filename(), + line.Number(), 1+lineOffset, 1+lineOffset+length, err.Message()) // Print separator line fmt.Println() // Print line fmt.Println(line.String()) // Print indent (todo: account for tabs) - lineOffset := span.Start() - line.Start() fmt.Print(strings.Repeat(" ", lineOffset)) - // Calculate length (ensures don't overflow line) - length := min(line.Length()-lineOffset, span.Length()) // Print highlight fmt.Println(strings.Repeat("^", length)) } diff --git a/pkg/corset/resolver.go b/pkg/corset/resolver.go index ac777642..98c255c6 100644 --- a/pkg/corset/resolver.go +++ b/pkg/corset/resolver.go @@ -142,7 +142,7 @@ func (r *resolver) initialiseAliasesInModule(scope *ModuleScope, decls []Declara err := r.srcmap.SyntaxError(alias, "symbol already exists") errors = append(errors, *err) } else { - err := r.srcmap.SyntaxError(symbol, "unknown symbol encountered during resolution") + err := r.srcmap.SyntaxError(symbol, "unknown symbol") errors = append(errors, *err) } } @@ -237,7 +237,7 @@ func (r *resolver) declarationDependenciesAreFinalised(scope *ModuleScope, symbol := iter.Next() // Attempt to resolve if !symbol.IsResolved() && !scope.Bind(symbol) { - errors = append(errors, *r.srcmap.SyntaxError(symbol, "unknown symbol encountered during resolution")) + errors = append(errors, *r.srcmap.SyntaxError(symbol, "unknown symbol")) // not finalised yet finalised = false } else { @@ -293,11 +293,10 @@ func (r *resolver) finaliseDefConstInModule(enclosing Scope, decl *DefConst) []S // Accumulate errors errors = append(errors, errs...) // Check it is indeed constant! - if constant := c.binding.value.AsConstant(); constant == nil { - err := r.srcmap.SyntaxError(c, "definition not constant") - errors = append(errors, *err) - } else { - // Finalise constant binding + if constant := c.binding.value.AsConstant(); constant != nil { + // Finalise constant binding. Note, no need to register a syntax + // error for the error case, because it would have already been + // accounted for during resolution. c.binding.Finalise(datatype) } } diff --git a/pkg/test/invalid_corset_test.go b/pkg/test/invalid_corset_test.go index 1fee80e4..5f2f049e 100644 --- a/pkg/test/invalid_corset_test.go +++ b/pkg/test/invalid_corset_test.go @@ -3,6 +3,8 @@ package test import ( "fmt" "os" + "strconv" + "strings" "testing" "github.com/consensys/go-corset/pkg/corset" @@ -237,6 +239,10 @@ func Test_Invalid_If_02(t *testing.T) { CheckInvalid(t, "if_invalid_02") } +func Test_Invalid_If_03(t *testing.T) { + CheckInvalid(t, "if_invalid_03") +} + // =================================================================== // Types // =================================================================== @@ -583,12 +589,14 @@ func Test_Invalid_Debug_02(t *testing.T) { // =================================================================== // Check that a given source file fails to compiler. +// nolint func CheckInvalid(t *testing.T, test string) { - filename := fmt.Sprintf("%s.lisp", test) + filename := fmt.Sprintf("%s/%s.lisp", InvalidTestDir, test) // Enable testing each trace in parallel - t.Parallel() + fmt.Println("*** DISABLED PARALLLISM") + // t.Parallel() // Read constraints file - bytes, err := os.ReadFile(fmt.Sprintf("%s/%s", InvalidTestDir, filename)) + bytes, err := os.ReadFile(filename) // Check test file read ok if err != nil { t.Fatal(err) @@ -597,8 +605,159 @@ func CheckInvalid(t *testing.T, test string) { srcfile := sexp.NewSourceFile(filename, bytes) // Parse terms into an HIR schema _, errs := corset.CompileSourceFile(false, false, srcfile) + // Extract expected errors for comparison + expectedErrs, lineOffsets := extractExpectedErrors(bytes) // Check program did not compile! if len(errs) == 0 { t.Fatalf("Error %s should not have compiled\n", filename) + } else { + error := false + // Construct initial message + msg := fmt.Sprintf("Error %s\n", filename) + // Pad out with what received + for i := 0; i < max(len(errs), len(expectedErrs)); i++ { + if i < len(errs) && i < len(expectedErrs) { + expected := expectedErrs[i] + actual := errs[i] + // Check whether message OK + if expected.msg == actual.Message() && expected.span == actual.Span() { + continue + } + } + // Indicate error arose + error = true + // actual + if i < len(errs) { + actual := errs[i] + msg = fmt.Sprintf("%s unexpected error %s:%s\n", msg, spanToString(actual.Span(), lineOffsets), actual.Message()) + } + // expected + if i < len(expectedErrs) { + expected := expectedErrs[i] + msg = fmt.Sprintf("%s expected error %s:%s\n", msg, spanToString(expected.span, lineOffsets), expected.msg) + } + } + // + if error { + t.Fatalf(msg) + } + } +} + +// SyntaxError captures key information about an expected error +type SyntaxError struct { + // The range of bytes in the original file to which this error is + // associated. + span sexp.Span + // The error message reported. + msg string +} + +func extractExpectedErrors(bytes []byte) ([]SyntaxError, []int) { + // Calcuate the character offset of each line + offsets, lines := splitFileLines(bytes) + // Now construct errors + errors := make([]SyntaxError, 0) + // scan file line-by-line until no more errors found + for _, line := range lines { + error := extractSyntaxError(line, offsets) + // Keep going until no more errors + if error == nil { + return errors, offsets + } + + errors = append(errors, *error) + } + // + return errors, offsets +} + +// Split out a given file into the line contents and the line offsets. This +// needs to be done carefully to ensure that these both align properly, +// otherwise error messages tend to have the wrong column numbers, etc. +func splitFileLines(bytes []byte) ([]int, []string) { + contents := []rune(string(bytes)) + // Calcuate the character offset of each line + offsets := make([]int, 1) + lines := make([]string, 0) + start := 0 + // Iterate each byte + for i := 0; i <= len(contents); i++ { + if i == len(contents) || contents[i] == '\n' { + line := string(contents[start:i]) + offsets = append(offsets, i+1) + lines = append(lines, line) + // + start = i + 1 + } + } + // Done + return offsets, lines +} + +// Extract the syntax error from a given line in the source file, or return nil +// if it does not describe an error. +func extractSyntaxError(line string, offsets []int) *SyntaxError { + if strings.HasPrefix(line, ";;error") { + splits := strings.Split(line, ":") + span := determineFileSpan(splits[1], splits[2], offsets) + msg := splits[3] + // Done + return &SyntaxError{span, msg} + } + // No error + return nil +} + +// Determine the span that the the given line string and span string corresponds +// to. We need the line offsets so that the computed span includes the starting +// offset of the relevant line. +func determineFileSpan(line_str string, span_str string, offsets []int) sexp.Span { + line, err := strconv.Atoi(line_str) + if err != nil { + panic(err) + } + // Split the span + span_splits := strings.Split(span_str, "-") + // Parse span start as integer + start, err := strconv.Atoi(span_splits[0]) + if err != nil { + panic(err) + } else if start == 0 { + panic("columns numbered from 1") + } + // Parse span end as integer + end, err := strconv.Atoi(span_splits[1]) + if err != nil { + panic(err) + } + // Add line offset + start += offsets[line-1] + end += offsets[line-1] + // Sanity check + if start >= offsets[line] || end > offsets[line] { + panic("span overflows to following line") + } + // Create span, recalling that span's start from zero whereas column numbers + // start from 1. + return sexp.NewSpan(start-1, end-1) +} + +// Convert a span into a useful human readable string. +func spanToString(span sexp.Span, offsets []int) string { + line := 0 + last := 0 + start := span.Start() + end := span.End() + // + for i, o := range offsets { + if o > start { + break + } + // Update status + last = o + line = i + 1 } + // + return fmt.Sprintf("%d:%d-%d", line, 1+start-last, 1+end-last) } diff --git a/pkg/test/valid_corset_test.go b/pkg/test/valid_corset_test.go index fc354e0f..a4d352af 100644 --- a/pkg/test/valid_corset_test.go +++ b/pkg/test/valid_corset_test.go @@ -1,10 +1,7 @@ package test import ( - "bufio" - "errors" "fmt" - "io" "os" "strings" "testing" @@ -15,6 +12,7 @@ import ( "github.com/consensys/go-corset/pkg/sexp" "github.com/consensys/go-corset/pkg/trace" "github.com/consensys/go-corset/pkg/trace/json" + "github.com/consensys/go-corset/pkg/util" ) // Determines the (relative) location of the test directory. That is @@ -899,7 +897,7 @@ type traceId struct { // ReadTracesFile reads a file containing zero or more traces expressed as JSON, where // each trace is on a separate line. func ReadTracesFile(filename string) [][]trace.RawColumn { - lines := ReadInputFile(filename) + lines := util.ReadInputFile(filename) traces := make([][]trace.RawColumn, len(lines)) // Read constraints line by line for i, line := range lines { @@ -925,61 +923,5 @@ func ReadTracesFileIfExists(name string) [][]trace.RawColumn { return nil } // Yes it does - return ReadTracesFile(name) -} - -// ReadInputFile reads an input file as a sequence of lines. -func ReadInputFile(filename string) []string { - filename = fmt.Sprintf("%s/%s", TestDir, filename) - file, err := os.Open(filename) - // Check whether file exists - if errors.Is(err, os.ErrNotExist) { - return []string{} - } else if err != nil { - panic(err) - } - - reader := bufio.NewReaderSize(file, 1024*128) - lines := make([]string, 0) - // Read file line-by-line - for { - // Read the next line - line := readLine(reader) - // Check whether for EOF - if line == nil { - if err = file.Close(); err != nil { - panic(err) - } - - return lines - } - - lines = append(lines, *line) - } -} - -// Read a single line -func readLine(reader *bufio.Reader) *string { - var ( - bytes []byte - bit []byte - err error - ) - // - cont := true - // - for cont { - bit, cont, err = reader.ReadLine() - if err == io.EOF { - return nil - } else if err != nil { - panic(err) - } - - bytes = append(bytes, bit...) - } - // Convert to string - str := string(bytes) - // Done - return &str + return ReadTracesFile(filename) } diff --git a/pkg/util/files.go b/pkg/util/files.go new file mode 100644 index 00000000..d72857c7 --- /dev/null +++ b/pkg/util/files.go @@ -0,0 +1,63 @@ +package util + +import ( + "bufio" + "errors" + "io" + "os" +) + +// ReadInputFile reads an input file as a sequence of lines. +func ReadInputFile(filename string) []string { + file, err := os.Open(filename) + // Check whether file exists + if errors.Is(err, os.ErrNotExist) { + return []string{} + } else if err != nil { + panic(err) + } + + reader := bufio.NewReaderSize(file, 1024*128) + lines := make([]string, 0) + // Read file line-by-line + for { + // Read the next line + line := readLine(reader) + // Check whether for EOF + if line == nil { + if err = file.Close(); err != nil { + panic(err) + } + + return lines + } + + lines = append(lines, *line) + } +} + +// Read a single line +func readLine(reader *bufio.Reader) *string { + var ( + bytes []byte + bit []byte + err error + ) + // + cont := true + // + for cont { + bit, cont, err = reader.ReadLine() + if err == io.EOF { + return nil + } else if err != nil { + panic(err) + } + + bytes = append(bytes, bit...) + } + // Convert to string + str := string(bytes) + // Done + return &str +} diff --git a/testdata/alias_invalid_01.lisp b/testdata/alias_invalid_01.lisp index 2ed0c17b..d30a8377 100644 --- a/testdata/alias_invalid_01.lisp +++ b/testdata/alias_invalid_01.lisp @@ -1 +1,2 @@ +;;error:2:13-14:unknown symbol (defalias X Y) diff --git a/testdata/alias_invalid_02.lisp b/testdata/alias_invalid_02.lisp index 56e73e34..78ffd1d5 100644 --- a/testdata/alias_invalid_02.lisp +++ b/testdata/alias_invalid_02.lisp @@ -1,3 +1,4 @@ +;;error:5:7-8:unknown symbol (defcolumns Y) (defalias X Y diff --git a/testdata/alias_invalid_03.lisp b/testdata/alias_invalid_03.lisp index ec8ca7c0..60b068a6 100644 --- a/testdata/alias_invalid_03.lisp +++ b/testdata/alias_invalid_03.lisp @@ -1,2 +1,3 @@ +;;error:3:11-12:symbol already exists (defcolumns X Y) (defalias X Y) diff --git a/testdata/alias_invalid_04.lisp b/testdata/alias_invalid_04.lisp index e3027bbd..4f1bd7d6 100644 --- a/testdata/alias_invalid_04.lisp +++ b/testdata/alias_invalid_04.lisp @@ -1,2 +1,3 @@ +;;error:3:14-16:unknown symbol (defpurefun (id x) x) (defalias fn id) diff --git a/testdata/alias_invalid_05.lisp b/testdata/alias_invalid_05.lisp index 1b7447ff..cd4d666b 100644 --- a/testdata/alias_invalid_05.lisp +++ b/testdata/alias_invalid_05.lisp @@ -1 +1,2 @@ +;;error:2:13-14:unknown symbol (defalias x x) diff --git a/testdata/alias_invalid_06.lisp b/testdata/alias_invalid_06.lisp index 1a3369ee..d0f3e846 100644 --- a/testdata/alias_invalid_06.lisp +++ b/testdata/alias_invalid_06.lisp @@ -1,2 +1,4 @@ +;;error:3:13-14:unknown symbol +;;error:4:13-14:unknown symbol (defalias x y) (defalias y x) diff --git a/testdata/alias_invalid_07.lisp b/testdata/alias_invalid_07.lisp index 7f0eb8e4..663b3b12 100644 --- a/testdata/alias_invalid_07.lisp +++ b/testdata/alias_invalid_07.lisp @@ -1,3 +1,4 @@ +;;error:4:11-13:symbol already exists (defcolumns X Y) (defalias CT X) (defalias CT Y) diff --git a/testdata/array_invalid_01.lisp b/testdata/array_invalid_01.lisp index 50456c3c..5785ad6b 100644 --- a/testdata/array_invalid_01.lisp +++ b/testdata/array_invalid_01.lisp @@ -1,4 +1,4 @@ -;;error:4:24-30:not an array column +;;error:4:24-31:expected array column (defcolumns (BIT :@loob)) (defconstraint bits () [BIT 1]) diff --git a/testdata/array_invalid_02.lisp b/testdata/array_invalid_02.lisp index 58137e92..75d8d735 100644 --- a/testdata/array_invalid_02.lisp +++ b/testdata/array_invalid_02.lisp @@ -1,4 +1,4 @@ -;;error:4:24-25:expected loobean constraint (found (𝔽@loob)[4]) +;;error:4:24-27:expected loobean constraint (found (𝔽@loob)[4]) (defcolumns (BIT :@loob :array [4])) (defconstraint bits () BIT) diff --git a/testdata/array_invalid_03.lisp b/testdata/array_invalid_03.lisp index 0c04221c..e4abc5c0 100644 --- a/testdata/array_invalid_03.lisp +++ b/testdata/array_invalid_03.lisp @@ -1,4 +1,4 @@ -;;error:4:24-30:expected constant array index +;;error:4:29-30:expected constant array index (defcolumns X (BIT :@loob :array [4])) (defconstraint bits () [BIT X]) diff --git a/testdata/array_invalid_04.lisp b/testdata/array_invalid_04.lisp index b2169e56..83d9eab3 100644 --- a/testdata/array_invalid_04.lisp +++ b/testdata/array_invalid_04.lisp @@ -1,4 +1,5 @@ -;;error:12:12-18:out-of-bounds array access +;;error:13:17-18:array index out-of-bounds +;;error:13:12-19:void expression not permitted here (defcolumns (BIT :binary@prove :array [3]) (ARG :i16@loob)) diff --git a/testdata/array_invalid_05.lisp b/testdata/array_invalid_05.lisp index 4518bbc9..542e4865 100644 --- a/testdata/array_invalid_05.lisp +++ b/testdata/array_invalid_05.lisp @@ -1,4 +1,5 @@ -;;error:12:12-18:out-of-bounds array access +;;error:10:17-18:array index out-of-bounds +;;error:10:12-19:void expression not permitted here (defcolumns (BIT :binary@prove :array [4]) (ARG :i16@loob)) diff --git a/testdata/basic_invalid_01.lisp b/testdata/basic_invalid_01.lisp index 7530ad06..ecd97ee3 100644 --- a/testdata/basic_invalid_01.lisp +++ b/testdata/basic_invalid_01.lisp @@ -1 +1,2 @@ +;;error:2:15-17:empty column declaration (defcolumns X ()) diff --git a/testdata/basic_invalid_02.lisp b/testdata/basic_invalid_02.lisp index 8e36c81e..20bc84b8 100644 --- a/testdata/basic_invalid_02.lisp +++ b/testdata/basic_invalid_02.lisp @@ -1 +1,2 @@ +;;error:2:16-20:unknown type (defcolumns (X :odd)) diff --git a/testdata/basic_invalid_03.lisp b/testdata/basic_invalid_03.lisp index e339e635..f1d36257 100644 --- a/testdata/basic_invalid_03.lisp +++ b/testdata/basic_invalid_03.lisp @@ -1 +1,2 @@ +;;error:2:21-25:unknown type (defcolumns (X :i32 :odd)) diff --git a/testdata/basic_invalid_04.lisp b/testdata/basic_invalid_04.lisp index 26192a88..e7eef271 100644 --- a/testdata/basic_invalid_04.lisp +++ b/testdata/basic_invalid_04.lisp @@ -1 +1,2 @@ +;;error:2:15-16:symbol X already declared (defcolumns X X) diff --git a/testdata/basic_invalid_05.lisp b/testdata/basic_invalid_05.lisp index 6205d70d..475a8ea8 100644 --- a/testdata/basic_invalid_05.lisp +++ b/testdata/basic_invalid_05.lisp @@ -1,2 +1,3 @@ +;;error:3:13-14:symbol X already declared (defcolumns X) (defcolumns X) diff --git a/testdata/basic_invalid_06.lisp b/testdata/basic_invalid_06.lisp index 3afd6d4d..ce8b1e94 100644 --- a/testdata/basic_invalid_06.lisp +++ b/testdata/basic_invalid_06.lisp @@ -1,3 +1,4 @@ +;;error:4:21-22:unknown symbol (defcolumns X) (defconstraint c () Y) diff --git a/testdata/basic_invalid_07.lisp b/testdata/basic_invalid_07.lisp index a058f510..a1455cd5 100644 --- a/testdata/basic_invalid_07.lisp +++ b/testdata/basic_invalid_07.lisp @@ -1,3 +1,4 @@ +;;error:4:26-27:unknown symbol (defcolumns X) (defconstraint c () (+ X Y)) diff --git a/testdata/basic_invalid_08.lisp b/testdata/basic_invalid_08.lisp index 81bc9c4a..709ce7d6 100644 --- a/testdata/basic_invalid_08.lisp +++ b/testdata/basic_invalid_08.lisp @@ -1,3 +1,4 @@ +;;error:4:26-27:unknown symbol (defcolumns X) (defconstraint c (:guard Y) X) diff --git a/testdata/basic_invalid_09.lisp b/testdata/basic_invalid_09.lisp index 9f05e4ab..1a3ed9fb 100644 --- a/testdata/basic_invalid_09.lisp +++ b/testdata/basic_invalid_09.lisp @@ -1,3 +1,4 @@ +;;error:5:21-25:qualified access not permitted here (module m1) (defcolumns X) diff --git a/testdata/basic_invalid_10.lisp b/testdata/basic_invalid_10.lisp index 536bb6b7..8471e9c7 100644 --- a/testdata/basic_invalid_10.lisp +++ b/testdata/basic_invalid_10.lisp @@ -1,3 +1,5 @@ +;;error:6:26-30:qualified access not permitted here +;;error:6:32-33:expected loobean constraint (found 𝔽) (module m1) (defcolumns X) diff --git a/testdata/basic_invalid_11.lisp b/testdata/basic_invalid_11.lisp index e00982f3..ba3285e6 100644 --- a/testdata/basic_invalid_11.lisp +++ b/testdata/basic_invalid_11.lisp @@ -1,2 +1,3 @@ -(defcolumns X) +;;error:3:16-19:invalid constraint handle +(defcolumns (X :@loob)) (defconstraint (c) () X) diff --git a/testdata/basic_invalid_12.lisp b/testdata/basic_invalid_12.lisp index 3af8f254..2e6a8bf6 100644 --- a/testdata/basic_invalid_12.lisp +++ b/testdata/basic_invalid_12.lisp @@ -1 +1,2 @@ +;;error:2:1-9:malformed declaration (module) diff --git a/testdata/constant_invalid_01.lisp b/testdata/constant_invalid_01.lisp index 2bd071a4..ae3fe405 100644 --- a/testdata/constant_invalid_01.lisp +++ b/testdata/constant_invalid_01.lisp @@ -1 +1,2 @@ +;;error:2:11-12:invalid constant name (defconst 2 2) diff --git a/testdata/constant_invalid_02.lisp b/testdata/constant_invalid_02.lisp index 019d811f..a5fd21aa 100644 --- a/testdata/constant_invalid_02.lisp +++ b/testdata/constant_invalid_02.lisp @@ -1 +1,2 @@ +;;error:2:17-20:missing constant definition (defconst ONE 2 TWO) diff --git a/testdata/constant_invalid_03.lisp b/testdata/constant_invalid_03.lisp index 67c3d8f3..1be45548 100644 --- a/testdata/constant_invalid_03.lisp +++ b/testdata/constant_invalid_03.lisp @@ -1 +1,2 @@ +;;error:2:15-16:unknown symbol (defconst ONE X) diff --git a/testdata/constant_invalid_04.lisp b/testdata/constant_invalid_04.lisp index 116d4a37..04693cdc 100644 --- a/testdata/constant_invalid_04.lisp +++ b/testdata/constant_invalid_04.lisp @@ -1,2 +1,3 @@ +;;error:3:15-16:not permitted in pure context (defcolumns X) (defconst ONE X) diff --git a/testdata/constant_invalid_05.lisp b/testdata/constant_invalid_05.lisp index 61767a3d..b9ce9f90 100644 --- a/testdata/constant_invalid_05.lisp +++ b/testdata/constant_invalid_05.lisp @@ -1,2 +1,3 @@ +;;error:3:20-21:not permitted in pure context (defcolumns X) (defconst ONE (+ 1 X)) diff --git a/testdata/constant_invalid_06.lisp b/testdata/constant_invalid_06.lisp index b3c71987..13c1ecc9 100644 --- a/testdata/constant_invalid_06.lisp +++ b/testdata/constant_invalid_06.lisp @@ -1 +1,2 @@ +;;error:2:1-2:blah (defconst ONE (+ 1 ONE)) diff --git a/testdata/constant_invalid_07.lisp b/testdata/constant_invalid_07.lisp index d158b6ca..beb1e41e 100644 --- a/testdata/constant_invalid_07.lisp +++ b/testdata/constant_invalid_07.lisp @@ -1 +1,2 @@ +;;error:2:1-2:blah (defconst ONE TWO TWO (+ 1 ONE)) diff --git a/testdata/constant_invalid_08.lisp b/testdata/constant_invalid_08.lisp index c1b6b0d6..c484809b 100644 --- a/testdata/constant_invalid_08.lisp +++ b/testdata/constant_invalid_08.lisp @@ -1,2 +1,3 @@ +;;error:2:1-2:blah (defconst ONE TWO) (defconst TWO (+ 1 ONE)) diff --git a/testdata/constant_invalid_09.lisp b/testdata/constant_invalid_09.lisp index 74c3b687..b22a7619 100644 --- a/testdata/constant_invalid_09.lisp +++ b/testdata/constant_invalid_09.lisp @@ -1,3 +1,4 @@ +;;error:4:18-23:not permitted in pure context (defcolumns A) (defun (get) A) (defconst BROKEN (get)) diff --git a/testdata/constant_invalid_10.lisp b/testdata/constant_invalid_10.lisp index 927fdc2b..480027ef 100644 --- a/testdata/constant_invalid_10.lisp +++ b/testdata/constant_invalid_10.lisp @@ -1,3 +1,4 @@ +;;error:9:13-14:symbol X already declared (defconst X 1 ONE X diff --git a/testdata/constant_invalid_11.lisp b/testdata/constant_invalid_11.lisp index 84266f5d..3e67a4ea 100644 --- a/testdata/constant_invalid_11.lisp +++ b/testdata/constant_invalid_11.lisp @@ -1,2 +1,4 @@ +;;error:4:43-46:not permitted in pure context +(defpurefun ((vanishes! :@loob) x) x) (defcolumns X Y TWO) -(defconstraint c1 () (- Y (^ X TWO))) +(defconstraint c1 () (vanishes! (- Y (^ X TWO)))) diff --git a/testdata/constant_invalid_12.lisp b/testdata/constant_invalid_12.lisp index 1b36f39e..0d943db6 100644 --- a/testdata/constant_invalid_12.lisp +++ b/testdata/constant_invalid_12.lisp @@ -1,3 +1,6 @@ +;;error:6:32-37:not permitted in pure context +;;error:6:22-39:expected loobean constraint (found 𝔽) +(defpurefun ((vanishes! :@loob) x) x) (defcolumns X Y Z) (defun (TWO) Z) (defconstraint c1 () (- Y (^ X (TWO)))) diff --git a/testdata/constant_invalid_13.lisp b/testdata/constant_invalid_13.lisp index e7aaadca..51fe1d26 100644 --- a/testdata/constant_invalid_13.lisp +++ b/testdata/constant_invalid_13.lisp @@ -1,2 +1,5 @@ +;;error:5:41-44:not permitted in pure context +;;error:5:71-74:not permitted in pure context +;;error:5:22-77:expected loobean constraint (found 𝔽) (defcolumns CT ONE) (defconstraint c1 () (* (- CT (shift CT ONE)) (- (+ CT ONE) (shift CT ONE)))) diff --git a/testdata/constant_invalid_14.lisp b/testdata/constant_invalid_14.lisp index 4e90836b..aecc7ffc 100644 --- a/testdata/constant_invalid_14.lisp +++ b/testdata/constant_invalid_14.lisp @@ -1,3 +1,6 @@ +;;error:6:41-46:not permitted in pure context +;;error:6:75-80:not permitted in pure context +;;error:6:22-83:expected loobean constraint (found 𝔽) (defcolumns CT X) (defun (ONE) X) (defconstraint c1 () (* (- CT (shift CT (ONE))) (- (+ CT (ONE)) (shift CT (ONE))))) diff --git a/testdata/constant_invalid_15.lisp b/testdata/constant_invalid_15.lisp index 1b56aefb..2d351b14 100644 --- a/testdata/constant_invalid_15.lisp +++ b/testdata/constant_invalid_15.lisp @@ -1,2 +1,3 @@ +;;error:3:13-18:not permitted in pure context (defun (ONE) 1) (defconst X (ONE)) diff --git a/testdata/constant_invalid_16.lisp b/testdata/constant_invalid_16.lisp index 4d193441..5a884e77 100644 --- a/testdata/constant_invalid_16.lisp +++ b/testdata/constant_invalid_16.lisp @@ -1,3 +1,5 @@ +;;error:5:32-37:not permitted in pure context +;;error:5:22-39:expected loobean constraint (found 𝔽) (defcolumns X) (defun (ONE) 1) (defconstraint c1 () (* X (^ 2 (ONE)))) diff --git a/testdata/constant_invalid_17.lisp b/testdata/constant_invalid_17.lisp index 68148bb0..469ecff0 100644 --- a/testdata/constant_invalid_17.lisp +++ b/testdata/constant_invalid_17.lisp @@ -1,3 +1,5 @@ +;;error:5:31-36:not permitted in pure context +;;error:5:22-37:expected loobean constraint (found 𝔽) (defcolumns X) (defun (ONE) 1) (defconstraint c1 () (shift X (ONE))) diff --git a/testdata/debug_invalid_01.lisp b/testdata/debug_invalid_01.lisp index f389fa6a..70aa4ca6 100644 --- a/testdata/debug_invalid_01.lisp +++ b/testdata/debug_invalid_01.lisp @@ -1,3 +1,5 @@ +;;error:6:17-26:void expression not permitted here +(defpurefun ((vanishes! :@loob :force) e0) e0) (defcolumns X Y) (defconstraint c1 () diff --git a/testdata/debug_invalid_02.lisp b/testdata/debug_invalid_02.lisp index a5a9c8fc..3c9d4657 100644 --- a/testdata/debug_invalid_02.lisp +++ b/testdata/debug_invalid_02.lisp @@ -1,3 +1,5 @@ +;;error:6:22-31:void expression not permitted here +(defpurefun ((vanishes! :@loob :force) e0) e0) (defcolumns X Y) (defconstraint c1 () diff --git a/testdata/for_invalid_01.lisp b/testdata/for_invalid_01.lisp index f7fa9253..ebd2526d 100644 --- a/testdata/for_invalid_01.lisp +++ b/testdata/for_invalid_01.lisp @@ -1,3 +1,4 @@ +;;error:5:3-16:expected 3 arguments, found 2 (defcolumns X) ;; X != 1 && X != 2 && X != 3 (defconstraint X_t1 () diff --git a/testdata/for_invalid_02.lisp b/testdata/for_invalid_02.lisp index 2448373b..b4fecf4d 100644 --- a/testdata/for_invalid_02.lisp +++ b/testdata/for_invalid_02.lisp @@ -1,3 +1,4 @@ +;;error:5:8-11:invalid index variable (defcolumns X) (defconstraint X_t1 () diff --git a/testdata/for_invalid_03.lisp b/testdata/for_invalid_03.lisp index 75d6ecc6..7f68fad5 100644 --- a/testdata/for_invalid_03.lisp +++ b/testdata/for_invalid_03.lisp @@ -1,3 +1,7 @@ +;;error:8:10-12:invalid interval +;;error:11:10-14:invalid interval +;;error:14:10-14:invalid interval +;;error:17:10-17:invalid interval (defcolumns X) (defconstraint X_t1 () diff --git a/testdata/fun_invalid_01.lisp b/testdata/fun_invalid_01.lisp index bdb798d6..952d0658 100644 --- a/testdata/fun_invalid_01.lisp +++ b/testdata/fun_invalid_01.lisp @@ -1,3 +1,4 @@ +;;error:4:27-29:unknown symbol (defcolumns A) (defun (id x) x) (defconstraint test () (+ id A)) diff --git a/testdata/fun_invalid_02.lisp b/testdata/fun_invalid_02.lisp index 19591539..fee15487 100644 --- a/testdata/fun_invalid_02.lisp +++ b/testdata/fun_invalid_02.lisp @@ -1,3 +1,5 @@ +;;error:5:24-32:incorrect number of arguments (found 2) +;;error:5:24-32:ambiguous invocation (defcolumns A) (defun (id x) x) (defconstraint test () (id A A)) diff --git a/testdata/fun_invalid_03.lisp b/testdata/fun_invalid_03.lisp index 1eb680cf..8482eee6 100644 --- a/testdata/fun_invalid_03.lisp +++ b/testdata/fun_invalid_03.lisp @@ -1 +1,2 @@ +;;error:2:20-21:unknown symbol (defun (id x) (+ x y)) diff --git a/testdata/fun_invalid_04.lisp b/testdata/fun_invalid_04.lisp index 758df2fb..21a21eee 100644 --- a/testdata/fun_invalid_04.lisp +++ b/testdata/fun_invalid_04.lisp @@ -1,3 +1,4 @@ +;;error:2:1-2:blah (defcolumns X) ;; recursive :) (defun (id x) (+ x (id x))) diff --git a/testdata/funalias_invalid_01.lisp b/testdata/funalias_invalid_01.lisp index 7a576a57..52753505 100644 --- a/testdata/funalias_invalid_01.lisp +++ b/testdata/funalias_invalid_01.lisp @@ -1,2 +1,3 @@ +;;error:3:17-18:unknown symbol (defcolumns X) (defunalias INC X) diff --git a/testdata/funalias_invalid_02.lisp b/testdata/funalias_invalid_02.lisp index 7dacf524..1338e5f1 100644 --- a/testdata/funalias_invalid_02.lisp +++ b/testdata/funalias_invalid_02.lisp @@ -1,2 +1,3 @@ +;;error:3:17-18:unknown symbol (defconst X 1) (defunalias INC X) diff --git a/testdata/funalias_invalid_03.lisp b/testdata/funalias_invalid_03.lisp index ad4c8f8f..1f480808 100644 --- a/testdata/funalias_invalid_03.lisp +++ b/testdata/funalias_invalid_03.lisp @@ -1 +1,2 @@ +;;error:2:15-16:unknown symbol (defunalias X Y) diff --git a/testdata/funalias_invalid_04.lisp b/testdata/funalias_invalid_04.lisp index e7fb78e9..17471864 100644 --- a/testdata/funalias_invalid_04.lisp +++ b/testdata/funalias_invalid_04.lisp @@ -1 +1,2 @@ +;;error:2:15-16:unknown symbol (defunalias X X) diff --git a/testdata/funalias_invalid_05.lisp b/testdata/funalias_invalid_05.lisp index 4b7af02b..17bd3d74 100644 --- a/testdata/funalias_invalid_05.lisp +++ b/testdata/funalias_invalid_05.lisp @@ -1,3 +1,4 @@ +;;error:3:13-14:symbol already exists (defpurefun (or x y) (* x y)) (defunalias + or) diff --git a/testdata/if_invalid_01.lisp b/testdata/if_invalid_01.lisp index ab17409a..838a8d2d 100644 --- a/testdata/if_invalid_01.lisp +++ b/testdata/if_invalid_01.lisp @@ -1,2 +1,3 @@ +;;error:3:22-28:incorrect number of arguments (defcolumns A) (defconstraint c1 () (if A)) diff --git a/testdata/if_invalid_02.lisp b/testdata/if_invalid_02.lisp index 16bc8400..b47da767 100644 --- a/testdata/if_invalid_02.lisp +++ b/testdata/if_invalid_02.lisp @@ -1,2 +1,3 @@ +;;error:3:22-34:incorrect number of arguments (defcolumns A B C D) (defconstraint c1 () (if A B C D)) diff --git a/testdata/if_invalid_03.lisp b/testdata/if_invalid_03.lisp new file mode 100644 index 00000000..fe919b0c --- /dev/null +++ b/testdata/if_invalid_03.lisp @@ -0,0 +1,3 @@ +;;error:3:26-27:invalid condition (neither loobean nor boolean) +(defcolumns A B C) +(defconstraint c1 () (if A B C)) diff --git a/testdata/interleave_invalid_01.lisp b/testdata/interleave_invalid_01.lisp index 8032982b..00a963db 100644 --- a/testdata/interleave_invalid_01.lisp +++ b/testdata/interleave_invalid_01.lisp @@ -1,2 +1,3 @@ +;;error:3:17-18:symbol Z already declared (defcolumns X Y Z) (definterleaved Z (X Y)) diff --git a/testdata/interleave_invalid_02.lisp b/testdata/interleave_invalid_02.lisp index e12b5aae..2387b435 100644 --- a/testdata/interleave_invalid_02.lisp +++ b/testdata/interleave_invalid_02.lisp @@ -1,2 +1,3 @@ +;;error:3:17-19:malformed target column (defcolumns X Y) (definterleaved () (X Y)) diff --git a/testdata/interleave_invalid_03.lisp b/testdata/interleave_invalid_03.lisp index 169140b9..b0c5bb7b 100644 --- a/testdata/interleave_invalid_03.lisp +++ b/testdata/interleave_invalid_03.lisp @@ -1,2 +1,3 @@ +;;error:3:20-23:malformed source column (defcolumns X Y) (definterleaved Z ((X) Y)) diff --git a/testdata/interleave_invalid_04.lisp b/testdata/interleave_invalid_04.lisp index 549e6839..38440145 100644 --- a/testdata/interleave_invalid_04.lisp +++ b/testdata/interleave_invalid_04.lisp @@ -1,3 +1,4 @@ +;;error:4:1-25:source column Y has incompatible length multiplier (defcolumns X Y) (definterleaved A (X Y)) (definterleaved B (A Y)) diff --git a/testdata/interleave_invalid_05.lisp b/testdata/interleave_invalid_05.lisp index 8a045a7b..9374ca9f 100644 --- a/testdata/interleave_invalid_05.lisp +++ b/testdata/interleave_invalid_05.lisp @@ -1,3 +1,4 @@ +;;error:4:1-25:source column A has incompatible length multiplier (defcolumns X Y) (definterleaved A (X Y)) (definterleaved B (X A)) diff --git a/testdata/interleave_invalid_06.lisp b/testdata/interleave_invalid_06.lisp index 9d211763..e09bfdae 100644 --- a/testdata/interleave_invalid_06.lisp +++ b/testdata/interleave_invalid_06.lisp @@ -1,3 +1,5 @@ +;;error:5:27-28:conflicting context +;;error:5:22-29:expected loobean constraint (found 𝔽) (defcolumns X Y) (definterleaved A (X Y)) (defconstraint c1 () (+ A X)) diff --git a/testdata/interleave_invalid_07.lisp b/testdata/interleave_invalid_07.lisp index 4fcf9336..a90d20d7 100644 --- a/testdata/interleave_invalid_07.lisp +++ b/testdata/interleave_invalid_07.lisp @@ -1,3 +1,4 @@ +;;error:4:22-23:conflicting context (defcolumns X Y) (definterleaved A (X Y)) (defproperty p1 (+ A X)) diff --git a/testdata/interleave_invalid_08.lisp b/testdata/interleave_invalid_08.lisp index ca86f659..053001f8 100644 --- a/testdata/interleave_invalid_08.lisp +++ b/testdata/interleave_invalid_08.lisp @@ -1,3 +1,4 @@ +;;error:4:18-19:conflicting context (defcolumns X Y) (definterleaved A (X Y)) (deflookup l1 (A X) (Y Y)) diff --git a/testdata/interleave_invalid_09.lisp b/testdata/interleave_invalid_09.lisp index 8dd29cbb..28ae1cb8 100644 --- a/testdata/interleave_invalid_09.lisp +++ b/testdata/interleave_invalid_09.lisp @@ -1,3 +1,5 @@ +;;error:5:24-29:fixed-width type required +;;error:5:30-35:incompatible length multiplier (defcolumns X Y) (definterleaved Z (X Y)) (defpermutation (A B) ((+ Z) (+ Y))) diff --git a/testdata/interleave_invalid_10.lisp b/testdata/interleave_invalid_10.lisp index 13629927..0022b5f1 100644 --- a/testdata/interleave_invalid_10.lisp +++ b/testdata/interleave_invalid_10.lisp @@ -1,3 +1,5 @@ +;;error:5:24-29:fixed-width type required +;;error:5:30-35:incompatible length multiplier (defcolumns X Y) (definterleaved Z (X Y)) (defpermutation (A B) ((+ X) (+ Z))) diff --git a/testdata/interleave_invalid_11.lisp b/testdata/interleave_invalid_11.lisp index caf33687..3012f4b2 100644 --- a/testdata/interleave_invalid_11.lisp +++ b/testdata/interleave_invalid_11.lisp @@ -1,3 +1,4 @@ +;;error:4:22-23:unknown symbol (defcolumns X) (defconst Y 1) (definterleaved Z (X Y)) diff --git a/testdata/interleave_invalid_12.lisp b/testdata/interleave_invalid_12.lisp index cf3ce2bf..05a9baa3 100644 --- a/testdata/interleave_invalid_12.lisp +++ b/testdata/interleave_invalid_12.lisp @@ -1,3 +1,4 @@ +;;error:4:20-21:unknown symbol (defcolumns Y) (defconst X 1) (definterleaved Z (X Y)) diff --git a/testdata/lookup_invalid_01.lisp b/testdata/lookup_invalid_01.lisp index 5ef5098b..cb58bd92 100644 --- a/testdata/lookup_invalid_01.lisp +++ b/testdata/lookup_invalid_01.lisp @@ -1,2 +1,3 @@ +;;error:3:21-26:incorrect number of columns (defcolumns X Y) (deflookup test (Y) (X X)) diff --git a/testdata/lookup_invalid_02.lisp b/testdata/lookup_invalid_02.lisp index 2ca809dc..0db775b0 100644 --- a/testdata/lookup_invalid_02.lisp +++ b/testdata/lookup_invalid_02.lisp @@ -1,2 +1,3 @@ +;;error:3:23-26:incorrect number of columns (defcolumns X Y) (deflookup test (Y Y) (X)) diff --git a/testdata/lookup_invalid_03.lisp b/testdata/lookup_invalid_03.lisp index 38e1c64a..a5728d44 100644 --- a/testdata/lookup_invalid_03.lisp +++ b/testdata/lookup_invalid_03.lisp @@ -1,2 +1,3 @@ +;;error:3:12-14:malformed handle (defcolumns X Y) (deflookup () (Y) (X)) diff --git a/testdata/lookup_invalid_04.lisp b/testdata/lookup_invalid_04.lisp index a3ebf081..25fb736c 100644 --- a/testdata/lookup_invalid_04.lisp +++ b/testdata/lookup_invalid_04.lisp @@ -1,3 +1,4 @@ +;;error:3:22-23:unknown symbol (defcolumns X) (deflookup test (X) (Y)) diff --git a/testdata/lookup_invalid_05.lisp b/testdata/lookup_invalid_05.lisp index 90641027..9198d781 100644 --- a/testdata/lookup_invalid_05.lisp +++ b/testdata/lookup_invalid_05.lisp @@ -1,3 +1,4 @@ +;;error:3:18-19:unknown symbol (defcolumns X) (deflookup test (Y) (X)) diff --git a/testdata/lookup_invalid_06.lisp b/testdata/lookup_invalid_06.lisp index a9c2d4ce..33b03d96 100644 --- a/testdata/lookup_invalid_06.lisp +++ b/testdata/lookup_invalid_06.lisp @@ -1,3 +1,5 @@ +;;error:4:18-22:unknown symbol +;;error:4:23-27:unknown symbol (defcolumns X Y) (deflookup test (m1.A m2.B) (X Y)) diff --git a/testdata/lookup_invalid_07.lisp b/testdata/lookup_invalid_07.lisp index 2f498ee9..5330cdc8 100644 --- a/testdata/lookup_invalid_07.lisp +++ b/testdata/lookup_invalid_07.lisp @@ -1,3 +1,5 @@ +;;error:4:21-25:unknown symbol +;;error:4:26-30:unknown symbol (defcolumns X) (deflookup test ((+ m1.A m2.B)) (X)) diff --git a/testdata/lookup_invalid_08.lisp b/testdata/lookup_invalid_08.lisp index 6c7529da..6bd3fdb0 100644 --- a/testdata/lookup_invalid_08.lisp +++ b/testdata/lookup_invalid_08.lisp @@ -1,3 +1,4 @@ +;;error:3:21-25:unknown symbol (defcolumns X) (deflookup test ((+ m2.A 1)) (X)) diff --git a/testdata/lookup_invalid_09.lisp b/testdata/lookup_invalid_09.lisp index 12d932f2..12f5a842 100644 --- a/testdata/lookup_invalid_09.lisp +++ b/testdata/lookup_invalid_09.lisp @@ -1,3 +1,4 @@ +;;error:3:25-29:unknown symbol (defcolumns X) (deflookup test (X) ((+ m2.A 1))) diff --git a/testdata/module_invalid_01.lisp b/testdata/module_invalid_01.lisp index 900cf2d2..7987988b 100644 --- a/testdata/module_invalid_01.lisp +++ b/testdata/module_invalid_01.lisp @@ -1,3 +1,4 @@ +;;error:6:13-14:unknown symbol (module m1) (defcolumns X) diff --git a/testdata/norm_invalid_01.lisp b/testdata/norm_invalid_01.lisp index 24add0c2..26f53dea 100644 --- a/testdata/norm_invalid_01.lisp +++ b/testdata/norm_invalid_01.lisp @@ -1,2 +1,3 @@ +;;error:3:33-40:incorrect number of arguments (defcolumns ST A) (defconstraint c1 () (* ST (- 1 (~ A 0)))) diff --git a/testdata/permute_invalid_01.lisp b/testdata/permute_invalid_01.lisp index b486f28e..4bdb7ea1 100644 --- a/testdata/permute_invalid_01.lisp +++ b/testdata/permute_invalid_01.lisp @@ -1,2 +1,3 @@ +;;error:3:17-20:too many target columns (defcolumns (X :i16@prove)) (defpermutation (Z) ()) diff --git a/testdata/permute_invalid_02.lisp b/testdata/permute_invalid_02.lisp index cba2d289..0e799e31 100644 --- a/testdata/permute_invalid_02.lisp +++ b/testdata/permute_invalid_02.lisp @@ -1,2 +1,4 @@ +;;error:4:17-20:too few target columns +;;error:4:22-23:missing sort direction (defcolumns (X :i16@prove)) (defpermutation (Z) (X X)) diff --git a/testdata/permute_invalid_03.lisp b/testdata/permute_invalid_03.lisp index 74cf7e5a..0331fe1c 100644 --- a/testdata/permute_invalid_03.lisp +++ b/testdata/permute_invalid_03.lisp @@ -1,2 +1,3 @@ +;;error:3:22-25:malformed permutation column (defcolumns (X :i16@prove)) (defpermutation (Z) ((X))) diff --git a/testdata/permute_invalid_04.lisp b/testdata/permute_invalid_04.lisp index 0284c87f..3fe0b07b 100644 --- a/testdata/permute_invalid_04.lisp +++ b/testdata/permute_invalid_04.lisp @@ -1,2 +1,3 @@ +;;error:3:23-24:malformed sort direction (defcolumns (X :i16@prove)) (defpermutation (Z) ((? X))) diff --git a/testdata/permute_invalid_05.lisp b/testdata/permute_invalid_05.lisp index 70dcc8e0..4479ddd0 100644 --- a/testdata/permute_invalid_05.lisp +++ b/testdata/permute_invalid_05.lisp @@ -1,3 +1,4 @@ +;;error:4:22-30:unknown symbol (module m1) (defcolumns (X :i16@prove)) (defpermutation (Z) ((+ m1.X))) diff --git a/testdata/permute_invalid_06.lisp b/testdata/permute_invalid_06.lisp index 4f3d0a06..8829984d 100644 --- a/testdata/permute_invalid_06.lisp +++ b/testdata/permute_invalid_06.lisp @@ -1,2 +1,3 @@ +;;error:3:22-27:fixed-width type required (defcolumns X) (defpermutation (Z) ((+ X))) diff --git a/testdata/permute_invalid_07.lisp b/testdata/permute_invalid_07.lisp index fb1d06fe..ed422cc3 100644 --- a/testdata/permute_invalid_07.lisp +++ b/testdata/permute_invalid_07.lisp @@ -1,3 +1,4 @@ +;;error:4:22-23:missing sort direction (module m1) (defcolumns (X :i16)) (defpermutation (Z) (X)) diff --git a/testdata/permute_invalid_08.lisp b/testdata/permute_invalid_08.lisp index 527e13b9..40aa7180 100644 --- a/testdata/permute_invalid_08.lisp +++ b/testdata/permute_invalid_08.lisp @@ -1,2 +1,3 @@ +;;error:3:22-27:unknown symbol (defconst X 100) (defpermutation (Y) ((+ X))) diff --git a/testdata/property_invalid_01.lisp b/testdata/property_invalid_01.lisp index 7dd0672a..6f7d8b65 100644 --- a/testdata/property_invalid_01.lisp +++ b/testdata/property_invalid_01.lisp @@ -1,2 +1,3 @@ +;;error:3:14-17:expected constraint handle (defcolumns X) (defproperty (c) X) diff --git a/testdata/property_invalid_02.lisp b/testdata/property_invalid_02.lisp index ae733bd0..e160e6d0 100644 --- a/testdata/property_invalid_02.lisp +++ b/testdata/property_invalid_02.lisp @@ -1,2 +1,3 @@ +;;error:3:1-21:malformed declaration (defcolumns X) (defproperty p1 X X) diff --git a/testdata/purefun_invalid_01.lisp b/testdata/purefun_invalid_01.lisp index b33fe145..674663dc 100644 --- a/testdata/purefun_invalid_01.lisp +++ b/testdata/purefun_invalid_01.lisp @@ -1,3 +1,4 @@ +;;error:4:25-27:unknown symbol (defcolumns A) ;;(defpurefun (id x) x) (defconstraint test () (id A)) diff --git a/testdata/purefun_invalid_02.lisp b/testdata/purefun_invalid_02.lisp index c6a92174..3578786f 100644 --- a/testdata/purefun_invalid_02.lisp +++ b/testdata/purefun_invalid_02.lisp @@ -1,3 +1,4 @@ +;;error:4:27-29:unknown symbol (defcolumns A) (defpurefun (id x) x) (defconstraint test () (+ id A)) diff --git a/testdata/purefun_invalid_03.lisp b/testdata/purefun_invalid_03.lisp index 742d9e3f..ae589aef 100644 --- a/testdata/purefun_invalid_03.lisp +++ b/testdata/purefun_invalid_03.lisp @@ -1,3 +1,5 @@ +;;error:5:24-32:incorrect number of arguments (found 2) +;;error:5:24-32:ambiguous invocation (defcolumns A) (defpurefun (id x) x) (defconstraint test () (id A A)) diff --git a/testdata/purefun_invalid_04.lisp b/testdata/purefun_invalid_04.lisp index b7a1d3b6..e75c7e90 100644 --- a/testdata/purefun_invalid_04.lisp +++ b/testdata/purefun_invalid_04.lisp @@ -1,3 +1,4 @@ +;;error:4:25-26:not permitted in pure context (defcolumns A) ;; not pure! (defpurefun (id x) (+ x A)) diff --git a/testdata/purefun_invalid_05.lisp b/testdata/purefun_invalid_05.lisp index 8624a7dd..e2d02082 100644 --- a/testdata/purefun_invalid_05.lisp +++ b/testdata/purefun_invalid_05.lisp @@ -1 +1,2 @@ +;;error:2:25-26:unknown symbol (defpurefun (id x) (+ x y)) diff --git a/testdata/purefun_invalid_06.lisp b/testdata/purefun_invalid_06.lisp index a1ba38a5..c0547144 100644 --- a/testdata/purefun_invalid_06.lisp +++ b/testdata/purefun_invalid_06.lisp @@ -1,3 +1,4 @@ +;;error:2:1-2:blah (defcolumns X) ;; recursive :) (defpurefun (id x) (+ x (id x))) diff --git a/testdata/purefun_invalid_07.lisp b/testdata/purefun_invalid_07.lisp index 73cbc050..077f8c8a 100644 --- a/testdata/purefun_invalid_07.lisp +++ b/testdata/purefun_invalid_07.lisp @@ -1,3 +1,4 @@ +;;error:5:25-31:not permitted in pure context (defcolumns A) (defun (getA) A) ;; not pure! diff --git a/testdata/purefun_invalid_08.lisp b/testdata/purefun_invalid_08.lisp index 5ff9847a..a7cd60e2 100644 --- a/testdata/purefun_invalid_08.lisp +++ b/testdata/purefun_invalid_08.lisp @@ -1,3 +1,4 @@ +;;error:6:22-28:expected loobean constraint (found 𝔽) (defcolumns (X :@loob) Y) (defpurefun (id x) x) diff --git a/testdata/purefun_invalid_09.lisp b/testdata/purefun_invalid_09.lisp index db547152..0fe83c92 100644 --- a/testdata/purefun_invalid_09.lisp +++ b/testdata/purefun_invalid_09.lisp @@ -1,3 +1,5 @@ +;;error:6:39-40:expected type u1 (found 𝔽) +;;error:7:39-40:expected type u1 (found u16) (defpurefun ((eq :binary@loob :force) (x :binary) (y :binary)) (^ (- x y) 2)) ;; (defcolumns (X :binary@loob) Y (Z :i16)) diff --git a/testdata/purefun_invalid_10.lisp b/testdata/purefun_invalid_10.lisp index 3c26d8d0..3ac76c94 100644 --- a/testdata/purefun_invalid_10.lisp +++ b/testdata/purefun_invalid_10.lisp @@ -1,2 +1,3 @@ +;;error:3:1-29:symbol * already declared ;; Attempt to overload intrinsic. (defpurefun (* x y) (* x y)) diff --git a/testdata/purefun_invalid_11.lisp b/testdata/purefun_invalid_11.lisp index 016297e0..a98f5de7 100644 --- a/testdata/purefun_invalid_11.lisp +++ b/testdata/purefun_invalid_11.lisp @@ -1,3 +1,4 @@ +;;error:4:1-50:symbol eq already declared ;; Duplicate overload is always a syntax error. (defpurefun (eq (x :binary) (y :binary)) (- x y)) (defpurefun (eq (x :binary) (y :binary)) (+ x y)) diff --git a/testdata/purefun_invalid_12.lisp b/testdata/purefun_invalid_12.lisp index 7ab60b95..088c8dfb 100644 --- a/testdata/purefun_invalid_12.lisp +++ b/testdata/purefun_invalid_12.lisp @@ -1,3 +1,4 @@ +;;error:4:1-25:symbol eq already declared ;; Cannot overload pure with impure, and vice versa. (defpurefun (eq (x :binary) (y :binary)) (- x y)) (defun (eq x y) (+ x y)) diff --git a/testdata/purefun_invalid_13.lisp b/testdata/purefun_invalid_13.lisp index 6940ac6f..844d1e0e 100644 --- a/testdata/purefun_invalid_13.lisp +++ b/testdata/purefun_invalid_13.lisp @@ -1,3 +1,4 @@ +;;error:8:22-30:ambiguous invocation (defpurefun (fn (x :binary) y) (- x y)) (defpurefun (fn x (y :binary)) (+ x y)) (defpurefun (fn x y) (* x y)) diff --git a/testdata/range_invalid_01.lisp b/testdata/range_invalid_01.lisp index c93036fe..506e598b 100644 --- a/testdata/range_invalid_01.lisp +++ b/testdata/range_invalid_01.lisp @@ -1,3 +1,4 @@ +;;error:4:1-15:malformed declaration (defcolumns X Y) (definrange X) diff --git a/testdata/range_invalid_02.lisp b/testdata/range_invalid_02.lisp index c994a0f3..9f21dd5b 100644 --- a/testdata/range_invalid_02.lisp +++ b/testdata/range_invalid_02.lisp @@ -1,2 +1,3 @@ +;;error:3:15-16:malformed bound (defcolumns X Y) (definrange X Y) diff --git a/testdata/range_invalid_03.lisp b/testdata/range_invalid_03.lisp index 145cf8df..bd8be5bd 100644 --- a/testdata/range_invalid_03.lisp +++ b/testdata/range_invalid_03.lisp @@ -1,2 +1,3 @@ +;;error:3:1-19:malformed declaration (defcolumns X Y) (definrange X 2 Y) diff --git a/testdata/range_invalid_04.lisp b/testdata/range_invalid_04.lisp index f8f667e0..38d3b818 100644 --- a/testdata/range_invalid_04.lisp +++ b/testdata/range_invalid_04.lisp @@ -1,2 +1,3 @@ +;;error:3:13-14:unknown symbol (defcolumns X) (definrange Y 2) diff --git a/testdata/reduce_invalid_01.lisp b/testdata/reduce_invalid_01.lisp index 56142904..8f1481fa 100644 --- a/testdata/reduce_invalid_01.lisp +++ b/testdata/reduce_invalid_01.lisp @@ -1,2 +1,3 @@ +;;error:3:33-34:unknown symbol (defcolumns (X :@loob) (Y :@loob)) (defconstraint c1 () (reduce + (X Y))) diff --git a/testdata/reduce_invalid_02.lisp b/testdata/reduce_invalid_02.lisp index 7bcbf8e1..b24d4615 100644 --- a/testdata/reduce_invalid_02.lisp +++ b/testdata/reduce_invalid_02.lisp @@ -1 +1,2 @@ +;;error:2:22-32:expected 2 arguments, found 1 (defconstraint c1 () (reduce +)) diff --git a/testdata/reduce_invalid_03.lisp b/testdata/reduce_invalid_03.lisp index 850b4246..9cd995e4 100644 --- a/testdata/reduce_invalid_03.lisp +++ b/testdata/reduce_invalid_03.lisp @@ -1,2 +1,3 @@ +;;error:3:22-44:expected loobean constraint (found 𝔽) (defcolumns X Y) (defconstraint c1 () (reduce + (begin X Y))) diff --git a/testdata/reduce_invalid_04.lisp b/testdata/reduce_invalid_04.lisp index 8e209510..c95700a6 100644 --- a/testdata/reduce_invalid_04.lisp +++ b/testdata/reduce_invalid_04.lisp @@ -1,3 +1,4 @@ +;;error:4:22-45:incorrect number of arguments (expected 2) (defcolumns (X :@loob) (Y :@loob)) (defpurefun (op x y z) (+ x y z)) (defconstraint c1 () (reduce op (begin X Y))) diff --git a/testdata/reduce_invalid_05.lisp b/testdata/reduce_invalid_05.lisp index 0e2deb5a..6424ea3c 100644 --- a/testdata/reduce_invalid_05.lisp +++ b/testdata/reduce_invalid_05.lisp @@ -1,3 +1,4 @@ +;;error:4:22-45:incorrect number of arguments (expected 2) (defcolumns (X :@loob) (Y :@loob)) (defpurefun (op x) (+ x 1)) (defconstraint c1 () (reduce op (begin X Y))) diff --git a/testdata/shift_invalid_01.lisp b/testdata/shift_invalid_01.lisp index 9c19c4b4..db3dc2e7 100644 --- a/testdata/shift_invalid_01.lisp +++ b/testdata/shift_invalid_01.lisp @@ -1,2 +1,3 @@ -(defcolumns X ST) +;;error:3:37-38:not permitted in pure context +(defcolumns (X :@loob) (ST :@loob)) (defconstraint c1 () (* ST (shift X X))) diff --git a/testdata/shift_invalid_02.lisp b/testdata/shift_invalid_02.lisp index e9eb2892..c0ee47b4 100644 --- a/testdata/shift_invalid_02.lisp +++ b/testdata/shift_invalid_02.lisp @@ -1,2 +1,3 @@ +;;error:3:28-37:incorrect number of arguments (defcolumns X ST) (defconstraint c1 () (* ST (shift X))) diff --git a/testdata/type_invalid_01.lisp b/testdata/type_invalid_01.lisp index 674c494f..1430cf78 100644 --- a/testdata/type_invalid_01.lisp +++ b/testdata/type_invalid_01.lisp @@ -1,3 +1,4 @@ +;;error:6:22-32:expected loobean constraint (found u8) (defcolumns (BIT :binary@loob) (X :i8)) diff --git a/testdata/type_invalid_02.lisp b/testdata/type_invalid_02.lisp index d4ff88a5..3abfb16f 100644 --- a/testdata/type_invalid_02.lisp +++ b/testdata/type_invalid_02.lisp @@ -1,3 +1,4 @@ +;;error:6:26-29:invalid condition (neither loobean nor boolean) (defcolumns (BIT :binary) (X :i8@loob)) diff --git a/testdata/type_invalid_03.lisp b/testdata/type_invalid_03.lisp index d062e769..4dcc57d0 100644 --- a/testdata/type_invalid_03.lisp +++ b/testdata/type_invalid_03.lisp @@ -1,3 +1,4 @@ +;;error:6:26-29:invalid condition (neither loobean nor boolean) (defcolumns (BIT :i8) (X :i8@loob)) diff --git a/testdata/type_invalid_04.lisp b/testdata/type_invalid_04.lisp index 2336e90a..142b90f7 100644 --- a/testdata/type_invalid_04.lisp +++ b/testdata/type_invalid_04.lisp @@ -1,3 +1,4 @@ +;;error:6:22-32:expected loobean constraint (found u1@bool) (defcolumns (BIT :binary@loob) (X :binary@bool)) diff --git a/testdata/type_invalid_05.lisp b/testdata/type_invalid_05.lisp index 6b8e0f38..7c071ab3 100644 --- a/testdata/type_invalid_05.lisp +++ b/testdata/type_invalid_05.lisp @@ -1,3 +1,4 @@ +;;error:6:26-35:invalid condition (neither loobean nor boolean) (defcolumns (BIT :binary) (X :binary@loob)) diff --git a/testdata/type_invalid_06.lisp b/testdata/type_invalid_06.lisp index 8adcd7b9..9eedd208 100644 --- a/testdata/type_invalid_06.lisp +++ b/testdata/type_invalid_06.lisp @@ -1,3 +1,4 @@ +;;error:4:27-30:unexpected loobean guard (defcolumns (BIT :i1@loob) (X :i1@loob)) (defconstraint c1 (:guard BIT) X) diff --git a/testdata/type_invalid_07.lisp b/testdata/type_invalid_07.lisp index 92f87b04..04c1c034 100644 --- a/testdata/type_invalid_07.lisp +++ b/testdata/type_invalid_07.lisp @@ -1,3 +1,4 @@ +;;error:6:26-27:invalid condition (neither loobean nor boolean) (defcolumns (X :i1) (Y :i1) (A :i4@loob) (B :i4@loob)) (definterleaved Z (X Y)) (definterleaved C (A B)) diff --git a/testdata/type_invalid_08.lisp b/testdata/type_invalid_08.lisp index a40f3738..94d10836 100644 --- a/testdata/type_invalid_08.lisp +++ b/testdata/type_invalid_08.lisp @@ -1,3 +1,4 @@ +;;error:6:22-30:expected loobean constraint (found u4) (defcolumns (X :i1@loob) (Y :i1@loob) (A :i4) (B :i4)) (definterleaved Z (X Y)) (definterleaved C (A B)) diff --git a/testdata/type_invalid_09.lisp b/testdata/type_invalid_09.lisp index 92f87b04..68e5d410 100644 --- a/testdata/type_invalid_09.lisp +++ b/testdata/type_invalid_09.lisp @@ -1,3 +1,4 @@ +;;error:2:1-2:blah (defcolumns (X :i1) (Y :i1) (A :i4@loob) (B :i4@loob)) (definterleaved Z (X Y)) (definterleaved C (A B)) diff --git a/testdata/type_invalid_10.lisp b/testdata/type_invalid_10.lisp index 58d8ccca..688e5092 100644 --- a/testdata/type_invalid_10.lisp +++ b/testdata/type_invalid_10.lisp @@ -1,3 +1,4 @@ +;;error:2:1-2:blah (defcolumns (X :i1@loob) (Y :i1) (A :i4@loob) (B :i4@loob)) (definterleaved Z (X Y)) (definterleaved C (A B)) diff --git a/testdata/type_invalid_11.lisp b/testdata/type_invalid_11.lisp index 953303ac..0045b57c 100644 --- a/testdata/type_invalid_11.lisp +++ b/testdata/type_invalid_11.lisp @@ -1,3 +1,4 @@ +;;error:2:1-2:blah (defcolumns (X :i1) (Y :i1@loob) (A :i4@loob) (B :i4@loob)) (definterleaved Z (X Y)) (definterleaved C (A B)) diff --git a/testdata/type_invalid_12.lisp b/testdata/type_invalid_12.lisp index 55f1e716..1fa5e1cc 100644 --- a/testdata/type_invalid_12.lisp +++ b/testdata/type_invalid_12.lisp @@ -1,3 +1,4 @@ +;;error:2:1-2:blah (defcolumns (X :i1@bool) (Y :i1) (A :i4@loob) (B :i4@loob)) (definterleaved Z (X Y)) (definterleaved C (A B)) diff --git a/testdata/type_invalid_13.lisp b/testdata/type_invalid_13.lisp index c4c12286..7cd1415e 100644 --- a/testdata/type_invalid_13.lisp +++ b/testdata/type_invalid_13.lisp @@ -1,3 +1,4 @@ +;;error:2:1-2:blah (defcolumns (X :i1) (Y :i1@bool) (A :i4@loob) (B :i4@loob)) (definterleaved Z (X Y)) (definterleaved C (A B))