diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-09-07 07:14:02 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-09-07 07:14:02 -0700 |
commit | 98ed59198be3104e82c00734e01f4a1022440d1b (patch) | |
tree | 1d6130cc914977b7897834407f6148cfc54cbec0 /y.tab.c.shipped | |
parent | 575851b07a498847b8ddeaf94db8bc177c4f57c1 (diff) | |
download | txr-98ed59198be3104e82c00734e01f4a1022440d1b.tar.gz txr-98ed59198be3104e82c00734e01f4a1022440d1b.tar.bz2 txr-98ed59198be3104e82c00734e01f4a1022440d1b.zip |
string-extend: third optional argument.
A Boolean optional argument to string-extend indicates whether
this is likely the last call to string-extend, so memory can
be trimmed accordingly.
* eval.c (eval_init): Update string-extend registration.
* filter.c (trie_filter_string): Pass nil for new argument of
string_extend.
* lib.c (str_seq, replace_str,
lazy_str_force, lazy_str_force_upto): Pass nil for new
argument of string_extend.
(rem_impl, remove_if, separate): Pass t for new argument of
string_extend on last iteration, nil otherwise.
(string_extend): Implement new third argument, defaulted to
nil. Switch from chk_grow_vec to the more specific chk_wrealloc,
which simplifies the code.
* lib.h (string_extend): Declaration updated.
* parser.y (litchars): Pass t as last argument of
string_extend since we know syntactically that these
reductions finalize the string.
(restlitchar): Pass nil as the last argument of string_extend,
since we know syntactically that it isn't the last.
* regex.c (scan_until_common): Pass nil for new argument of
string_extend.
* txr.1: Documented.
Diffstat (limited to 'y.tab.c.shipped')
-rw-r--r-- | y.tab.c.shipped | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/y.tab.c.shipped b/y.tab.c.shipped index 34fc7b4b..c0721d96 100644 --- a/y.tab.c.shipped +++ b/y.tab.c.shipped @@ -6656,7 +6656,7 @@ yyreduce: /* Line 1806 of yacc.c */ #line 1436 "parser.y" { val ch = mkstring(one, chr((yyvsp[(1) - (2)].chr))); - (yyval.val) = string_extend(ch, (yyvsp[(2) - (2)].val)); } + (yyval.val) = string_extend(ch, (yyvsp[(2) - (2)].val), t); } break; case 430: @@ -6670,7 +6670,7 @@ yyreduce: /* Line 1806 of yacc.c */ #line 1439 "parser.y" - { (yyval.val) = string_extend(string_own((yyvsp[(1) - (2)].lexeme)), (yyvsp[(2) - (2)].val)); } + { (yyval.val) = string_extend(string_own((yyvsp[(1) - (2)].lexeme)), (yyvsp[(2) - (2)].val), t); } break; case 432: @@ -6684,7 +6684,7 @@ yyreduce: /* Line 1806 of yacc.c */ #line 1443 "parser.y" - { (yyval.val) = string_extend((yyvsp[(1) - (2)].val), chr((yyvsp[(2) - (2)].chr))); } + { (yyval.val) = string_extend((yyvsp[(1) - (2)].val), chr((yyvsp[(2) - (2)].chr)), nil); } break; case 434: @@ -6698,7 +6698,7 @@ yyreduce: /* Line 1806 of yacc.c */ #line 1445 "parser.y" - { (yyval.val) = string_extend((yyvsp[(1) - (2)].val), string_own((yyvsp[(2) - (2)].lexeme))); } + { (yyval.val) = string_extend((yyvsp[(1) - (2)].val), string_own((yyvsp[(2) - (2)].lexeme)), nil); } break; case 436: |