The '}' closing the block opened at `open`. */
| 1079 | |
| 1080 | /* The '}' closing the block opened at `open`. */ |
| 1081 | static const char *gc_block_end(const char *open) { |
| 1082 | int depth = 0; |
| 1083 | for (const char *p = open; *p;) { |
| 1084 | const char *q = gc_skip(p); |
| 1085 | if (q != p) { |
| 1086 | p = q; |
| 1087 | continue; |
| 1088 | } |
| 1089 | depth += *p == '{'; |
| 1090 | depth -= *p == '}'; |
| 1091 | if (depth == 0) { |
| 1092 | return p; |
| 1093 | } |
| 1094 | p++; |
| 1095 | } |
| 1096 | return open + strlen(open); |
| 1097 | } |
| 1098 | |
| 1099 | /* The top-level comma-separated parts of the list opened at `open` ('('). |
| 1100 | * Returns their count (at most `max`); *end: the closing ')'. */ |
no test coverage detected