-
Notifications
You must be signed in to change notification settings - Fork 6
/
post-clisp.awk
49 lines (44 loc) · 1.13 KB
/
post-clisp.awk
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
BEGIN{
"pwd"|getline pwd
# "/usr/local/bin/clisp -q -norc -ansi -x \"(princ(namestring (truename \\\"$(pwd)/\\\")))\""|getline pwd
}
/Compiling file /{
file=$4;
if(substr(file,0,length(pwd))==pwd){
file=substr(file,1+length(pwd));
}
next;
}
/; *Loading file /{
file=$4;
if(substr(file,0,length(pwd))==pwd){
file=substr(file,1+length(pwd));
}
next;
}
/WARNING in.*in lines/{
start=index($0,"WARNING in ")+length("WARNING in ");
fn=substr($0,start,index($0," in lines ")-start);
start=index($0," in lines ")+length(" in lines ");
lines=substr($0,start,index(substr($0,start)," ")-1);
split(lines,n,"\\.");
w="WARNING";
next;
}
/ERROR.*in lines/{
start=index($0,"ERROR in ")+length("WARNING in ");
fn=substr($0,start,index($0," in lines ")-start);
start=index($0," in lines ")+length(" in lines ");
lines=substr($0,start,index(substr($0,start)," ")-1);
split(lines,n,"\\.");
w="ERROR";
next;
}
{
if(w!=""){
printf "%s:%s:1:\n%s:%s:2:%s in %s: %s\n",file,n[1],file,n[3],w,fn,$0;
w="";
}else{
print $0;
}
}