diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-18 23:31:36 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-18 23:31:36 -0400 |
| commit | 9e07c6adc7a0616eec40e78024a8501ec7d96559 (patch) | |
| tree | 92542ba27e13152a8305deb6f0cda3a952ac8835 /compile.c | |
| parent | 1f16d63ac783d9b1bb1d4a65676476d14f0af713 (diff) | |
Add Channel:peek()
Diffstat (limited to 'compile.c')
| -rw-r--r-- | compile.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -2377,6 +2377,10 @@ CORD compile(env_t *env, ast_t *ast) CORD self = compile_to_pointer_depth(env, call->self, 0, false); (void)compile_arguments(env, ast, NULL, call->args); return CORD_all("Channel$get_value(", self, ", ", compile_type(item_t), ", ", padded_item_size, ")"); + } else if (streq(call->name, "peek")) { + CORD self = compile_to_pointer_depth(env, call->self, 0, false); + (void)compile_arguments(env, ast, NULL, call->args); + return CORD_all("Channel$peek_value(", self, ", ", compile_type(item_t), ")"); } else if (streq(call->name, "clear")) { CORD self = compile_to_pointer_depth(env, call->self, 0, false); (void)compile_arguments(env, ast, NULL, call->args); |
