Skip to content

Commit

Permalink
add unreserved keywords (vesoft-inc#1899)
Browse files Browse the repository at this point in the history
Co-authored-by: dutor <440396+dutor@users.noreply.github.com>
  • Loading branch information
laura-ding and dutor authored Mar 10, 2020
1 parent 665f5e6 commit bc61fb2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/parser/parser.yy
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,15 @@ unreserved_keyword
| KW_RECOVER { $$ = new std::string("recover"); }
| KW_FLUSH { $$ = new std::string("flush"); }
| KW_COMPACT { $$ = new std::string("compact"); }
| KW_BIDIRECT { $$ = new std::string("bidirect"); }
| KW_OFFLINE { $$ = new std::string("offline"); }
| KW_FORCE { $$ = new std::string("force"); }
| KW_STATUS { $$ = new std::string("status"); }
| KW_REBUILD { $$ = new std::string("rebuild"); }
| KW_PART { $$ = new std::string("part"); }
| KW_PARTS { $$ = new std::string("parts"); }
| KW_DEFAULT { $$ = new std::string("default"); }
| KW_CONFIGS { $$ = new std::string("configs"); }
;

agg_function
Expand Down
7 changes: 7 additions & 0 deletions src/parser/test/ParserTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,13 @@ TEST(Parser, UnreservedKeywords) {
auto result = parser.parse(query);
ASSERT_TRUE(result.ok()) << result.status();
}
{
GQLParser parser;
std::string query = "CREATE TAG status(part int, parts int, job string, jobs string,"
" offline bool, rebuild bool, submit bool, compact bool, "
" bidirect bool, force bool, configs string)";
auto result = parser.parse(query);
}
}

TEST(Parser, Annotation) {
Expand Down

0 comments on commit bc61fb2

Please sign in to comment.