diff options
author | Tom Willemse | 2022-01-22 22:01:54 -0800 |
---|---|---|
committer | Tom Willemse | 2022-01-22 22:01:54 -0800 |
commit | a52c55eb9af3e29a912d41a48071e830b0971fd5 (patch) | |
tree | 579f8d8e934f63c67aef9a8da60d60fe136bd928 /clox/src/object.c | |
parent | 9025da8168e505e2b0e32b89a0d94db935dace93 (diff) | |
download | crafting-interpreters-a52c55eb9af3e29a912d41a48071e830b0971fd5.tar.gz crafting-interpreters-a52c55eb9af3e29a912d41a48071e830b0971fd5.zip |
Chapter 24.2 (Does Not Compile)
Diffstat (limited to 'clox/src/object.c')
-rw-r--r-- | clox/src/object.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clox/src/object.c b/clox/src/object.c index 7170352..2df533e 100644 --- a/clox/src/object.c +++ b/clox/src/object.c @@ -69,6 +69,10 @@ ObjString *copyString(const char *chars, int length) { } static void printFunction(ObjFunction *function) { + if (function->name == NULL) { + printf("<script>"); + return; + } printf("<fn %s>", function->name->chars); } |