HaskellWiki

Haskell | Wiki community | Recent changes
Random page | Special pages

 

Not logged in
Log in | Help

Literate programming/Bird conversion via awk

< Literate programming

Categories: Development tools

Thanks to Peter Tillier from the comp.lang.awk newsgroup.

# bird2code.awk
/^[^>]/ || /^$/ {print; next}

/^>/ {
  print "\\begin{code}"
  sub(/^> /,"")
  print
  rc = getline
  while(($0 ~ /^>/) && (rc > 0)) {
    sub(/^> /,"")
    print
    rc = getline
  }
  print "\\end{code}\n"
}

Retrieved from "http://haskell.org/haskellwiki/Literate_programming/Bird_conversion_via_awk"

This page has been accessed 799 times. This page was last modified 12:34, 28 March 2008. Recent content is available under a simple permissive license.