summaryrefslogtreecommitdiffstats
path: root/bin/gen-iwyu-dummy-lib.awk
blob: 464d9515c7ef62f37ee84cc0b7f231a8bbc07d26 (plain)
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
31
32
33
34
BEGIN  { domatch = 0; }

{
    if ($0 ~ /use_external(s)?,/ )
    {
        if (index($0, "))"))
        {
            gsub(/.*,/, "");
            gsub(/\)+/, ""); 
            if (!($0 in exts))
            {
                exts[$0];
                print $0;
            }
        }
        else
        {
           domatch = 1;
        }
    }
    else if ($0 ~ /\)\)/ )
    {
        domatch = 0;
    }
    else if (domatch == 1)
    {
        if (!($1 in exts))
        {
            exts[$1];
            print $1;
        }
    }
}