#include "ast.h"
#include "parse.h"
-static const char *binop_str[] = {
+const char *binop_str[] = {
[binor] = "||", [binand] = "&&", [eq] = "==", [neq] = "!=",
[leq] = "<=", [le] = "<", [geq] = ">=", [ge] = ">", [cons] = ":",
[plus] = "+", [minus] = "-", [times] = "*", [divide] = "/",
[modulo] = "%", [power] = "^",
};
-static const char *fieldspec_str[] = {
+const char *fieldspec_str[] = {
[fst] = "fst", [snd] = "snd", [hd] = "hd", [tl] = "tl"};
-static const char *unop_str[] = { [inverse] = "!", [negate] = "-", };
+const char *unop_str[] = { [inverse] = "!", [negate] = "-", };
static const char *basictype_str[] = {
[btbool] = "Bool", [btchar] = "Char", [btint] = "Int",
[btvoid] = "Void",
safe_fprintf(out, "while (");
expr_print(stmt->data.swhile.pred, out);
safe_fprintf(out, ") {\n");
- for (int i = 0; i<stmt->data.swhile.nbody; i++) {
+ for (int i = 0; i<stmt->data.swhile.nbody; i++)
stmt_print(stmt->data.swhile.body[i], indent+1, out);
- }
pindent(indent, out);
safe_fprintf(out, "}\n");
break;