diff options
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | arith.c | 2 | ||||
-rw-r--r-- | lib.c | 4 | ||||
-rw-r--r-- | match.c | 4 |
4 files changed, 26 insertions, 0 deletions
@@ -1,3 +1,19 @@ +2014-05-10 Kaz Kylheku <kaz@kylheku.com> + + String type related bugfixes: neglecting to handle all three kinds in + some places. In particular, the test case + + echo : | ./txr -c '@a:@a' - + + breaks because of neglected LIT in do_match_line. + + * arith.c (tofloat, toint): Handle LIT type in switch. + + * lib.c (ref, refset, replace, update): Handle LSTR type. + + * match.c (do_match_line, do_output_line): Handle LSTR and LIT + objects in switch. + 2014-04-14 Kaz Kylheku <kaz@kylheku.com> * stream.c (get_line, get_char, get_byte): Fix outdated, incorrect @@ -1945,6 +1945,7 @@ val tofloat(val obj) return obj; case STR: case LSTR: + case LIT: return flo_str(obj); default: break; @@ -1970,6 +1971,7 @@ val toint(val obj, val base) return int_flo(obj); case STR: case LSTR: + case LIT: return int_str(obj, base); default: break; @@ -5017,6 +5017,7 @@ val ref(val seq, val ind) return listref(seq, ind); case LIT: case STR: + case LSTR: return chr_str(seq, ind); case VEC: return vecref(seq, ind); @@ -5034,6 +5035,7 @@ val refset(val seq, val ind, val newval) return set(listref_l(seq, ind), newval); case LIT: case STR: + case LSTR: return chr_str_set(seq, ind, newval); case VEC: return set(vecref_l(seq, ind), newval); @@ -5052,6 +5054,7 @@ val replace(val seq, val items, val from, val to) return replace_list(seq, items, from, to); case LIT: case STR: + case LSTR: return replace_str(seq, items, from, to); case VEC: return replace_vec(seq, items, from, to); @@ -5078,6 +5081,7 @@ val update(val seq, val fun) break; case LIT: case STR: + case LSTR: case VEC: { val len = length(seq); @@ -1234,6 +1234,8 @@ static val do_match_line(match_line_ctx *c) } break; case STR: + case LSTR: + case LIT: { val newpos; if (!match_str(c->dataline, elem, c->pos)) { @@ -1767,6 +1769,8 @@ static void do_output_line(val bindings, val specline, val filter, val out) } break; case STR: + case LSTR: + case LIT: put_string(elem, out); break; case 0: |