@@ -725,6 +725,8 @@ _PyPegen_fill_token(Parser *p)
725725 return 0 ;
726726}
727727
728+
729+ #if defined(Py_DEBUG )
728730// Instrumentation to count the effectiveness of memoization.
729731// The array counts the number of tokens skipped by memoization,
730732// indexed by type.
@@ -761,6 +763,7 @@ _PyPegen_get_memo_statistics()
761763 }
762764 return ret ;
763765}
766+ #endif
764767
765768int // bool
766769_PyPegen_is_memoized (Parser * p , int type , void * pres )
@@ -776,6 +779,7 @@ _PyPegen_is_memoized(Parser *p, int type, void *pres)
776779
777780 for (Memo * m = t -> memo ; m != NULL ; m = m -> next ) {
778781 if (m -> type == type ) {
782+ #if defined(PY_DEBUG )
779783 if (0 <= type && type < NSTATISTICS ) {
780784 long count = m -> mark - p -> mark ;
781785 // A memoized negative result counts for one.
@@ -784,6 +788,7 @@ _PyPegen_is_memoized(Parser *p, int type, void *pres)
784788 }
785789 memo_statistics [type ] += count ;
786790 }
791+ #endif
787792 p -> mark = m -> mark ;
788793 * (void * * )(pres ) = m -> node ;
789794 return 1 ;
@@ -2286,9 +2291,9 @@ _PyPegen_get_invalid_target(expr_ty e, TARGETS_TYPE targets_type)
22862291 }
22872292
22882293#define VISIT_CONTAINER (CONTAINER , TYPE ) do { \
2289- Py_ssize_t len = asdl_seq_LEN(CONTAINER->v.TYPE.elts);\
2294+ Py_ssize_t len = asdl_seq_LEN(( CONTAINER) ->v.TYPE.elts);\
22902295 for (Py_ssize_t i = 0; i < len; i++) {\
2291- expr_ty other = asdl_seq_GET(CONTAINER->v.TYPE.elts, i);\
2296+ expr_ty other = asdl_seq_GET(( CONTAINER) ->v.TYPE.elts, i);\
22922297 expr_ty child = _PyPegen_get_invalid_target(other, targets_type);\
22932298 if (child != NULL) {\
22942299 return child;\
0 commit comments