From: CSRG Date: Tue, 29 Mar 1983 12:13:58 +0000 (-0800) Subject: BSD 4_3_Net_2 development X-Git-Tag: BSD-4_3_Net_2~1425 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/f2e1cb02d71fe9dff3ccf1d4e7d8e6836b5c376f BSD 4_3_Net_2 development Work on file usr/src/usr.bin/lisp/cvt.awk Synthesized-from: CSRG/cd2/net.2 --- diff --git a/usr/src/usr.bin/lisp/cvt.awk b/usr/src/usr.bin/lisp/cvt.awk new file mode 100644 index 0000000000..aac0ecd2e8 --- /dev/null +++ b/usr/src/usr.bin/lisp/cvt.awk @@ -0,0 +1,29 @@ + +{ if(begin != 1) + { if($1 != "") flags[$1] = "on" + if($2 != "") flags[$2] = "on" + if($3 != "") flags[$3] = "on" + if($4 != "") flags[$4] = "on" + if($5 != "") flags[$5] = "on" + skip = 0 + begin = 1 + next } } +/#ifdef/||/#elseif/ { if (flags[$2] != "") skip = -1; else skip = 1 + print $0 + next } +/#ifndef/ { if (flags[$2] != "") skip = 1; else skip = -1 + print $0 + next } +/#else/ { skip = -skip; print $0; next} +/#endif/ { skip = 0 ; print $0; next} +{ if(skip > 0) + { if(substr($0,1,1) != "#") print "#" $0; else print $0; + next }} +{ if(skip < 0) + { if(substr($0,1,1) == "#") + print substr($0,2,length($0)-1) + else print $0 + next }} +{ print $0 } + +