[PATCH] D52746: [clang-query] Add single-letter 'q' alias for 'quit'
Stephen Kelly via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 1 13:57:14 PDT 2018
steveire updated this revision to Diff 167825.
steveire added a comment.
Add test
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D52746
Files:
clang-query/QueryParser.cpp
unittests/clang-query/QueryParserTest.cpp
Index: unittests/clang-query/QueryParserTest.cpp
===================================================================
--- unittests/clang-query/QueryParserTest.cpp
+++ unittests/clang-query/QueryParserTest.cpp
@@ -51,6 +51,9 @@
QueryRef Q = parse("quit");
ASSERT_TRUE(isa<QuitQuery>(Q));
+ Q = parse("q");
+ ASSERT_TRUE(isa<QuitQuery>(Q));
+
Q = parse("quit me");
ASSERT_TRUE(isa<InvalidQuery>(Q));
EXPECT_EQ("unexpected extra input: ' me'", cast<InvalidQuery>(Q)->ErrStr);
Index: clang-query/QueryParser.cpp
===================================================================
--- clang-query/QueryParser.cpp
+++ clang-query/QueryParser.cpp
@@ -166,6 +166,7 @@
.Case("let", PQK_Let)
.Case("m", PQK_Match, /*IsCompletion=*/false)
.Case("match", PQK_Match)
+ .Case("q", PQK_Quit, /*IsCompletion=*/false)
.Case("quit", PQK_Quit)
.Case("set", PQK_Set)
.Case("unlet", PQK_Unlet)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52746.167825.patch
Type: text/x-patch
Size: 1108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181001/7757de34/attachment.bin>
More information about the cfe-commits
mailing list