diff options
author | Jacob Evans <jacob.evans@10gen.com> | 2020-07-28 01:58:38 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-07-28 06:14:58 +0000 |
commit | ffa762f6dfd23916baa74f2a9cac6879dda7b771 (patch) | |
tree | 1dcb58556dcadcfaffff8f302601815c6a8c369b /src | |
parent | 0982b852998098f9d1c901a53e74da7dfebc556f (diff) | |
download | mongo-ffa762f6dfd23916baa74f2a9cac6879dda7b771.tar.gz |
SERVER-49300 Fix accidental windows.h macro invocations
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/cst/bson_lexer.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/cst/pipeline_grammar.yy | 10 | ||||
-rw-r--r-- | src/mongo/db/cst/pipeline_parser_gen.cpp | 16 | ||||
-rw-r--r-- | src/mongo/db/cst/pipeline_parser_gen.hpp | 42 |
4 files changed, 36 insertions, 36 deletions
diff --git a/src/mongo/db/cst/bson_lexer.cpp b/src/mongo/db/cst/bson_lexer.cpp index c64eef9a263..3ea8fc8c230 100644 --- a/src/mongo/db/cst/bson_lexer.cpp +++ b/src/mongo/db/cst/bson_lexer.cpp @@ -53,7 +53,7 @@ const StringMap<PipelineParserGen::token_type> reservedKeyLookup = { {"$and", PipelineParserGen::token::AND}, {"$or", PipelineParserGen::token::OR}, {"$not", PipelineParserGen::token::NOT}, - {"$const", PipelineParserGen::token::CONST}, + {"$const", PipelineParserGen::token::CONST_EXPR}, {"$literal", PipelineParserGen::token::LITERAL}}; bool isCompound(PipelineParserGen::symbol_type token) { @@ -188,7 +188,7 @@ void BSONLexer::tokenize(BSONElement elem, bool includeFieldName) { getNextLoc()); break; case BSONType::Date: - _tokens.emplace_back(PipelineParserGen::make_DATE(elem.date(), getNextLoc())); + _tokens.emplace_back(PipelineParserGen::make_DATE_LITERAL(elem.date(), getNextLoc())); break; case BSONType::jstNULL: _tokens.emplace_back(PipelineParserGen::make_JSNULL(UserNull{}, getNextLoc())); diff --git a/src/mongo/db/cst/pipeline_grammar.yy b/src/mongo/db/cst/pipeline_grammar.yy index 84971f4d9bb..622677e0d05 100644 --- a/src/mongo/db/cst/pipeline_grammar.yy +++ b/src/mongo/db/cst/pipeline_grammar.yy @@ -137,7 +137,7 @@ ADD ATAN2 AND - CONST + CONST_EXPR LITERAL OR NOT @@ -151,7 +151,7 @@ %token <BSONBinData> BINARY %token <UserUndefined> UNDEFINED %token <OID> OBJECT_ID -%token <Date_t> DATE +%token <Date_t> DATE_LITERAL %token <UserNull> JSNULL %token <BSONRegEx> REGEX %token <BSONDBRef> DB_POINTER @@ -353,7 +353,7 @@ aggExprAsUserFieldname: | AND { $$ = UserFieldname{"$and"}; } - | CONST { + | CONST_EXPR { $$ = UserFieldname{"$const"}; } | LITERAL { @@ -392,7 +392,7 @@ objectId: ; date: - DATE { + DATE_LITERAL { $$ = CNode{UserDate{$1}}; } ; @@ -638,7 +638,7 @@ literalEscapes: ; const: - START_OBJECT CONST START_ARRAY value END_ARRAY END_OBJECT { + START_OBJECT CONST_EXPR START_ARRAY value END_ARRAY END_OBJECT { $$ = CNode{CNode::ObjectChildren{{KeyFieldname::constExpr, CNode{CNode::ArrayChildren{$value}}}}}; } diff --git a/src/mongo/db/cst/pipeline_parser_gen.cpp b/src/mongo/db/cst/pipeline_parser_gen.cpp index f1c13700c31..437a4837afb 100644 --- a/src/mongo/db/cst/pipeline_parser_gen.cpp +++ b/src/mongo/db/cst/pipeline_parser_gen.cpp @@ -286,7 +286,7 @@ PipelineParserGen::stack_symbol_type::stack_symbol_type(YY_RVREF(stack_symbol_ty value.YY_MOVE_OR_COPY<CNode::Fieldname>(YY_MOVE(that.value)); break; - case 33: // DATE + case 33: // DATE_LITERAL value.YY_MOVE_OR_COPY<Date_t>(YY_MOVE(that.value)); break; @@ -447,7 +447,7 @@ PipelineParserGen::stack_symbol_type::stack_symbol_type(state_type s, YY_MOVE_RE value.move<CNode::Fieldname>(YY_MOVE(that.value)); break; - case 33: // DATE + case 33: // DATE_LITERAL value.move<Date_t>(YY_MOVE(that.value)); break; @@ -608,7 +608,7 @@ PipelineParserGen::stack_symbol_type& PipelineParserGen::stack_symbol_type::oper value.copy<CNode::Fieldname>(that.value); break; - case 33: // DATE + case 33: // DATE_LITERAL value.copy<Date_t>(that.value); break; @@ -768,7 +768,7 @@ PipelineParserGen::stack_symbol_type& PipelineParserGen::stack_symbol_type::oper value.move<CNode::Fieldname>(that.value); break; - case 33: // DATE + case 33: // DATE_LITERAL value.move<Date_t>(that.value); break; @@ -1139,7 +1139,7 @@ int PipelineParserGen::parse() { yylhs.value.emplace<CNode::Fieldname>(); break; - case 33: // DATE + case 33: // DATE_LITERAL yylhs.value.emplace<Date_t>(); break; @@ -2780,7 +2780,7 @@ const char* const PipelineParserGen::yytname_[] = {"\"EOF\"", "ADD", "ATAN2", "AND", - "CONST", + "CONST_EXPR", "LITERAL", "OR", "NOT", @@ -2789,7 +2789,7 @@ const char* const PipelineParserGen::yytname_[] = {"\"EOF\"", "BINARY", "UNDEFINED", "OBJECT_ID", - "DATE", + "DATE_LITERAL", "JSNULL", "REGEX", "DB_POINTER", @@ -2906,6 +2906,6 @@ void PipelineParserGen::yy_reduce_print_(int yyrule) const { #line 58 "pipeline_grammar.yy" } // namespace mongo -#line 2824 "pipeline_parser_gen.cpp" +#line 2825 "pipeline_parser_gen.cpp" #line 707 "pipeline_grammar.yy" diff --git a/src/mongo/db/cst/pipeline_parser_gen.hpp b/src/mongo/db/cst/pipeline_parser_gen.hpp index 6a67c8cfcee..11e2b3c773f 100644 --- a/src/mongo/db/cst/pipeline_parser_gen.hpp +++ b/src/mongo/db/cst/pipeline_parser_gen.hpp @@ -447,7 +447,7 @@ public: // valueFieldname char dummy8[sizeof(CNode::Fieldname)]; - // DATE + // DATE_LITERAL char dummy9[sizeof(Date_t)]; // DECIMAL_NON_ZERO @@ -555,7 +555,7 @@ public: ADD = 21, // ADD ATAN2 = 22, // ATAN2 AND = 23, // AND - CONST = 24, // CONST + CONST_EXPR = 24, // CONST_EXPR LITERAL = 25, // LITERAL OR = 26, // OR NOT = 27, // NOT @@ -564,7 +564,7 @@ public: BINARY = 30, // BINARY UNDEFINED = 31, // UNDEFINED OBJECT_ID = 32, // OBJECT_ID - DATE = 33, // DATE + DATE_LITERAL = 33, // DATE_LITERAL JSNULL = 34, // JSNULL REGEX = 35, // REGEX DB_POINTER = 36, // DB_POINTER @@ -618,7 +618,7 @@ public: S_ADD = 21, // ADD S_ATAN2 = 22, // ATAN2 S_AND = 23, // AND - S_CONST = 24, // CONST + S_CONST_EXPR = 24, // CONST_EXPR S_LITERAL = 25, // LITERAL S_OR = 26, // OR S_NOT = 27, // NOT @@ -627,7 +627,7 @@ public: S_BINARY = 30, // BINARY S_UNDEFINED = 31, // UNDEFINED S_OBJECT_ID = 32, // OBJECT_ID - S_DATE = 33, // DATE + S_DATE_LITERAL = 33, // DATE_LITERAL S_JSNULL = 34, // JSNULL S_REGEX = 35, // REGEX S_DB_POINTER = 36, // DB_POINTER @@ -824,7 +824,7 @@ public: value.move<CNode::Fieldname>(std::move(that.value)); break; - case 33: // DATE + case 33: // DATE_LITERAL value.move<Date_t>(std::move(that.value)); break; @@ -1167,7 +1167,7 @@ public: value.template destroy<CNode::Fieldname>(); break; - case 33: // DATE + case 33: // DATE_LITERAL value.template destroy<Date_t>(); break; @@ -1325,7 +1325,7 @@ public: tok == token::STAGE_SKIP || tok == token::STAGE_LIMIT || tok == token::STAGE_PROJECT || tok == token::COLL_ARG || tok == token::PIPELINE_ARG || tok == token::ADD || tok == token::ATAN2 || - tok == token::AND || tok == token::CONST || tok == token::LITERAL || + tok == token::AND || tok == token::CONST_EXPR || tok == token::LITERAL || tok == token::OR || tok == token::NOT); } #else @@ -1340,7 +1340,7 @@ public: tok == token::STAGE_SKIP || tok == token::STAGE_LIMIT || tok == token::STAGE_PROJECT || tok == token::COLL_ARG || tok == token::PIPELINE_ARG || tok == token::ADD || tok == token::ATAN2 || - tok == token::AND || tok == token::CONST || tok == token::LITERAL || + tok == token::AND || tok == token::CONST_EXPR || tok == token::LITERAL || tok == token::OR || tok == token::NOT); } #endif @@ -1413,12 +1413,12 @@ public: #if 201103L <= YY_CPLUSPLUS symbol_type(int tok, Date_t v, location_type l) : super_type(token_type(tok), std::move(v), std::move(l)) { - YY_ASSERT(tok == token::DATE); + YY_ASSERT(tok == token::DATE_LITERAL); } #else symbol_type(int tok, const Date_t& v, const location_type& l) : super_type(token_type(tok), v, l) { - YY_ASSERT(tok == token::DATE); + YY_ASSERT(tok == token::DATE_LITERAL); } #endif #if 201103L <= YY_CPLUSPLUS @@ -1810,12 +1810,12 @@ public: } #endif #if 201103L <= YY_CPLUSPLUS - static symbol_type make_CONST(location_type l) { - return symbol_type(token::CONST, std::move(l)); + static symbol_type make_CONST_EXPR(location_type l) { + return symbol_type(token::CONST_EXPR, std::move(l)); } #else - static symbol_type make_CONST(const location_type& l) { - return symbol_type(token::CONST, l); + static symbol_type make_CONST_EXPR(const location_type& l) { + return symbol_type(token::CONST_EXPR, l); } #endif #if 201103L <= YY_CPLUSPLUS @@ -1891,12 +1891,12 @@ public: } #endif #if 201103L <= YY_CPLUSPLUS - static symbol_type make_DATE(Date_t v, location_type l) { - return symbol_type(token::DATE, std::move(v), std::move(l)); + static symbol_type make_DATE_LITERAL(Date_t v, location_type l) { + return symbol_type(token::DATE_LITERAL, std::move(v), std::move(l)); } #else - static symbol_type make_DATE(const Date_t& v, const location_type& l) { - return symbol_type(token::DATE, v, l); + static symbol_type make_DATE_LITERAL(const Date_t& v, const location_type& l) { + return symbol_type(token::DATE_LITERAL, v, l); } #endif #if 201103L <= YY_CPLUSPLUS @@ -2400,7 +2400,7 @@ PipelineParserGen::basic_symbol<Base>::basic_symbol(const basic_symbol& that) value.copy<CNode::Fieldname>(YY_MOVE(that.value)); break; - case 33: // DATE + case 33: // DATE_LITERAL value.copy<Date_t>(YY_MOVE(that.value)); break; @@ -2569,7 +2569,7 @@ void PipelineParserGen::basic_symbol<Base>::move(basic_symbol& s) { value.move<CNode::Fieldname>(YY_MOVE(s.value)); break; - case 33: // DATE + case 33: // DATE_LITERAL value.move<Date_t>(YY_MOVE(s.value)); break; |