texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

texinfo/tp/Texinfo/Convert Text.pm


From: Patrice Dumas
Subject: texinfo/tp/Texinfo/Convert Text.pm
Date: Thu, 29 Sep 2011 16:37:22 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/09/29 16:37:22

Modified files:
        tp/Texinfo/Convert: Text.pm 

Log message:
        Simplify unicode_accents a bit.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Text.pm?cvsroot=texinfo&r1=1.66&r2=1.67

Patches:
Index: Text.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Text.pm,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -b -r1.66 -r1.67
--- Text.pm     29 Sep 2011 16:23:34 -0000      1.66
+++ Text.pm     29 Sep 2011 16:37:21 -0000      1.67
@@ -331,21 +331,18 @@
   my $in_upper_case = shift;
   my ($result, $stack) = _find_innermost_accent($current,
           'utf-8', $in_upper_case);
-  my @stack_accent_commands = reverse(@$stack);
 
-  while (@stack_accent_commands) {
-    my $accent_command = shift @stack_accent_commands;
+  while (@$stack) {
     my $formatted_result
-     = Texinfo::Convert::Unicode::unicode_accent($result, $accent_command);
-    if (!defined($formatted_result)) {
-      unshift @stack_accent_commands, $accent_command;
-    } else {
+     = Texinfo::Convert::Unicode::unicode_accent($result, $stack->[-1]);
+    last if (!defined($formatted_result));
+
       $result = $formatted_result;
-    }
+    pop @$stack;
   }
   $result = uc ($result) if ($in_upper_case);
-  while (@stack_accent_commands) {
-    my $accent_command = shift @stack_accent_commands;
+  while (@$stack) {
+    my $accent_command = pop @$stack;
     $result = &$format_accent($result, $accent_command, $in_upper_case);
   }
   return $result;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]