/usr/share/doc/noweb/examples/sharpline is in noweb 2.11b-9.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 | #!/bin/sh
#
# noweb filter to handle #line directives in noweb input
#
# sample usage:
#
# preprocessor files | notangle -L -filter sharpline - > result.c
#
awk '
BEGIN { linestart = 1 }
/^(@nl|@index nl)$/ { linestart = 1; print; next }
/^@text #line +[0-9]+$/ {
if (linestart)
printf "@line %d\n", $3
else
print
linestart = 0; next
}
/^@text #line +[0-9]+ +".*"$/ {
if (linestart) {
thisline = $3
sub(/^@text #line +[0-9]+ +/, "")
thisfile = substr($0, 2, length($0) - 2)
printf "@file %s\n@line %d\n", thisfile, thisline
} else
print
linestart = 0; next
}
/^@(text |quote )/ { linestart = 0 }
{ print }' "$@"
|