1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/check=\(/ {
    for (v in saved) { print saved[v] }; delete saved
    ++n
}

/files=\(/ {
    ++processing_files
}

{
    if (n == 0) {
        print $0
    } else {
        saved[n++] = $0
        #(
        if (n > 0 && index($0, ")")) {
            limit = n
            n = 0
        }
    }
    #(
    if (processing_files > 0 && index($0, ")")) {
        processing_files = 0
        for (v in saved) {
          print saved[v]
        }
        delete saved
    }
}
END { for (v in saved) { print saved[v] }; delete saved }