From 257b26d141a880ee3804e447fbcc9827cf2655fe Mon Sep 17 00:00:00 2001 From: acli Date: Fri, 20 Feb 2004 07:09:47 +0000 Subject: [PATCH] Partially allow combination of several TEXT tokens. It seems that this gives better strings. (Always allowing combinations gives havoc, we currently avoid this by allowing combination only if the first and last tokens are both TEXT.) --- misc/translator/TmplTokenizer.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/misc/translator/TmplTokenizer.pm b/misc/translator/TmplTokenizer.pm index 384dfb2604..81ddd48de5 100644 --- a/misc/translator/TmplTokenizer.pm +++ b/misc/translator/TmplTokenizer.pm @@ -490,10 +490,10 @@ sub next_token { $it = TmplToken->new($string, TmplTokenType::TEXT_PARAMETRIZED, $it->line_number, $it->pathname); $it->set_form( $form ); $it->set_children( @structure ); -# } elsif ($nonblank_text_p) { -# # Combine the strings -# my $string = join('', map { $_->string } @structure); -# ; + } elsif ($nonblank_text_p && $structure[0]->type == TmplTokenType::TEXT && $structure[$#structure]->type == TmplTokenType::TEXT) { + # Combine the strings + my $string = join('', map { $_->string } @structure); + $it = TmplToken->new($string, TmplTokenType::TEXT, $it->line_number, $it->pathname);; } else { # Requeue the tokens thus seen for re-emitting for (;;) { -- 2.20.1