[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp TODO Texinfo/Parser.pm Texinfo/Conve...
From: |
Patrice Dumas |
Subject: |
texinfo/tp TODO Texinfo/Parser.pm Texinfo/Conve... |
Date: |
Sun, 27 Mar 2011 17:12:48 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/03/27 17:12:48
Modified files:
tp : TODO
tp/Texinfo : Parser.pm
tp/Texinfo/Convert: Converter.pm Plaintext.pm
Log message:
Put expand_today in the common converter coden, not in the parser.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.115&r2=1.116
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.230&r2=1.231
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Converter.pm?cvsroot=texinfo&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.128&r2=1.129
Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -b -r1.115 -r1.116
--- TODO 27 Mar 2011 08:24:54 -0000 1.115
+++ TODO 27 Mar 2011 17:12:46 -0000 1.116
@@ -41,6 +41,7 @@
#Â this means no formatting
$commands_args{'^'} = [[[]];
+$commands_formatting{'normal' |Â 'string' |Â 'preformatted'}
Handle
Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.230
retrieving revision 1.231
diff -u -b -r1.230 -r1.231
--- Texinfo/Parser.pm 27 Mar 2011 14:20:23 -0000 1.230
+++ Texinfo/Parser.pm 27 Mar 2011 17:12:47 -0000 1.231
@@ -73,7 +73,6 @@
global_commands_information
global_informations
expand_verbatiminclude
- expand_today
gdt
) ] );
@@ -4385,6 +4384,7 @@
return $args;
}
+#Â left here because it uses _locate_include_file
sub expand_verbatiminclude($$)
{
my $self = shift;
@@ -4418,47 +4418,6 @@
return $verbatiminclude;
}
-my @MONTH_NAMES =
- (
- 'January', 'February', 'March', 'April', 'May',
- 'June', 'July', 'August', 'September', 'October',
- 'November', 'December'
- );
-
-# This is not used as code, but used to mark months as strings to be
-# translated
-if (0) {
- my $self;
- my @mark_month_for_translation = (
- $self->gdt('January'),
- $self->gdt('February'),
- $self->gdt('March'),
- $self->gdt('April'),
- $self->gdt('May'),
- $self->gdt('June'),
- $self->gdt('July'),
- $self->gdt('August'),
- $self->gdt('September'),
- $self->gdt('October'),
- $self->gdt('November'),
- $self->gdt('December')
- );
-}
-
-sub expand_today($)
-{
- my $self = shift;
- if ($self->{'TEST'}) {
- return {'text' => 'a sunny day'};
- }
- my($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)
- = localtime(time);
- $year += ($year < 70) ? 2000 : 1900;
- return $self->gdt('{month} {day}, {year}',
- { 'month' => $self->gdt($MONTH_NAMES[$mon]),
- 'day' => $mday, 'year' => $year });
-}
-
1;
__END__
# Below is stub documentation.
Index: Texinfo/Convert/Converter.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Converter.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- Texinfo/Convert/Converter.pm 27 Mar 2011 08:24:55 -0000 1.3
+++ Texinfo/Convert/Converter.pm 27 Mar 2011 17:12:47 -0000 1.4
@@ -243,6 +243,47 @@
}
}
+my @MONTH_NAMES =
+ (
+ 'January', 'February', 'March', 'April', 'May',
+ 'June', 'July', 'August', 'September', 'October',
+ 'November', 'December'
+ );
+
+# This is not used as code, but used to mark months as strings to be
+# translated
+if (0) {
+ my $self;
+ my @mark_month_for_translation = (
+ $self->gdt('January'),
+ $self->gdt('February'),
+ $self->gdt('March'),
+ $self->gdt('April'),
+ $self->gdt('May'),
+ $self->gdt('June'),
+ $self->gdt('July'),
+ $self->gdt('August'),
+ $self->gdt('September'),
+ $self->gdt('October'),
+ $self->gdt('November'),
+ $self->gdt('December')
+ );
+}
+
+sub expand_today($)
+{
+ my $self = shift;
+ if ($self->{'TEST'}) {
+ return {'text' => 'a sunny day'};
+ }
+ my($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)
+ = localtime(time);
+ $year += ($year < 70) ? 2000 : 1900;
+ return $self->gdt('{month} {day}, {year}',
+ { 'month' => $self->gdt($MONTH_NAMES[$mon]),
+ 'day' => $mday, 'year' => $year });
+}
+
sub xml_protect_text($$)
{
my $self = shift;
@@ -255,5 +296,72 @@
}
+#Â 'today' is not set here.
+our %default_xml_commands_formatting;
+$default_xml_commands_formatting{'normal'} = {
+ 'TeX' => 'TeX',
+ 'LaTeX' => 'LaTeX',
+# pertusus: unknown by makeinfo, not in texinfo manual (@* is the right thing)
+# 'br', '<br>', # paragraph break
+ 'bullet' => '•',
+# #'copyright' => '(C)',
+ 'copyright' => '©',
+ 'registeredsymbol' => '®',
+ 'dots' => '…',
+ 'enddots' => '...',
+ 'equiv' => '≡',
+# FIXME i18n
+ 'error' => 'error-->',
+ 'expansion' => '→',
+ 'arrow' => '→',
+ 'click' => '→',
+ 'minus' => '-',
+ 'point' => '∗',
+ 'print' => '-|',
+ 'result' => '⇒',
+ 'aa' => 'å',
+ 'AA' => 'Å',
+ 'ae' => 'æ',
+ 'oe' => 'œ', #pertusus: also œ. œ
not in html 3.2
+ 'AE' => 'Æ',
+ 'OE' => 'Œ', #pertusus: also Œ. Œ
not in html 3.2
+ 'o' => 'ø',
+ 'O' => 'Ø',
+ 'ss' => 'ß',
+ 'DH' => 'Ð',
+ 'dh' => 'ð',
+ 'TH' => 'Þ',
+ 'th' => 'þ',
+ 'l' => 'ł',
+ 'L' => 'Ł',
+ 'exclamdown' => '¡',
+ 'questiondown' => '¿',
+ 'pounds' => '£',
+ 'ordf' => 'ª',
+ 'ordm' => 'º',
+ 'comma' => ',',
+ 'euro' => '€',
+ 'geq' => '≥',
+ 'leq' => '≤',
+ 'tie' => ' ',
+ 'textdegree' => '°',
+ 'quotedblleft' => '“',
+ 'quotedblright' => '”',
+ 'quoteleft' => '‘',
+ 'quoteright' => '’',
+ 'quotedblbase' => '„',
+ 'quotesinglbase' => '‚',
+ 'guillemetleft' => '«',
+ 'guillemetright' => '»',
+ 'guillemotleft' => '«',
+ 'guillemotright' => '»',
+ 'guilsinglleft' => '‹',
+ 'guilsinglright' => '›',
+};
+
+foreach my $text_no_brace_commands
(keys(%Texinfo::Convert::Text::text_no_brace_commands)) {
+ $default_xml_commands_formatting{'normal'}->{$text_no_brace_commands}
+ = $Texinfo::Convert::Text::text_no_brace_commands{$text_no_brace_commands};
+}
1;
Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -b -r1.128 -r1.129
--- Texinfo/Convert/Plaintext.pm 27 Mar 2011 14:20:24 -0000 1.128
+++ Texinfo/Convert/Plaintext.pm 27 Mar 2011 17:12:47 -0000 1.129
@@ -1203,7 +1203,7 @@
}
return $result;
} elsif ($root->{'cmdname'} eq 'today') {
- my $today = Texinfo::Parser::expand_today($self);
+ my $today = $self->expand_today();
unshift @{$self->{'current_contents'}->[-1]}, $today;
} elsif (defined($text_brace_no_arg_commands{$root->{'cmdname'}})) {
my $text = Texinfo::Convert::Text::brace_no_arg_command($root,