From 1d496f5f7f01b20fb34e63d1c85a33d8decd1894 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sat, 22 Jun 2024 12:23:55 +0100 Subject: add function literals --- dis.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'dis.c') diff --git a/dis.c b/dis.c index ba0e1db..5097b05 100644 --- a/dis.c +++ b/dis.c @@ -87,6 +87,17 @@ void disasm_chunk(Chunk *ch) { } } + printf("\n"); + + for (uint8_t cix = 0; cix < ch->consts.len; cix++) { + Val c = ch->consts.d[cix]; + if (IS_FUNC(c)) { + printf("const %d is function:\n", cix); + disasm_chunk(&AS_FUNC(c)->chunk); + } + } + + } -- cgit v1.2.3