diff --git a/lib/kc3/0.1/kc3.facts b/lib/kc3/0.1/kc3.facts
index 77f399b..fe641e0 100644
--- a/lib/kc3/0.1/kc3.facts
+++ b/lib/kc3/0.1/kc3.facts
@@ -6,203 +6,196 @@ replace {KC3.operator_paren, :is_a, :operator}
replace {KC3.operator_paren, :sym, :"()"}
replace {KC3.operator_paren, :arity, 1}
replace {KC3.operator_paren, :symbol_value, cfn Tag "tag_paren" (Tag, Result)}
-replace {KC3.operator_paren, :operator_precedence, 16}
+replace {KC3.operator_paren, :operator_precedence, 14}
replace {KC3.operator_paren, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_brackets}
replace {KC3.operator_brackets, :is_a, :operator}
replace {KC3.operator_brackets, :sym, :"[]"}
replace {KC3.operator_brackets, :arity, 2}
replace {KC3.operator_brackets, :symbol_value, cfn Tag "kc3_access" (Tag, List, Result)}
-replace {KC3.operator_brackets, :operator_precedence, 15}
+replace {KC3.operator_brackets, :operator_precedence, 14}
replace {KC3.operator_brackets, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_bnot}
replace {KC3.operator_bnot, :is_a, :operator}
replace {KC3.operator_bnot, :sym, :~}
replace {KC3.operator_bnot, :arity, 1}
replace {KC3.operator_bnot, :symbol_value, cfn Tag "tag_bnot" (Tag, Result)}
-replace {KC3.operator_bnot, :operator_precedence, 14}
+replace {KC3.operator_bnot, :operator_precedence, 13}
replace {KC3.operator_bnot, :operator_associativity, :right}
add {KC3, :operator, KC3.operator_defstruct}
replace {KC3.operator_defstruct, :is_a, :operator}
replace {KC3.operator_defstruct, :sym, :defstruct}
replace {KC3.operator_defstruct, :arity, 1}
replace {KC3.operator_defstruct, :symbol_value, cfn Tag "kc3_defstruct" (List, Result)}
-replace {KC3.operator_defstruct, :operator_precedence, 14}
+replace {KC3.operator_defstruct, :operator_precedence, 13}
replace {KC3.operator_defstruct, :operator_associativity, :none}
add {KC3, :operator, KC3.operator_neg}
replace {KC3.operator_neg, :is_a, :operator}
replace {KC3.operator_neg, :sym, :-}
replace {KC3.operator_neg, :arity, 1}
replace {KC3.operator_neg, :symbol_value, cfn Tag "tag_neg" (Tag, Result)}
-replace {KC3.operator_neg, :operator_precedence, 14}
+replace {KC3.operator_neg, :operator_precedence, 13}
replace {KC3.operator_neg, :operator_associativity, :right}
add {KC3, :operator, KC3.operator_not}
replace {KC3.operator_not, :is_a, :operator}
replace {KC3.operator_not, :sym, :!}
replace {KC3.operator_not, :arity, 1}
replace {KC3.operator_not, :symbol_value, cfn Bool "tag_not" (Tag, Result)}
-replace {KC3.operator_not, :operator_precedence, 14}
+replace {KC3.operator_not, :operator_precedence, 13}
replace {KC3.operator_not, :operator_associativity, :right}
add {KC3, :operator, KC3.operator_pin}
replace {KC3.operator_pin, :is_a, :operator}
replace {KC3.operator_pin, :sym, :^}
replace {KC3.operator_pin, :arity, 1}
replace {KC3.operator_pin, :symbol_value, cfn Tag "kc3_identity" (Tag, Result)}
-replace {KC3.operator_pin, :operator_precedence, 14}
+replace {KC3.operator_pin, :operator_precedence, 13}
replace {KC3.operator_pin, :operator_associativity, :right}
add {KC3, :operator, KC3.operator_require}
replace {KC3.operator_require, :is_a, :operator}
replace {KC3.operator_require, :sym, :require}
replace {KC3.operator_require, :arity, 1}
replace {KC3.operator_require, :symbol_value, cfn Bool "kc3_require" (Sym)}
-replace {KC3.operator_require, :operator_precedence, 14}
+replace {KC3.operator_require, :operator_precedence, 13}
replace {KC3.operator_require, :operator_associativity, :none}
-add {KC3, :operator, KC3.operator_silence}
-replace {KC3.operator_silence, :is_a, :operator}
-replace {KC3.operator_silence, :sym, :^}
-replace {KC3.operator_silence, :arity, 1}
-replace {KC3.operator_silence, :symbol_value, cfn Tag "kc3_identity" (Tag, Result)}
-replace {KC3.operator_silence, :operator_precedence, 14}
-replace {KC3.operator_silence, :operator_associativity, :right}
add {KC3, :operator, KC3.operator_div}
replace {KC3.operator_div, :is_a, :operator}
replace {KC3.operator_div, :sym, :/}
replace {KC3.operator_div, :arity, 2}
replace {KC3.operator_div, :symbol_value, cfn Tag "tag_div" (Tag, Tag, Result)}
-replace {KC3.operator_div, :operator_precedence, 13}
+replace {KC3.operator_div, :operator_precedence, 12}
replace {KC3.operator_div, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_mod}
replace {KC3.operator_mod, :is_a, :operator}
replace {KC3.operator_mod, :sym, :mod}
replace {KC3.operator_mod, :arity, 2}
replace {KC3.operator_mod, :symbol_value, cfn Tag "tag_mod" (Tag, Tag, Result)}
-replace {KC3.operator_mod, :operator_precedence, 13}
+replace {KC3.operator_mod, :operator_precedence, 12}
replace {KC3.operator_mod, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_mul}
replace {KC3.operator_mul, :is_a, :operator}
replace {KC3.operator_mul, :sym, :*}
replace {KC3.operator_mul, :arity, 2}
replace {KC3.operator_mul, :symbol_value, cfn Tag "tag_mul" (Tag, Tag, Result)}
-replace {KC3.operator_mul, :operator_precedence, 13}
+replace {KC3.operator_mul, :operator_precedence, 12}
replace {KC3.operator_mul, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_add}
replace {KC3.operator_add, :is_a, :operator}
replace {KC3.operator_add, :sym, :+}
replace {KC3.operator_add, :arity, 2}
replace {KC3.operator_add, :symbol_value, cfn Tag "tag_add" (Tag, Tag, Result)}
-replace {KC3.operator_add, :operator_precedence, 12}
+replace {KC3.operator_add, :operator_precedence, 11}
replace {KC3.operator_add, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_addi}
replace {KC3.operator_addi, :is_a, :operator}
replace {KC3.operator_addi, :sym, :+i}
replace {KC3.operator_addi, :arity, 2}
replace {KC3.operator_addi, :symbol_value, cfn Tag "tag_addi" (Tag, Tag, Result)}
-replace {KC3.operator_addi, :operator_precedence, 12}
+replace {KC3.operator_addi, :operator_precedence, 11}
replace {KC3.operator_addi, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_sub}
replace {KC3.operator_sub, :is_a, :operator}
replace {KC3.operator_sub, :sym, :-}
replace {KC3.operator_sub, :arity, 2}
replace {KC3.operator_sub, :symbol_value, cfn Tag "tag_sub" (Tag, Tag, Result)}
-replace {KC3.operator_sub, :operator_precedence, 12}
+replace {KC3.operator_sub, :operator_precedence, 11}
replace {KC3.operator_sub, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_shift_left}
replace {KC3.operator_shift_left, :is_a, :operator}
replace {KC3.operator_shift_left, :sym, :<<}
replace {KC3.operator_shift_left, :arity, 2}
replace {KC3.operator_shift_left, :symbol_value, cfn Tag "tag_shift_left" (Tag, Tag, Result)}
-replace {KC3.operator_shift_left, :operator_precedence, 11}
+replace {KC3.operator_shift_left, :operator_precedence, 10}
replace {KC3.operator_shift_left, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_shift_right}
replace {KC3.operator_shift_right, :is_a, :operator}
replace {KC3.operator_shift_right, :sym, :>>}
replace {KC3.operator_shift_right, :arity, 2}
replace {KC3.operator_shift_right, :symbol_value, cfn Tag "tag_shift_right" (Tag, Tag, Result)}
-replace {KC3.operator_shift_right, :operator_precedence, 11}
+replace {KC3.operator_shift_right, :operator_precedence, 10}
replace {KC3.operator_shift_right, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_lt}
replace {KC3.operator_lt, :is_a, :operator}
replace {KC3.operator_lt, :sym, :<}
replace {KC3.operator_lt, :arity, 2}
replace {KC3.operator_lt, :symbol_value, cfn Bool "tag_lt" (Tag, Tag, Result)}
-replace {KC3.operator_lt, :operator_precedence, 10}
+replace {KC3.operator_lt, :operator_precedence, 9}
replace {KC3.operator_lt, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_lte}
replace {KC3.operator_lte, :sym, :<=}
replace {KC3.operator_lte, :is_a, :operator}
replace {KC3.operator_lte, :arity, 2}
replace {KC3.operator_lte, :symbol_value, cfn Bool "tag_lte" (Tag, Tag, Result)}
-replace {KC3.operator_lte, :operator_precedence, 10}
+replace {KC3.operator_lte, :operator_precedence, 9}
replace {KC3.operator_lte, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_gt}
replace {KC3.operator_gt, :sym, :>}
replace {KC3.operator_gt, :is_a, :operator}
replace {KC3.operator_gt, :arity, 2}
replace {KC3.operator_gt, :symbol_value, cfn Bool "tag_gt" (Tag, Tag, Result)}
-replace {KC3.operator_gt, :operator_precedence, 10}
+replace {KC3.operator_gt, :operator_precedence, 9}
replace {KC3.operator_gt, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_gte}
replace {KC3.operator_gte, :sym, :>=}
replace {KC3.operator_gte, :is_a, :operator}
replace {KC3.operator_gte, :arity, 2}
replace {KC3.operator_gte, :symbol_value, cfn Bool "tag_gte" (Tag, Tag, Result)}
-replace {KC3.operator_gte, :operator_precedence, 10}
+replace {KC3.operator_gte, :operator_precedence, 9}
replace {KC3.operator_gte, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_eq}
replace {KC3.operator_eq, :is_a, :operator}
replace {KC3.operator_eq, :sym, :==}
replace {KC3.operator_eq, :arity, 2}
replace {KC3.operator_eq, :symbol_value, cfn Bool "tag_eq" (Tag, Tag, Result)}
-replace {KC3.operator_eq, :operator_precedence, 9}
+replace {KC3.operator_eq, :operator_precedence, 8}
replace {KC3.operator_eq, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_not_eq}
replace {KC3.operator_not_eq, :is_a, :operator}
replace {KC3.operator_not_eq, :sym, :!=}
replace {KC3.operator_not_eq, :arity, 2}
replace {KC3.operator_not_eq, :symbol_value, cfn Bool "tag_not_eq" (Tag, Tag, Result)}
-replace {KC3.operator_not_eq, :operator_precedence, 9}
+replace {KC3.operator_not_eq, :operator_precedence, 8}
replace {KC3.operator_not_eq, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_band}
replace {KC3.operator_band, :is_a, :operator}
replace {KC3.operator_band, :sym, :&}
replace {KC3.operator_band, :arity, 2}
replace {KC3.operator_band, :symbol_value, cfn Tag "tag_band" (Tag, Tag, Result)}
-replace {KC3.operator_band, :operator_precedence, 8}
+replace {KC3.operator_band, :operator_precedence, 7}
replace {KC3.operator_band, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_bxor}
replace {KC3.operator_bxor, :is_a, :operator}
replace {KC3.operator_bxor, :sym, :^}
replace {KC3.operator_bxor, :arity, 2}
replace {KC3.operator_bxor, :symbol_value, cfn Tag "tag_bxor" (Tag, Tag, Result)}
-replace {KC3.operator_bxor, :operator_precedence, 7}
+replace {KC3.operator_bxor, :operator_precedence, 6}
replace {KC3.operator_bxor, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_bor}
replace {KC3.operator_bor, :is_a, :operator}
replace {KC3.operator_bor, :sym, :bor}
replace {KC3.operator_bor, :arity, 2}
replace {KC3.operator_bor, :symbol_value, cfn Tag "tag_bor" (Tag, Tag, Result)}
-replace {KC3.operator_bor, :operator_precedence, 6}
+replace {KC3.operator_bor, :operator_precedence, 5}
replace {KC3.operator_bor, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_and}
replace {KC3.operator_and, :is_a, :operator}
replace {KC3.operator_and, :sym, :&&}
replace {KC3.operator_and, :arity, 2}
replace {KC3.operator_and, :symbol_value, cfn Bool "tag_and" (Tag, Tag, Result)}
-replace {KC3.operator_and, :operator_precedence, 5}
+replace {KC3.operator_and, :operator_precedence, 4}
replace {KC3.operator_and, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_or}
replace {KC3.operator_or, :is_a, :operator}
replace {KC3.operator_or, :sym, :||}
replace {KC3.operator_or, :arity, 2}
replace {KC3.operator_or, :symbol_value, cfn Bool "tag_or" (Tag, Tag, Result)}
-replace {KC3.operator_or, :operator_precedence, 4}
+replace {KC3.operator_or, :operator_precedence, 3}
replace {KC3.operator_or, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_assign}
replace {KC3.operator_assign, :is_a, :operator}
replace {KC3.operator_assign, :sym, :<-}
replace {KC3.operator_assign, :arity, 2}
replace {KC3.operator_assign, :symbol_value, cfn Tag "var_assign" (Var, Tag, Result)}
-replace {KC3.operator_assign, :operator_precedence, 3}
+replace {KC3.operator_assign, :operator_precedence, 2}
replace {KC3.operator_assign, :operator_associativity, :left}
add {KC3, :operator, KC3.operator_equal}
replace {KC3.operator_equal, :is_a, :operator}
@@ -210,7 +203,7 @@ replace {KC3.operator_equal, :arity, 2}
add {KC3.operator_equal, :is_a, :special_operator}
replace {KC3.operator_equal, :sym, :=}
replace {KC3.operator_equal, :symbol_value, cfn Tag "tag_equal" (Tag, Tag, Result)}
-replace {KC3.operator_equal, :operator_precedence, 2}
+replace {KC3.operator_equal, :operator_precedence, 1}
replace {KC3.operator_equal, :operator_associativity, :right}
add {KC3, :operator, KC3.operator_semicolumn}
replace {KC3.operator_semicolumn, :is_a, :operator}
@@ -246,7 +239,7 @@ add {KC3, :symbol, KC3.fib}
replace {KC3.fib, :symbol_value, fn {
(0) { 1 }
(1) { 1 }
- (x) { if x < 0 then 0 else fib(x - 1) + fib(x - 2) end }
+ (x) { if x < 0 do 0 else fib(x - 1) + fib(x - 2) end }
}}
add {KC3, :symbol, KC3.sqrt}
replace {KC3.sqrt, :symbol_value, cfn Tag "tag_sqrt" (Tag, Result)}
diff --git a/libkc3/buf_parse.c b/libkc3/buf_parse.c
index 4cf94b9..f99e4c6 100644
--- a/libkc3/buf_parse.c
+++ b/libkc3/buf_parse.c
@@ -436,8 +436,6 @@ sw buf_parse_block (s_buf *buf, s_block *block)
result += r;
if ((r = buf_parse_block_inner(buf, short_form, block)) < 0) {
err_puts("buf_parse_block: buf_parse_block_inner < 0");
- err_inspect_buf(buf);
- err_write_1("\n");
assert(! "buf_parse_block: buf_parse_block_inner < 0");
goto restore;
}
@@ -472,18 +470,26 @@ sw buf_parse_block_inner (s_buf *buf, bool short_form, s_block *block)
if (short_form) {
if ((r = buf_read_1(buf, "}")) < 0) {
err_puts("buf_parse_block_inner: buf_read_1 \"}\"");
+ err_inspect_buf(buf);
+ err_write_1("\n");
assert(! "buf_parse_block_inner: buf_read_1 \"}\"");
goto restore;
}
}
else if ((r = buf_read_sym(buf, &g_sym_end)) < 0) {
err_puts("buf_parse_block_inner: buf_read_sym :end");
+ err_inspect_buf(buf);
+ err_write_1("\n");
assert(! "buf_parse_block_inner: buf_read_sym :end");
goto restore;
}
if (r > 0)
goto ok;
if ((r = buf_parse_tag(buf, &tag)) < 0) {
+ err_puts("buf_parse_block_inner: buf_parse_tag");
+ err_inspect_buf(buf);
+ err_write_1("\n");
+ assert(! "buf_parse_block_inner: buf_parse_tag");
goto restore;
}
result += r;
@@ -499,6 +505,8 @@ sw buf_parse_block_inner (s_buf *buf, bool short_form, s_block *block)
}
if ((r = buf_parse_comments(buf)) < 0) {
err_puts("buf_parse_block_inner: buf_parse_comments 1");
+ err_inspect_buf(buf);
+ err_write_1("\n");
assert(! "buf_parse_block_inner: buf_parse_comments 1");
goto restore;
}
@@ -506,6 +514,8 @@ sw buf_parse_block_inner (s_buf *buf, bool short_form, s_block *block)
if ((r = buf_ignore_spaces_but_newline(buf)) < 0) {
err_puts("buf_parse_block_inner:"
" buf_ignore_spaces_but_newline 1");
+ err_inspect_buf(buf);
+ err_write_1("\n");
assert(!("buf_parse_block_inner:"
" buf_ignore_spaces_but_newline 1"));
goto restore;
@@ -967,10 +977,8 @@ sw buf_parse_call_op_rec (s_buf *buf, s_call *dest, sw min_precedence)
next_op_precedence = operator_precedence(&next_op);
while (1) {
if (r <= 0 ||
- operator_arity(&next_op) != 2) {
- r = -1;
+ operator_arity(&next_op) != 2)
break;
- }
if (next_op_precedence <= op_precedence) {
if (! operator_is_right_associative(&next_op, &b)) {
r = -1;
@@ -978,16 +986,14 @@ sw buf_parse_call_op_rec (s_buf *buf, s_call *dest, sw min_precedence)
}
if (! b ||
next_op_precedence != op_precedence) {
- r = -1;
break;
}
}
call_init_op(&tmp2);
tmp2.arguments->tag = *right;
- if ((r = buf_parse_call_op_rec(buf, &tmp2,
- next_op_precedence > op_precedence
- ? op_precedence + 1
- : op_precedence)) <= 0) {
+ if ((r = buf_parse_call_op_rec
+ (buf, &tmp2, (next_op_precedence > op_precedence) ?
+ op_precedence + 1 : op_precedence)) <= 0) {
tmp2.arguments->tag.type = TAG_VOID;
call_clean(&tmp2);
break;
@@ -1016,11 +1022,10 @@ sw buf_parse_call_op_rec (s_buf *buf, s_call *dest, sw min_precedence)
break;
call_init_op(&tmp3);
tmp3.ident = op;
- tag_init_call(&tmp3.arguments->tag);
- tmp3.arguments->tag.data.call = tmp;
+ tmp3.arguments->tag = *left;
list_next(tmp3.arguments)->tag = *right;
- call_init(&tmp);
- tmp = tmp3;
+ tag_init_call(left);
+ left->data.call = tmp3;
}
call_clean(dest);
*dest = tmp;
@@ -3659,6 +3664,7 @@ sw buf_parse_sym_str (s_buf *buf, s_str *str)
sw buf_parse_tag (s_buf *buf, s_tag *dest)
{
+ character c;
sw r;
sw result = 0;
s_buf_save save;
@@ -3673,12 +3679,21 @@ sw buf_parse_tag (s_buf *buf, s_tag *dest)
goto restore;
result += r;
}
- if ((r = buf_parse_tag_special_operator(buf, dest)) != 0 ||
- (r = buf_parse_tag_call_op(buf, dest)) != 0 ||
- (r = buf_parse_tag_tuple(buf, dest)) != 0 ||
- (r = buf_parse_tag_block(buf, dest)) != 0 ||
- (r = buf_parse_tag_primary(buf, dest)) != 0)
- goto end;
+ if ((r = buf_peek_character_utf8(buf, &c)) <= 0)
+ goto restore;
+ switch (c) {
+ case '{':
+ if ((r = buf_parse_tag_tuple(buf, dest)) ||
+ (r = buf_parse_tag_block(buf, dest)))
+ goto end;
+ goto restore;
+ default:
+ if ((r = buf_parse_tag_special_operator(buf, dest)) != 0 ||
+ (r = buf_parse_tag_call_op(buf, dest)) != 0 ||
+ (r = buf_parse_tag_primary(buf, dest)) != 0)
+ goto end;
+ }
+ goto restore;
end:
if (r < 0)
goto restore;
@@ -4095,7 +4110,7 @@ sw buf_parse_tag_primary_4 (s_buf *buf, s_tag *dest)
result += r;
}
if ((r = buf_peek_character_utf8(buf, &c)) <= 0)
- goto end;
+ goto restore;
switch (c) {
case '(':
if ((r = buf_parse_tag_var(buf, dest)) ||
@@ -4105,6 +4120,10 @@ sw buf_parse_tag_primary_4 (s_buf *buf, s_tag *dest)
(r = buf_parse_tag_call_paren(buf, dest)))
goto end;
goto restore;
+ case '?':
+ if ((r = buf_parse_tag_var(buf, dest)))
+ goto end;
+ goto restore;
case 'v':
if ((r = buf_parse_tag_void(buf, dest)) ||
(r = buf_parse_tag_call(buf, dest)) ||
@@ -4127,8 +4146,14 @@ sw buf_parse_tag_primary_4 (s_buf *buf, s_tag *dest)
goto restore;
case 'c':
if ((r = buf_parse_tag_cow(buf, dest)) ||
- (r = buf_parse_tag_call(buf, dest)) ||
(r = buf_parse_tag_cfn(buf, dest)) ||
+ (r = buf_parse_tag_call(buf, dest)) ||
+ (r = buf_parse_tag_ident(buf, dest)))
+ goto end;
+ goto restore;
+ case 'd':
+ if ((r = buf_parse_tag_block(buf, dest)) ||
+ (r = buf_parse_tag_call(buf, dest)) ||
(r = buf_parse_tag_ident(buf, dest)))
goto end;
goto restore;
@@ -4150,15 +4175,20 @@ sw buf_parse_tag_primary_4 (s_buf *buf, s_tag *dest)
(r = buf_parse_tag_ident(buf, dest)))
goto end;
goto restore;
- case 'b':
+ case 'f':
+ if ((r = buf_parse_tag_fn(buf, dest)))
+ goto end;
+ // fall through
+ case 't':
if ((r = buf_parse_tag_bool(buf, dest)) ||
(r = buf_parse_tag_call(buf, dest)) ||
(r = buf_parse_tag_ident(buf, dest)))
goto end;
goto restore;
case '\'':
- r = buf_parse_tag_character(buf, dest);
- goto end;
+ if ((r = buf_parse_tag_character(buf, dest)))
+ goto end;
+ goto restore;
case '%':
if ((r = buf_parse_tag_map(buf, dest)) ||
(r = buf_parse_tag_time(buf, dest)) ||
@@ -4166,20 +4196,21 @@ sw buf_parse_tag_primary_4 (s_buf *buf, s_tag *dest)
goto end;
goto restore;
case '"':
- r = buf_parse_tag_str(buf, dest);
- goto end;
+ if ((r = buf_parse_tag_str(buf, dest)))
+ goto end;
+ goto restore;
case '{':
- r = buf_parse_tag_tuple(buf, dest);
- goto end;
- case 'f':
- r = buf_parse_tag_fn(buf, dest);
- goto end;
+ if ((r = buf_parse_tag_tuple(buf, dest)))
+ goto end;
+ goto restore;
case '[':
- r = buf_parse_tag_list(buf, dest);
- goto end;
+ if ((r = buf_parse_tag_list(buf, dest)))
+ goto end;
+ goto restore;
case ':':
- r = buf_parse_tag_sym(buf, dest);
- goto end;
+ if ((r = buf_parse_tag_sym(buf, dest)))
+ goto end;
+ goto restore;
default:
if ((r = buf_parse_tag_call(buf, dest)) ||
(r = buf_parse_tag_ident(buf, dest)) ||
diff --git a/test/ikc3/to_lisp.kc3 b/test/ikc3/to_lisp.kc3
new file mode 100644
index 0000000..cb26aa9
--- /dev/null
+++ b/test/ikc3/to_lisp.kc3
@@ -0,0 +1,2 @@
+quote to_lisp(quote a = ? <- 1 ; 2)
+to_lisp(quote a = ? <- 1 ; 2)
diff --git a/test/ikc3/to_lisp.out.expected b/test/ikc3/to_lisp.out.expected
new file mode 100644
index 0000000..da1747e
--- /dev/null
+++ b/test/ikc3/to_lisp.out.expected
@@ -0,0 +1,2 @@
+quote to_lisp(quote a = ? <- 1 ; 2)
+[operator_semicolumn, [operator_equal, a, [operator_assign ?, 1], 2]
diff --git a/test/ikc3/to_lisp.ret.expected b/test/ikc3/to_lisp.ret.expected
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/test/ikc3/to_lisp.ret.expected
@@ -0,0 +1 @@
+0