Lines Matching refs:Id

175 void testExpr(StringRef Id, StringRef Snippet, const Stencil &Stencil,  in testExpr()  argument
177 auto StmtMatch = matchStmt(Snippet, expr().bind(Id)); in testExpr()
183 void testFailure(StringRef Id, StringRef Snippet, const Stencil &Stencil, in testFailure() argument
185 auto StmtMatch = matchStmt(Snippet, expr().bind(Id)); in testFailure()
193 StringRef Id = "id"; in TEST_F() local
194 testExpr(Id, "3;", cat(node(std::string(Id))), "3"); in TEST_F()
198 StringRef Id = "id"; in TEST_F() local
199 testExpr(Id, "3;", ifBound(Id, cat("5"), cat("7")), "5"); in TEST_F()
203 StringRef Id = "id"; in TEST_F() local
204 testExpr(Id, "3;", ifBound("other", cat("5"), cat("7")), "7"); in TEST_F()
260 StringRef Id = "id"; in TEST_F() local
261 testExpr(Id, "3;", expression(Id), "3"); in TEST_F()
266 StringRef Id = "id"; in TEST_F() local
267 testExpr(Id, "(3);", expression(Id), "(3)"); in TEST_F()
271 StringRef Id = "id"; in TEST_F() local
272 testExpr(Id, "3+4;", expression(Id), "(3+4)"); in TEST_F()
279 StringRef Id = "id"; in TEST_F() local
280 testFailure(Id, "3;", expression("ACACA"), in TEST_F()
285 StringRef Id = "id"; in TEST_F() local
286 testExpr(Id, "int *x; x;", deref(Id), "*x"); in TEST_F()
290 StringRef Id = "id"; in TEST_F() local
291 testExpr(Id, "int *x; x + 1;", deref(Id), "*(x + 1)"); in TEST_F()
295 StringRef Id = "id"; in TEST_F() local
296 testExpr(Id, "int x; &x;", deref(Id), "x"); in TEST_F()
300 StringRef Id = "id"; in TEST_F() local
301 testExpr(Id, "int x; x;", addressOf(Id), "&x"); in TEST_F()
305 StringRef Id = "id"; in TEST_F() local
306 testExpr(Id, "int *x; *x;", addressOf(Id), "x"); in TEST_F()
310 StringRef Id = "id"; in TEST_F() local
311 testExpr(Id, "int x; x;", maybeDeref(Id), "x"); in TEST_F()
315 StringRef Id = "id"; in TEST_F() local
316 testExpr(Id, "int *x; x;", maybeDeref(Id), "*x"); in TEST_F()
320 StringRef Id = "id"; in TEST_F() local
321 testExpr(Id, "int *x; x + 1;", maybeDeref(Id), "*(x + 1)"); in TEST_F()
325 StringRef Id = "id"; in TEST_F() local
326 testExpr(Id, "int x; &x;", maybeDeref(Id), "x"); in TEST_F()
330 StringRef Id = "id"; in TEST_F() local
335 testExpr(Id, Snippet, maybeDeref(Id), "*x"); in TEST_F()
339 StringRef Id = "id"; in TEST_F() local
342 matchStmt(Snippet, memberExpr(hasObjectExpression(expr().bind(Id)))); in TEST_F()
344 const Stencil Stencil = maybeDeref(Id); in TEST_F()
349 StringRef Id = "id"; in TEST_F() local
350 testExpr(Id, "int *x; x;", maybeAddressOf(Id), "x"); in TEST_F()
354 StringRef Id = "id"; in TEST_F() local
355 testExpr(Id, "int x; x;", addressOf(Id), "&x"); in TEST_F()
359 StringRef Id = "id"; in TEST_F() local
360 testExpr(Id, "int x; x + 1;", maybeAddressOf(Id), "&(x + 1)"); in TEST_F()
364 StringRef Id = "id"; in TEST_F() local
365 testExpr(Id, "int *x; *x;", addressOf(Id), "x"); in TEST_F()
369 StringRef Id = "id"; in TEST_F() local
370 testExpr(Id, "std::unique_ptr<S> x; x;", maybeAddressOf(Id), "x"); in TEST_F()
374 StringRef Id = "id"; in TEST_F() local
377 matchStmt(Snippet, memberExpr(hasObjectExpression(expr().bind(Id)))); in TEST_F()
379 const Stencil Stencil = maybeAddressOf(Id); in TEST_F()
384 StringRef Id = "id"; in TEST_F() local
385 testExpr(Id, "std::unique_ptr<S> x; *x;", maybeAddressOf(Id), "&*x"); in TEST_F()
393 StringRef Id = "id"; in TEST_F() local
394 testExpr(Id, Snippet, access(Id, "field"), "x.field"); in TEST_F()
402 StringRef Id = "id"; in TEST_F() local
403 testExpr(Id, Snippet, access(Id, cat("field")), "x.field"); in TEST_F()
411 StringRef Id = "id"; in TEST_F() local
412 testExpr(Id, Snippet, access(Id, "field"), "x.field"); in TEST_F()
420 StringRef Id = "id"; in TEST_F() local
421 testExpr(Id, Snippet, access(Id, "field"), "x->field"); in TEST_F()
429 StringRef Id = "id"; in TEST_F() local
430 testExpr(Id, Snippet, access(Id, "field"), "x->field"); in TEST_F()
438 StringRef Id = "id"; in TEST_F() local
439 testExpr(Id, Snippet, access(Id, "field"), "x->field"); in TEST_F()
447 StringRef Id = "id"; in TEST_F() local
448 testExpr(Id, Snippet, access(Id, "field"), "x->field"); in TEST_F()
456 StringRef Id = "id"; in TEST_F() local
458 matchStmt(Snippet, memberExpr(hasObjectExpression(expr().bind(Id)))); in TEST_F()
460 EXPECT_THAT_EXPECTED(access(Id, "field")->eval(StmtMatch->Result), in TEST_F()
567 StringRef Id = "id"; in TEST_F() local
568 auto SimpleFn = [Id](const MatchResult &R) { in TEST_F()
569 return std::string(R.Nodes.getNodeAs<Stmt>(Id) != nullptr ? "Bound" in TEST_F()
572 testExpr(Id, "3;", run(SimpleFn), "Bound"); in TEST_F()
656 auto S = describe("Id"); in TEST()
662 auto S = dPrint("Id"); in TEST()
668 auto S = expression("Id"); in TEST()
674 auto S = deref("Id"); in TEST()
680 auto S = addressOf("Id"); in TEST()
691 auto S = access("Id", "memberData"); in TEST()
697 auto S = access("Id", cat(name("otherId"))); in TEST()
703 auto S = access("Id", cat("foo_", "bar")); in TEST()
709 auto S = ifBound("Id", cat("trueText"), access("exprId", "memberData")); in TEST()