Skip to content

Commit 69dc854

Browse files
committed
removed LetQuery implementation
1 parent d68bc37 commit 69dc854

File tree

2 files changed

+0
-33
lines changed

2 files changed

+0
-33
lines changed

mlir/lib/Query/Query.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,6 @@ LogicalResult QuitQuery::run(llvm::raw_ostream &os, QuerySession &qs) const {
127127
return mlir::success();
128128
}
129129

130-
LogicalResult LetQuery::run(llvm::raw_ostream &os, QuerySession &qs) const {
131-
if (value.hasValue()) {
132-
qs.namedValues[name] = value;
133-
} else {
134-
qs.namedValues.erase(name);
135-
}
136-
return mlir::success();
137-
}
138-
139130
LogicalResult MatchQuery::run(llvm::raw_ostream &os, QuerySession &qs) const {
140131
Operation *rootOp = qs.getRootOp();
141132

mlir/lib/Query/QueryParser.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,6 @@ QueryRef QueryParser::doParse() {
166166
.Case("", ParsedQueryKind::NoOp)
167167
.Case("#", ParsedQueryKind::Comment, /*isCompletion=*/false)
168168
.Case("help", ParsedQueryKind::Help)
169-
.Case("l", ParsedQueryKind::Let, /*isCompletion=*/false)
170-
.Case("let", ParsedQueryKind::Let, /*isCompletion=*/false)
171169
.Case("m", ParsedQueryKind::Match, /*isCompletion=*/false)
172170
.Case("set", ParsedQueryKind::Set)
173171
.Case("match", ParsedQueryKind::Match)
@@ -189,28 +187,6 @@ QueryRef QueryParser::doParse() {
189187

190188
case ParsedQueryKind::Quit:
191189
return endQuery(new QuitQuery);
192-
193-
case ParsedQueryKind::Let: {
194-
llvm::StringRef name = lexWord();
195-
196-
if (name.empty()) {
197-
return new InvalidQuery("expected variable name");
198-
}
199-
200-
if (completionPos) {
201-
return completeMatcherExpression();
202-
}
203-
204-
matcher::internal::Diagnostics diag;
205-
matcher::VariantValue value;
206-
if (!matcher::internal::Parser::parseExpression(
207-
line, qs.getRegistryData(), &qs.namedValues, &value, &diag)) {
208-
return makeInvalidQueryFromDiagnostics(diag);
209-
}
210-
QueryRef query = new LetQuery(name, value);
211-
query->remainingContent = line;
212-
return query;
213-
}
214190
case ParsedQueryKind::Match: {
215191
if (completionPos) {
216192
return completeMatcherExpression();

0 commit comments

Comments
 (0)