tree-il->scheme improvements
authorMark H Weaver <mhw@netris.org>
Thu, 1 Mar 2012 22:56:14 +0000 (17:56 -0500)
committerMark H Weaver <mhw@netris.org>
Sat, 3 Mar 2012 23:05:21 +0000 (18:05 -0500)
commit72ee0ef71b9a0514874976cdcf3ea9d5333db4b1
tree31412c012bf443ca2864f90362caf108784a26c8
parent8c43b28a1136aba186fd211b0f6037cf0c35f006
tree-il->scheme improvements

* module/language/tree-il.scm (tree-il->scheme): New implementation that
  simply calls 'decompile-tree-il'.

* module/language/scheme/decompile-tree-il.scm (choose-output-names,
  do-decompile): New internal procedures.

  (decompile-tree-il): New and improved implementation.  Print source
  identifiers where possible, otherwise add minimal numeric suffixes.
  Previously we printed the gensyms.  Avoid 'begin' in contexts that
  provide an implicit 'begin'.  Produce 'cond', 'case', 'and', 'or',
  'let*', named let, and internal defines where appropriate.  Recognize
  keyword arguments in 'opts' to disable the production of these derived
  syntactic forms, and to optionally strip numeric suffixes from
  variable names.

* module/ice-9/compile-psyntax.scm: Disable partial evaluation, letrec
  fixing, and primitive expansion when producing psyntax-pp.scm, in
  order to produce output as close to the original source as practical.
  Disable production of derived syntactic forms as needed during
  bootstrap.  Strip numeric suffixes from variable names.  Adjust
  pretty-printing parameters.

* module/ice-9/psyntax-pp.scm: Regenerate.  It is now less than half
  of the original size.
module/ice-9/compile-psyntax.scm
module/ice-9/psyntax-pp.scm
module/language/scheme/decompile-tree-il.scm
module/language/tree-il.scm