27 |
|
|
28 |
fun tos s = concat ["\"", String.toString s, "\""] |
fun tos s = concat ["\"", String.toString s, "\""] |
29 |
|
|
30 |
fun rhs (P.SYM (ns, n)) = cfc ("sym", [tos ns, tos n]) |
fun tons P.SGN = "sgn" |
31 |
|
| tons P.STR = "str" |
32 |
|
| tons P.FCT = "fct" |
33 |
|
|
34 |
|
fun rhs (P.SYM (ns, n)) = cfc (tons ns, [tos n]) |
35 |
| rhs (P.SYMS syms) = cfc ("syms", [varlist syms]) |
| rhs (P.SYMS syms) = cfc ("syms", [varlist syms]) |
36 |
| rhs (P.IMPORT { lib, syms }) = cfc ("import", [lib, syms]) |
| rhs (P.IMPORT { lib, syms }) = cfc ("import", [lib, syms]) |
37 |
| rhs (P.COMPILE { src = (src, native), env, syms }) = |
| rhs (P.COMPILE { src = (src, native), env, syms }) = |
46 |
out ["\n"]) |
out ["\n"]) |
47 |
in |
in |
48 |
out ["val thelibrary = fn ", context, " => (\n"]; |
out ["val thelibrary = fn ", context, " => (\n"]; |
49 |
out ["fn ", varlist imports, " => let\n"]; |
out ["fn ", varlist imports, " => let open PGOps\n"]; |
50 |
app dodef defs; |
app dodef defs; |
51 |
out [" in\n export ", context, " ", export, |
out [" in\n export ", context, " ", export, |
52 |
"\n end\n\ |
"\n end\n\ |