commit a8e1db1155c461ec7ff09fa36796b340974c4a88
parent 7c3f0b62951ceca97346364927b4479df19fae9f
Author: Tomas Hlavaty <tom@logand.com>
Date: Sun, 18 Mar 2012 13:01:26 +0100
s/print2cell/walk2
Diffstat:
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/unoidl2.c b/unoidl2.c
@@ -353,22 +353,22 @@ Any run1(Any x) {
return x;
}
-void (*print2cell_fn)(Any x, Any k, Any p, Any v);
+void (*walk2_fn)(Any x, Any k, Any p, Any v);
-Any print2cell(Any x) {
+Any walk2(Any x) {
Any c = cdr(x);
Any kpv = car(x);
Any k = car(kpv);
Any p = cadr(kpv);
Any v = cddr(kpv);
if(NIL == v) {
- mapc(print2cell, c);
+ mapc(walk2, c);
} else if(MODULE == kind(v)) {
- mapc(print2cell, c);
+ mapc(walk2, c);
} else if(NIL == c) {
- print2cell_fn(x, k, p, v);
+ walk2_fn(x, k, p, v);
} else {
- printf("@@@ print2cell error: unexpected children\n");
+ printf("@@@ walk2 error: unexpected children\n");
print(x);
}
return x;
diff --git a/unoidl2.h b/unoidl2.h
@@ -66,6 +66,6 @@ Any find(Any elt, Any lst, Fn2 cmp, Fn1 key);
Any reverse(Any x, Any a);
Any id(Any x);
Any run1(Any x);
-extern void (*print2cell_fn)(Any x, Any k, Any p, Any v);
-Any print2cell(Any x);
+extern void (*walk2_fn)(Any x, Any c, Any k, Any p, Any v);
+Any walk2(Any x);
void init();
diff --git a/unoidl2ast.c b/unoidl2ast.c
@@ -35,7 +35,7 @@ int main() {
yyparse();
//mapc(pr1, ast);
mapc(run1, ast);
- print2cell_fn = cell2ast;
- print2cell(root2);
+ walk2_fn = cell2ast;
+ walk2(root2);
return 0;
}