From 43b140285f0becef039fc1c853ecfc6bda51a4dd Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Mon, 4 Nov 2019 13:17:15 -0800 Subject: [PATCH] Fix missing line in runtime header in compiler series --- code/compiler/07/runtime.h | 1 + code/compiler/08/runtime.h | 1 + content/blog/07_compiler_runtime.md | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/code/compiler/07/runtime.h b/code/compiler/07/runtime.h index 2a585b1..baaaaae 100644 --- a/code/compiler/07/runtime.h +++ b/code/compiler/07/runtime.h @@ -55,6 +55,7 @@ struct stack { struct node_base** data; }; +void stack_init(struct stack* s); void stack_free(struct stack* s); void stack_push(struct stack* s, struct node_base* n); struct node_base* stack_pop(struct stack* s); diff --git a/code/compiler/08/runtime.h b/code/compiler/08/runtime.h index 2a585b1..baaaaae 100644 --- a/code/compiler/08/runtime.h +++ b/code/compiler/08/runtime.h @@ -55,6 +55,7 @@ struct stack { struct node_base** data; }; +void stack_init(struct stack* s); void stack_free(struct stack* s); void stack_push(struct stack* s, struct node_base* n); struct node_base* stack_pop(struct stack* s); diff --git a/content/blog/07_compiler_runtime.md b/content/blog/07_compiler_runtime.md index 5cd44ac..bf4efc5 100644 --- a/content/blog/07_compiler_runtime.md +++ b/content/blog/07_compiler_runtime.md @@ -91,7 +91,7 @@ which we will use for lazy evaluation (modifying expressions with their reduced * `stack_pack` and `stack_split` - Wrap and unwrap constructors on the stack. We declare these in a header: -{{< codelines "C" "compiler/07/runtime.h" 52 67 >}} +{{< codelines "C" "compiler/07/runtime.h" 52 68 >}} And implement them as follows: {{< codelines "C" "compiler/07/runtime.c" 42 116 >}}