ref: 991cbcce97527e74ca3751dd04b89e393420549c
parent: 0d97744d81dc8cc56990b3ee366506826beaf2f0
author: Werner Lemberg <[email protected]>
date: Sun Jan 5 08:24:56 EST 2014
[autofit] Minor fixes for `afblue.pl'. * src/tools/afblue.pl (aux_name): Don't use `reverse'. <Handling #endif>: Use proper indentation for generated `#else'. * src/autofit/afblue.h: Regenerated.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2014-01-05 Werner Lemberg <[email protected]>
+
+ [autofit] Minor fixes for `afblue.pl'.
+
+ * src/tools/afblue.pl (aux_name): Don't use `reverse'.
+ <Handling #endif>: Use proper indentation for generated `#else'.
+
+ * src/autofit/afblue.h: Regenerated.
+
2014-01-04 Werner Lemberg <[email protected]>
[autofit] Fix Indic scripts.
--- a/src/autofit/afblue.h
+++ b/src/autofit/afblue.h
@@ -103,13 +103,13 @@
AF_BLUE_STRING_CJK_LEFT_UNFILL = af_blue_1_1_1 + 77,
AF_BLUE_STRING_CJK_RIGHT_FILL = af_blue_1_1_1 + 153,
AF_BLUE_STRING_CJK_RIGHT_UNFILL = af_blue_1_1_1 + 229,
- af_blue_1_2_1 = af_blue_1_1_1 + 304,
+ af_blue_1_1_2 = af_blue_1_1_1 + 304,
#else
- af_blue_1_2_1 = af_blue_1_1_1 + 0,
+ af_blue_1_1_2 = af_blue_1_1_1 + 0,
#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
- af_blue_1_2 = af_blue_1_2_1 + 0,
+ af_blue_1_2 = af_blue_1_1_2 + 0,
#else
- af_blue_1_2 = af_blue_1_2_1 + 0,
+ af_blue_1_2 = af_blue_1_1_2 + 0,
#endif /* AF_CONFIG_OPTION_CJK */
@@ -162,13 +162,13 @@
AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0,
af_blue_2_1_1 = af_blue_2_1 + 4,
#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
- af_blue_2_2_1 = af_blue_2_1_1 + 4,
+ af_blue_2_1_2 = af_blue_2_1_1 + 4,
#else
- af_blue_2_2_1 = af_blue_2_1_1 + 0,
+ af_blue_2_1_2 = af_blue_2_1_1 + 0,
#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
- af_blue_2_2 = af_blue_2_2_1 + 1,
+ af_blue_2_2 = af_blue_2_1_2 + 1,
#else
- af_blue_2_2 = af_blue_2_2_1 + 0,
+ af_blue_2_2 = af_blue_2_1_2 + 0,
#endif /* AF_CONFIG_OPTION_CJK */
--- a/src/tools/afblue.pl
+++ b/src/tools/afblue.pl
@@ -194,7 +194,7 @@
sub aux_name
{
- return "af_blue_" . $num_sections. "_" . join('_', reverse @name_stack);
+ return "af_blue_" . $num_sections. "_" . join('_', @name_stack);
}
@@ -210,7 +210,7 @@
sub enum_val_string
{
- # Build string which holds code to save the current offset in an
+ # Build string that holds code to save the current offset in an
# enumeration element.
my $aux = shift;
@@ -288,7 +288,7 @@
{
# Having preprocessor conditionals complicates the computation of
# correct offset values. We have to introduce auxiliary enumeration
- # elements with the name `af_blue_<s>_<n1>_<n2>_...' which store
+ # elements with the name `af_blue_<s>_<n1>_<n2>_...' that store
# offsets to be used in conditional clauses. `<s>' is the number of
# sections seen so far, `<n1>' is the number of `#if' and `#endif'
# conditionals seen so far in the topmost level, `<n2>' the number of
@@ -344,7 +344,7 @@
$curr_offset = 0;
}
- elsif (/ ^ \# \s* endif /x)
+ elsif (/ ^ (\# \s*) endif /x)
{
my $prev_else = pop @else_stack;
Die("unbalanced #endif") unless defined($prev_else);
@@ -356,8 +356,9 @@
# necessary to have correct offsets.
if (!$prev_else)
{
+ # Use amount of whitespace from `endif'.
push @{$diversions{$curr_enum}}, enum_val_string(aux_name())
- . "#else\n";
+ . $1 . "else\n";
$curr_offset = 0;
}