Pre: move EmptyBecause into types.rs.

This commit is contained in:
Richard Newman 2017-03-27 19:34:02 -07:00
parent 8e6f37e709
commit 95a5326e23
2 changed files with 22 additions and 13 deletions

View file

@ -53,6 +53,7 @@ use types::{
ColumnConstraint,
DatomsColumn,
DatomsTable,
EmptyBecause,
NumericComparison,
QualifiedAlias,
QueryValue,
@ -160,19 +161,6 @@ pub struct ConjoiningClauses {
extracted_types: BTreeMap<Variable, QualifiedAlias>,
}
#[derive(PartialEq)]
pub enum EmptyBecause {
// Var, existing, desired.
TypeMismatch(Variable, HashSet<ValueType>, ValueType),
NonNumericArgument,
UnresolvedIdent(NamespacedKeyword),
InvalidAttributeIdent(NamespacedKeyword),
InvalidAttributeEntid(Entid),
InvalidBinding(DatomsColumn, TypedValue),
ValueTypeMismatch(ValueType, TypedValue),
AttributeLookupFailed, // Catch-all, because the table lookup code is lazy. TODO
}
impl Debug for EmptyBecause {
fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
use self::EmptyBecause::*;

View file

@ -8,6 +8,8 @@
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
use std::collections::HashSet;
use std::fmt::{
Debug,
Formatter,
@ -19,6 +21,12 @@ use mentat_core::{
TypedValue,
ValueType,
};
use mentat_query::{
NamespacedKeyword,
Variable,
};
/// This enum models the fixed set of default tables we have -- two
/// tables and two views.
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
@ -204,3 +212,16 @@ impl Debug for ColumnConstraint {
}
}
}
#[derive(PartialEq)]
pub enum EmptyBecause {
// Var, existing, desired.
TypeMismatch(Variable, HashSet<ValueType>, ValueType),
NonNumericArgument,
UnresolvedIdent(NamespacedKeyword),
InvalidAttributeIdent(NamespacedKeyword),
InvalidAttributeEntid(Entid),
InvalidBinding(DatomsColumn, TypedValue),
ValueTypeMismatch(ValueType, TypedValue),
AttributeLookupFailed, // Catch-all, because the table lookup code is lazy. TODO
}