File:  [CSRG BSD Unix] / 43BSD / contrib / icon / test / buildt.icn
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:55 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43
BSD 4.3

#  This program takes Icon expressions as input and outputs an Icon
#  program that tests the expressions, showing the expressions and
#  the results of evaluating them.

procedure main()
   local exp, lexp
   write("record array(a,b,c,d,e,f,g)")
   write("\nprocedure dummy(u,v,x,y,z)")
   write("   suspend u | v")
   write("   return x")
   write("end")
   write("\nprocedure main()")
   while exp := read() do {
      lexp := exp
      lexp ?:= escape()
      write("   write(\"",lexp," ----> \",image(",exp,") | \"none\")")
      }
   write("end")
end

procedure escape()
   local line
   line := ""
   while line ||:= tab(upto('"\\')) || "\\" || move(1)
   return line || tab(0)
end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.