import statement pretty-printing (and thus also bito compilation) is
broken for promiscuous imports and qualified imports. For instance,
(import foo)
(import bar frobnicate)
(import baz (frobnicate as flurbify))
compiles to
(importfoo import foo
(importbar import frobnicate
(importbaz import (= flurbify frobnicate)
The attached patch fixes this.
- Nathan Weizenbaum
# HG changeset patch
# User Nathan Weizenbaum <[EMAIL PROTECTED]>
# Date 1226797119 28800
# Node ID 4025fd52ecf7a4043e2507bb1cd822e9668568f3
# Parent decd1b68560763312f80a79097a4892deebb26e1
Fix import pretty-printing.
diff -r decd1b685607 -r 4025fd52ecf7 src/compiler/BitC-pp.cxx
--- a/src/compiler/BitC-pp.cxx Sat Nov 15 13:35:26 2008 -0500
+++ b/src/compiler/BitC-pp.cxx Sat Nov 15 16:58:39 2008 -0800
@@ -657,17 +657,16 @@ BitcP(INOstream& out, shared_ptr <const
case at_import:
out << "(" << ast->atKwd();
- BitcP(out, ast->child(0), showTypes);
- out << " import ";
- doChildren(out, ast, 1, true, showTypes);
+ doChildren(out, ast, 0, true, showTypes);
+ out << ")";
break;
case at_ifsel:
if (ast->child(0)->s == ast->child(1)->s)
out << ast->child(0)->s;
else
- out << "(= " << ast->child(0)->s
- << " " << ast->child(1)->s
+ out << "(" << ast->child(1)->s
+ << " as " << ast->child(0)->s
<< ")";
break;
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev