From: cassowarii Date: Mon, 29 Jun 2026 04:58:37 +0000 (-0700) Subject: update comments X-Git-Url: https://git.cassowary.me/gitweb.cgi?a=commitdiff_plain;h=3063326dd0a5adbf3a569df87c016671ceb0de67;p=sarabande.git update comments --- diff --git a/src/compile/ir.c b/src/compile/ir.c index 9fca3ed..aa1e860 100644 --- a/src/compile/ir.c +++ b/src/compile/ir.c @@ -239,11 +239,15 @@ static void compile_ast_stmt(hIrChunk ck, sbAst node) { * LET a * a = 3 * + * LET a, b = 5, 6 + * linearizes to: + * LET a, b + * a = 5 + * b = 6 + * * "LET a" doesn't actually appear in the output IR code, * but it allows us to interpret the name "a" inside the * current block to refer to a consistent variable slot. - * TODO: I need to add support for declaring multiple - * variables in one line. */ if (node->seq.right == NO_NODE) { /* let ... */ @@ -284,6 +288,17 @@ static void compile_ast_stmt(hIrChunk ck, sbAst node) { break; case AST_NODE_ASSIGN: + /* + * x, y, z = 1, 2, 3 + * linearizes to + * x = 1 + * y = 2 + * z = 3 + * + * TODO: For things that are not straight variable names, + * we need to convert them to the appropriate method calls. + * Right now we don't have method calls, but eventually, we + * will have them. */ if (node->seq.left->type != AST_NODE_MULTIVAL) PANIC("expected multival on left side of assign!"); if (node->seq.right->type != AST_NODE_MULTIVAL) PANIC("expected multival on right side of assign!"); N1 = node->seq.left; /* things to bind to */