2017-03-16 19:16:56 +00:00
|
|
|
// Copyright 2016 Mozilla
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
|
|
// this file except in compliance with the License. You may obtain a copy of the
|
|
|
|
// License at http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
// Unless required by applicable law or agreed to in writing, software distributed
|
|
|
|
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
|
|
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
|
|
// specific language governing permissions and limitations under the License.
|
|
|
|
|
|
|
|
extern crate mentat_query;
|
|
|
|
|
|
|
|
use self::mentat_query::{
|
|
|
|
PlainSymbol,
|
|
|
|
};
|
|
|
|
|
|
|
|
error_chain! {
|
|
|
|
types {
|
|
|
|
Error, ErrorKind, ResultExt, Result;
|
|
|
|
}
|
|
|
|
|
|
|
|
errors {
|
|
|
|
UnknownFunction(name: PlainSymbol) {
|
|
|
|
description("no such function")
|
|
|
|
display("no function named {}", name)
|
|
|
|
}
|
|
|
|
|
|
|
|
InvalidNumberOfArguments(name: PlainSymbol, number: usize, expected: usize) {
|
|
|
|
description("invalid number of arguments")
|
|
|
|
display("invalid number of arguments to {}: expected {}, got {}.", name, expected, number)
|
|
|
|
}
|
|
|
|
|
Use Rc for TypedValue, Variable, and query Ident keywords. (#395) r=nalexander
Part 1, core: use Rc for String and Keyword.
Part 2, query: use Rc for Variable.
Part 3, sql: use Rc for args in SQLiteQueryBuilder.
Part 4, query-algebrizer: use Rc.
Part 5, db: use Rc.
Part 6, query-parser: use Rc.
Part 7, query-projector: use Rc.
Part 8, query-translator: use Rc.
Part 9, top level: use Rc.
Part 10: intern Ident and IdentOrKeyword.
2017-03-29 20:18:17 +00:00
|
|
|
UnboundVariable(name: PlainSymbol) {
|
2017-03-16 19:16:56 +00:00
|
|
|
description("unbound variable in function call")
|
Use Rc for TypedValue, Variable, and query Ident keywords. (#395) r=nalexander
Part 1, core: use Rc for String and Keyword.
Part 2, query: use Rc for Variable.
Part 3, sql: use Rc for args in SQLiteQueryBuilder.
Part 4, query-algebrizer: use Rc.
Part 5, db: use Rc.
Part 6, query-parser: use Rc.
Part 7, query-projector: use Rc.
Part 8, query-translator: use Rc.
Part 9, top level: use Rc.
Part 10: intern Ident and IdentOrKeyword.
2017-03-29 20:18:17 +00:00
|
|
|
display("unbound variable: {}", name)
|
2017-03-16 19:16:56 +00:00
|
|
|
}
|
2017-03-20 14:11:32 +00:00
|
|
|
|
|
|
|
NonNumericArgument(function: PlainSymbol, position: usize) {
|
|
|
|
description("invalid argument")
|
|
|
|
display("invalid argument to {}: expected numeric in position {}.", function, position)
|
|
|
|
}
|
2017-03-24 20:09:32 +00:00
|
|
|
|
|
|
|
NonMatchingVariablesInOrClause {
|
|
|
|
// TODO: flesh out.
|
|
|
|
description("non-matching variables in 'or' clause")
|
|
|
|
display("non-matching variables in 'or' clause")
|
|
|
|
}
|
2017-03-16 19:16:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|