diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2013-12-05 18:39:11 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2013-12-05 18:39:11 +0100 |
commit | b96a4189d89146cdc6bba5e2c477a42b46f787cd (patch) | |
tree | 8965e9904b8fc1de286fbaa70cb28a46fbedc2e6 /highlight.sno | |
download | groff-tools-b96a4189d89146cdc6bba5e2c477a42b46f787cd.tar.gz |
initial commit of files from my bachelor-thesis repo
Diffstat (limited to 'highlight.sno')
-rwxr-xr-x | highlight.sno | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/highlight.sno b/highlight.sno new file mode 100755 index 0000000..ce43a1b --- /dev/null +++ b/highlight.sno @@ -0,0 +1,28 @@ +#!/usr/local/bin/snobol4 -b + + &anchor = 1 +* flush OUTPUT immediately + output(.output, 6, "W") + +loop line = input :f(end) + line ".HIGHLIGHT " rem . language :s(pipe) + output = line :(loop) + +* empty line to fixup line numbering +pipe output = "." +* FIXME: hack to strip the last byte (linefeed) since source-highlight +* is picky about newlines at the end of the file (will print another lineprefix) + output(.pipe, 100,, ++ "| head -c -1 | source-highlight --outlang-def groff.outlang -s " language) + +pipe_l line = input + line ".HIGHLIGHT" :s(close) + pipe = line :(pipe_l) + +close endfile(100) +* empty line to fixup line numbering +* FIXME: the linefeed is necessary because source-highlight did not terminate +* the last line + output = char(10) "." :(loop) + +end |