qse/regress/awk/stripcomment.awk

12 lines
150 B
Awk

BEGIN {
RS = "/\\*([^*]|\\*+[^/*])*\\*+/"
# comment is record separator
ORS = " "
getline hold
}
{ print hold ; hold = $0 }
END { print hold }