Guest User

Untitled

a guest
Mar 19th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. clang-query> match ifStmt(hasCondition(binaryOperator(hasRHS(integerLiteral(equals(0)))))
  2.  
  3. 1:2: Error parsing argument 1 for matcher ifStmt.
  4. 1:9: Error parsing argument 1 for matcher hasCondition.
  5. 1:22: Error parsing argument 1 for matcher binaryOperator.
  6. 1:37: Error parsing argument 1 for matcher hasRHS.
  7. 1:44: Error parsing argument 1 for matcher integerLiteral.
  8. 1:59: Matcher not found: equals
  9.  
  10. Matcher<IntegerLiteral> equals const ValueT Value
  11.  
  12. Matches literals that are equal to the given value of type ValueT.
  13.  
  14. Given
  15. f('false, 3.14, 42);
  16. characterLiteral(equals(0))
  17. matches 'cxxBoolLiteral(equals(false)) and cxxBoolLiteral(equals(0))
  18. match false
  19. floatLiteral(equals(3.14)) and floatLiteral(equals(314e-2))
  20. match 3.14
  21. integerLiteral(equals(42))
  22. matches 42
  23.  
  24. Note that you cannot directly match a negative numeric literal because the
  25. minus sign is not part of the literal: It is a unary operator whose operand
  26. is the positive numeric literal. Instead, you must use a unaryOperator()
  27. matcher to match the minus sign:
  28.  
  29. unaryOperator(hasOperatorName("-"),
  30. hasUnaryOperand(integerLiteral(equals(13))))
  31.  
  32. Usable as: Matcher<CharacterLiteral>, Matcher<CXXBoolLiteralExpr>,
  33. Matcher<FloatingLiteral>, Matcher<IntegerLiteral>
Add Comment
Please, Sign In to add comment