summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/bibtexperllibs/BibTeX
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-08-22 22:47:03 +0000
committerKarl Berry <karl@freefriends.org>2023-08-22 22:47:03 +0000
commit7fe2dd1bb261efa665741bac67d6ebae115d3574 (patch)
treee12b476ca60d59cf60d6768dc15327d43d90f764 /Master/texmf-dist/scripts/bibtexperllibs/BibTeX
parente0bf38f1b4d6bf91efdc23fda9b3b3433cd650a7 (diff)
bibtexperllibs (23aug23)
git-svn-id: svn://tug.org/texlive/trunk@68024 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/bibtexperllibs/BibTeX')
-rw-r--r--Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser.pm12
-rw-r--r--Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Author.pm37
-rw-r--r--Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Entry.pm9
3 files changed, 39 insertions, 19 deletions
diff --git a/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser.pm b/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser.pm
index 2eac696a049..2897d8495d7 100644
--- a/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser.pm
+++ b/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser.pm
@@ -1,6 +1,6 @@
package BibTeX::Parser;
{
- $BibTeX::Parser::VERSION = '1.02';
+ $BibTeX::Parser::VERSION = '1.04';
}
# ABSTRACT: A pure perl BibTeX parser
use warnings;
@@ -9,7 +9,7 @@ use strict;
use BibTeX::Parser::Entry;
-my $re_namechar = qr/[a-zA-Z0-9\!\$\&\*\+\-\.\/\:\;\<\>\?\[\]\^\_\`\|]/o;
+my $re_namechar = qr/[a-zA-Z0-9\!\$\&\*\+\-\.\/\:\;\<\>\?\[\]\^\_\`\|\']/o;
my $re_name = qr/$re_namechar+/o;
@@ -50,6 +50,7 @@ sub _parse_next {
until (/@/m) {
my $line = $self->{fh}->getline;
return 0 unless defined $line;
+ $line =~ s/^%.*$//;
$_ .= $line;
}
@@ -345,17 +346,18 @@ L<BibTeX::Parser::Author>
=head1 VERSION
-version 1.02
+version 1.04
=head1 AUTHOR
Gerhard Gossen <gerhard.gossen@googlemail.com> and
-Boris Veytsman <boris@varphi.com>
+Boris Veytsman <boris@varphi.com> and
+Karl Berry <karl@freefriends.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2013-2016 by Gerhard Gossen and Boris Veytsman
+This software is copyright (c) 2013-2023 by Gerhard Gossen and Boris Veytsman and Karl Berry.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Author.pm b/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Author.pm
index 7d5274d1d70..a35e2073a68 100644
--- a/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Author.pm
+++ b/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Author.pm
@@ -1,6 +1,6 @@
package BibTeX::Parser::Author;
{
- $BibTeX::Parser::Author::VERSION = '1.02';
+ $BibTeX::Parser::Author::VERSION = '1.04';
}
use warnings;
@@ -258,15 +258,31 @@ sub _get_single_author_from_tokens {
-
+# The goal is to return a name in form
+# von Last, Jr, First
+# where any of the parts except Last may be empty.
+#
sub to_string {
my $self = shift;
- if ($self->jr) {
- return ($self->von ? $self->von . " " : '') . " " . $self->last . ", " . $self->jr . ", " . $self->first;
- } else {
- return ($self->von ? $self->von . " " : '') . $self->last . ($self->first ? ", " . $self->first : '');
- }
+ my $last = $self->last; # assume always present
+ my $first = $self->first ? (", " . $self->first) : ''; # ", first"
+ my $von = $self->von ? ($self->von . " ") : ''; # "von "
+ my $jr = $self->jr ? (", " . $self->jr ) : ''; # ", jr"
+ #
+ my $ret = "${von}${last}${jr}${first}";
+ #warn "returning name: $ret\n";
+ return $ret;
+
+# original code, which introduced a spurious space with a von part.
+# https://github.com/borisveytsman/crossrefware/issues/11
+#
+# if ($self->jr) {
+# return () . " " . $self->last . ", " . $self->jr . ", " . $self->first;
+# } else {
+# return ($self->von ? $self->von . " " : '') . $self->last . ($self->first ? ", " . $self->first : '');
+# }
+#
}
@@ -393,17 +409,18 @@ the following token is not: C<{von}>
=head1 VERSION
-version 1.02
+version 1.04
=head1 AUTHOR
Gerhard Gossen <gerhard.gossen@googlemail.com> and
-Boris Veytsman <boris@varphi.com>
+Boris Veytsman <boris@varphi.com> and
+Karl Berry <karl@freefriends.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2013--2016 by Gerhard Gossen and Boris Veytsman.
+This software is copyright (c) 2013--2023 by Gerhard Gossen and Boris Veytsman and Karl Berry.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Entry.pm b/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Entry.pm
index 7f5c721e345..d0bc9cc80b1 100644
--- a/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Entry.pm
+++ b/Master/texmf-dist/scripts/bibtexperllibs/BibTeX/Parser/Entry.pm
@@ -1,6 +1,6 @@
package BibTeX::Parser::Entry;
{
- $BibTeX::Parser::Entry::VERSION = '1.02';
+ $BibTeX::Parser::Entry::VERSION = '1.04';
}
use warnings;
@@ -416,16 +416,17 @@ Can take values 'Uppercase' (the default), 'Lowercase' or 'Titlecase'
=head1 VERSION
-version 1.02
+version 1.04
=head1 AUTHOR
Gerhard Gossen <gerhard.gossen@googlemail.com> and
-Boris Veytsman <boris@varphi.com>
+Boris Veytsman <boris@varphi.com> and
+Karl Berry <karl@freefriends.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2013-2016 by Gerhard Gossen and Boris Veytsman
+This software is copyright (c) 2013-2023 by Gerhard Gossen and Boris Veytsman and Karl Berry
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.