From 95c21dea20ff4d8bae2e0bc13ed2221b38f4e854 Mon Sep 17 00:00:00 2001 From: Ari Lazier Date: Tue, 5 Jan 2016 19:33:56 -0800 Subject: [PATCH] rebase from master --- impl/transact_log_handler.cpp | 2 -- parser/parser.cpp | 2 +- parser/parser.hpp | 1 + parser/query_builder.hpp | 12 +++++------- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/impl/transact_log_handler.cpp b/impl/transact_log_handler.cpp index bd678668..ac74b515 100644 --- a/impl/transact_log_handler.cpp +++ b/impl/transact_log_handler.cpp @@ -306,8 +306,6 @@ public: bool set_link(size_t col, size_t row, size_t, size_t) { return mark_dirty(row, col); } bool set_null(size_t col, size_t row) { return mark_dirty(row, col); } bool nullify_link(size_t col, size_t row, size_t) { return mark_dirty(row, col); } - bool set_int_unique(size_t col, size_t row, int_fast64_t) { return mark_dirty(row, col); } - bool set_string_unique(size_t col, size_t row, StringData) { return mark_dirty(row, col); } // Doesn't change any data bool optimize_table() { return true; } diff --git a/parser/parser.cpp b/parser/parser.cpp index 7d425ee5..2753fbd8 100644 --- a/parser/parser.cpp +++ b/parser/parser.cpp @@ -227,7 +227,7 @@ template<> struct action< or_op > template<> struct action< rule > { \ static void apply( const input & in, ParserState & state ) { \ DEBUG_PRINT_TOKEN(in.string()); \ - state.add_expression(Expression{type, in.string()}); }}; + state.add_expression(Expression(type, in.string())); }}; EXPRESSION_ACTION(dq_string_content, Expression::Type::String) EXPRESSION_ACTION(sq_string_content, Expression::Type::String) diff --git a/parser/parser.hpp b/parser/parser.hpp index 681847f0..92f7ebea 100644 --- a/parser/parser.hpp +++ b/parser/parser.hpp @@ -30,6 +30,7 @@ struct Expression { enum class Type { None, Number, String, KeyPath, Argument, True, False } type = Type::None; std::string s; + Expression(Type t = Type::None, std::string s = "") : type(t), s(s) {} }; struct Predicate diff --git a/parser/query_builder.hpp b/parser/query_builder.hpp index eac61312..f6738b47 100644 --- a/parser/query_builder.hpp +++ b/parser/query_builder.hpp @@ -67,13 +67,11 @@ class ArgumentConverter : public Arguments std::vector m_arguments; ContextType m_ctx; - ValueType &argument_at(size_t index) { - if (index >= m_arguments.size()) { - throw std::out_of_range((std::string)"Argument index " + to_string(index) + " out of range 0.." + to_string(m_arguments.size()-1)); - } - return m_arguments[index]; - } - }; + ValueType &argument_at(size_t index) { + if (index >= m_arguments.size()) { + throw std::out_of_range((std::string)"Argument index " + to_string(index) + " out of range 0.." + to_string(m_arguments.size()-1)); + } + return m_arguments[index]; } }; }