Hi everybody,
I propose the attached patch so that the code matches the text.
Regards,
Béatrice.
--
Béatrice Creusillet
SILKAN - www.silkan.com
Index: LibASTMatchersTutorial.rst
===================================================================
--- LibASTMatchersTutorial.rst (revision 176489)
+++ LibASTMatchersTutorial.rst (working copy)
@@ -395,8 +395,8 @@
hasCondition(binaryOperator(
hasOperatorName("<"),
- hasRHS(expr(hasType(isInteger()))),
- hasLHS(declRefExpr(to(varDecl(hasType(isInteger())))))))
+ hasLHS(declRefExpr(to(varDecl(hasType(isInteger()))))),
+ hasRHS(expr(hasType(isInteger())))))
Why? Because it doesn't work. Of the three loops provided in
``test-files/simple.cpp``, zero of them have a matching condition. A
@@ -432,9 +432,9 @@
hasCondition(binaryOperator(
hasOperatorName("<"),
- hasLHS(expr(hasType(isInteger()))),
- hasRHS(ignoringParenImpCasts(declRefExpr(
- to(varDecl(hasType(isInteger()))))))))
+ hasLHS(ignoringParenImpCasts(declRefExpr(
+ to(varDecl(hasType(isInteger())))))),
+ hasRHS(expr(hasType(isInteger())))))
After adding binds to the expressions we wished to capture and
extracting the identifier strings into variables, we have array-step-2
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits