From 3d344fc649f07dfac71f257ad5c9e444da103f32 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sat, 7 Apr 2018 15:09:02 +0000 Subject: [PATCH] set salit.size to 0 forcibly in get_symbol_array_literal() --- README.md | 18 +++++++++++++++--- lib/read.c | 4 +++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2fbca16..f1faf11 100644 --- a/README.md +++ b/README.md @@ -48,9 +48,9 @@ A HCL program is composed of more expressions. * nqk? * sprintf * printf -* + -* - -* * +* _+_ +* _-_ +* _*_ * mlt * / * quo @@ -61,3 +61,15 @@ A HCL program is composed of more expressions. * bit-xor * bit-not * bit-shift + +## Defining a function + +(defun function-name (arguments) + | local variables | + function body +) + +(set function-name (lambda (arguments) + | local variables | + function body +) diff --git a/lib/read.c b/lib/read.c index 646dd57..a92aa72 100644 --- a/lib/read.c +++ b/lib/read.c @@ -1753,7 +1753,9 @@ static int get_symbol_array_literal (hcl_t* hcl, hcl_oop_t* xlit) hcl_oop_t sa, sym; hcl_oow_t i; - HCL_ASSERT (hcl, hcl->c->r.salit.size == 0); + /* if the program is not buggy, salit.size must be 0 here. */ + HCL_ASSERT (hcl, hcl->c->r.salit.size == 0); + hcl->c->r.salit.size = 0; /* i want to set it to 0 in case it's buggy */ HCL_ASSERT (hcl, TOKEN_TYPE(hcl) == HCL_IOTOK_VBAR); GET_TOKEN_WITH_GOTO(hcl, oops);