Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix incorrect error for invalid type #484

Merged
merged 2 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/corset/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ func (p *Parser) parseModuleContents(module string, terms []sexp.SExp) ([]Declar
err := p.translator.SyntaxError(s, "unexpected or malformed declaration")
errors = append(errors, *err)
} else if e.MatchSymbols(2, "module") {
return decls, terms[i:], nil
} else if decl, errs := p.parseDeclaration(module, e); errs != nil {
return decls, terms[i:], errors
} else if decl, errs := p.parseDeclaration(module, e); len(errs) > 0 {
errors = append(errors, errs...)
} else {
// Continue accumulating declarations for this module.
Expand Down
4 changes: 4 additions & 0 deletions pkg/test/invalid_corset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ func Test_Invalid_Basic_12(t *testing.T) {
CheckInvalid(t, "basic_invalid_12")
}

func Test_Invalid_Basic_13(t *testing.T) {
CheckInvalid(t, "basic_invalid_13")
}

// ===================================================================
// Constant Tests
// ===================================================================
Expand Down
7 changes: 7 additions & 0 deletions testdata/basic_invalid_13.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
;;error:4:22-26:unknown type
(module mmio)

(defcolumns (COUNTER :dac))
(defalias CT COUNTER)

(module mmio)
Loading