switch invalid term from type to domain error
This commit is contained in:
@@ -38,7 +38,6 @@ pub(crate) enum ValidType {
|
|||||||
Callable,
|
Callable,
|
||||||
Character,
|
Character,
|
||||||
Compound,
|
Compound,
|
||||||
Directive,
|
|
||||||
Evaluable,
|
Evaluable,
|
||||||
Float,
|
Float,
|
||||||
InByte,
|
InByte,
|
||||||
@@ -74,7 +73,6 @@ impl ValidType {
|
|||||||
// ValidType::PredicateIndicator => atom!("predicate_indicator"),
|
// ValidType::PredicateIndicator => atom!("predicate_indicator"),
|
||||||
// ValidType::Variable => atom!("variable")
|
// ValidType::Variable => atom!("variable")
|
||||||
ValidType::TcpListener => atom!("tcp_listener"),
|
ValidType::TcpListener => atom!("tcp_listener"),
|
||||||
ValidType::Directive => atom!("directive"),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -981,8 +981,8 @@ impl MachineState {
|
|||||||
|
|
||||||
pub(crate) fn directive_error(&mut self, err: DirectiveError) -> MachineError {
|
pub(crate) fn directive_error(&mut self, err: DirectiveError) -> MachineError {
|
||||||
match err {
|
match err {
|
||||||
DirectiveError::ExpectedDirective(_term) => self.type_error(
|
DirectiveError::ExpectedDirective(_term) => self.domain_error(
|
||||||
ValidType::Directive,
|
DomainErrorType::Directive,
|
||||||
atom_as_cell!(atom!("todo_insert_invalid_term_here")),
|
atom_as_cell!(atom!("todo_insert_invalid_term_here")),
|
||||||
),
|
),
|
||||||
DirectiveError::InvalidDirective(name, arity) => {
|
DirectiveError::InvalidDirective(name, arity) => {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ $ scryer-prolog -f --no-add-history tests-pl/invalid_decl5.pl -g halt
|
|||||||
|
|
||||||
```trycmd
|
```trycmd
|
||||||
$ scryer-prolog -f --no-add-history tests-pl/invalid_decl6.pl -g halt
|
$ scryer-prolog -f --no-add-history tests-pl/invalid_decl6.pl -g halt
|
||||||
error(type_error(directive,todo_insert_invalid_term_here),load/1).
|
error(domain_error(directive,todo_insert_invalid_term_here),load/1).
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user