OSDN Git Service
(root)
/
joypy
/
Thun.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b09055f
)
Print true, false, and lists.
author
Simon Forman
<sforman@hushmail.com>
Thu, 2 Feb 2023 04:33:04 +0000
(20:33 -0800)
committer
Simon Forman
<sforman@hushmail.com>
Thu, 2 Feb 2023 04:33:04 +0000
(20:33 -0800)
implementations/C/joy.c
patch
|
blob
|
history
diff --git
a/implementations/C/joy.c
b/implementations/C/joy.c
index
8cbcd2f
..
17f5502
100644
(file)
--- a/
implementations/C/joy.c
+++ b/
implementations/C/joy.c
@@
-161,6
+161,10
@@
text_to_expression(char *text)
return result;
}
+/* Pre-declare so we can use it in print_node(). */
+void
+print_list(struct list_node* el);
+
void
print_node(struct JoyType j)
@@
-172,6
+176,17
@@
print_node(struct JoyType j)
case joySymbol:
printf("%s", j.value.symbol);
break;
+ case joyTrue:
+ printf("true");
+ break;
+ case joyFalse:
+ printf("false");
+ break;
+ case joyList:
+ printf("[");
+ print_list(j.value.el);
+ printf("]");
+ break;
default:
printf("wtf");
}