diff options
author | Karl Berry <karl@freefriends.org> | 2015-10-25 22:57:55 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-10-25 22:57:55 +0000 |
commit | 4a9225ab54c95efafd2534812e2f53697fd0f6d9 (patch) | |
tree | 0ba9a25e89367efb21e41640876facce6b60d08c /Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser | |
parent | 4a0798e9378fdb2de85f56e1ef1d46653f86cc69 (diff) |
bibtexperllibs (25oct15)
git-svn-id: svn://tug.org/texlive/trunk@38711 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser')
34 files changed, 1569 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Changes b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Changes new file mode 100644 index 00000000000..6aed797f987 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Changes @@ -0,0 +1,49 @@ +Revision history for BibTeX-Parser + +0.65 2013-09-03 21:04:43 + Add links in documentation. + +0.64 2012-03-10 22:23:50 + Remove a warning about undefined value. + +0.63 2011-03-15 23:08:18 + Parse files with errors (no keys, spaces in wrong positions). Bug #66325 + +0.62 2010-10-15 08:52:53 + Declare Test::More minimum version with done_testing + +0.61 2010-07-19 16:37:49 + Add methods $entry->cleaned_author / cleaned_editor + +0.6 2010-07-19 14:43:15 + Add method $entry->cleaned_field( 'name' ) + Add prerequisite LaTeX::ToUnicode >= 0.02 + +0.5 2010-07-06 13:17:45 Europe/Berlin + Do not attempt to clean up returned values + Author names with braces are split correctly + +0.4 2010-02-09 + Parsing of quoted author names (e.g. "{Foo and Bar, Inc.}") + +0.3.2 2009-07-26 + Removed dependency on Text::Balanced + +0.3.1 2009-07-19 + No changes, removed huge test file from dist + +0.3 2009-07-18 + Better parsing of author names, + new Method B::P::Entry->raw_bibtex + Removed Module::Install from package + +0.21 2009-01-23 + Fixed errors in synopsis. + +0.2 2008-12-30 + First public release. + +0.1 2008-03-14 + First version, internal + + diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/LICENSE b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/LICENSE new file mode 100644 index 00000000000..169f805923d --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/LICENSE @@ -0,0 +1,379 @@ +This software is copyright (c) 2013 by Gerhard Gossen. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +Terms of the Perl programming language system itself + +a) the GNU General Public License as published by the Free + Software Foundation; either version 1, or (at your option) any + later version, or +b) the "Artistic License" + +--- The GNU General Public License, Version 1, February 1989 --- + +This software is Copyright (c) 2013 by Gerhard Gossen. + +This is free software, licensed under: + + The GNU General Public License, Version 1, February 1989 + + GNU GENERAL PUBLIC LICENSE + Version 1, February 1989 + + Copyright (C) 1989 Free Software Foundation, Inc. + 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The license agreements of most software companies try to keep users +at the mercy of those companies. By contrast, our General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. The +General Public License applies to the Free Software Foundation's +software and to any other program whose authors commit to using it. +You can use it for your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Specifically, the General Public License is designed to make +sure that you have the freedom to give away or sell copies of free +software, that you receive source code or can get it if you want it, +that you can change the software or use pieces of it in new free +programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of a such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must tell them their rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any program or other work which +contains a notice placed by the copyright holder saying it may be +distributed under the terms of this General Public License. The +"Program", below, refers to any such program or work, and a "work based +on the Program" means either the Program or any work containing the +Program or a portion of it, either verbatim or with modifications. Each +licensee is addressed as "you". + + 1. You may copy and distribute verbatim copies of the Program's source +code as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this +General Public License and to the absence of any warranty; and give any +other recipients of the Program a copy of this General Public License +along with the Program. You may charge a fee for the physical act of +transferring a copy. + + 2. You may modify your copy or copies of the Program or any portion of +it, and copy and distribute such modifications under the terms of Paragraph +1 above, provided that you also do the following: + + a) cause the modified files to carry prominent notices stating that + you changed the files and the date of any change; and + + b) cause the whole of any work that you distribute or publish, that + in whole or in part contains the Program or any part thereof, either + with or without modifications, to be licensed at no charge to all + third parties under the terms of this General Public License (except + that you may choose to grant warranty protection to some or all + third parties, at your option). + + c) If the modified program normally reads commands interactively when + run, you must cause it, when started running for such interactive use + in the simplest and most usual way, to print or display an + announcement including an appropriate copyright notice and a notice + that there is no warranty (or else, saying that you provide a + warranty) and that users may redistribute the program under these + conditions, and telling the user how to view a copy of this General + Public License. + + d) You may charge a fee for the physical act of transferring a + copy, and you may at your option offer warranty protection in + exchange for a fee. + +Mere aggregation of another independent work with the Program (or its +derivative) on a volume of a storage or distribution medium does not bring +the other work under the scope of these terms. + + 3. You may copy and distribute the Program (or a portion or derivative of +it, under Paragraph 2) in object code or executable form under the terms of +Paragraphs 1 and 2 above provided that you also do one of the following: + + a) accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of + Paragraphs 1 and 2 above; or, + + b) accompany it with a written offer, valid for at least three + years, to give any third party free (except for a nominal charge + for the cost of distribution) a complete machine-readable copy of the + corresponding source code, to be distributed under the terms of + Paragraphs 1 and 2 above; or, + + c) accompany it with the information you received as to where the + corresponding source code may be obtained. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form alone.) + +Source code for a work means the preferred form of the work for making +modifications to it. For an executable file, complete source code means +all the source code for all modules it contains; but, as a special +exception, it need not include source code for modules which are standard +libraries that accompany the operating system on which the executable +file runs, or for standard header files or definitions files that +accompany that operating system. + + 4. You may not copy, modify, sublicense, distribute or transfer the +Program except as expressly provided under this General Public License. +Any attempt otherwise to copy, modify, sublicense, distribute or transfer +the Program is void, and will automatically terminate your rights to use +the Program under this License. However, parties who have received +copies, or rights to use copies, from you under this General Public +License will not have their licenses terminated so long as such parties +remain in full compliance. + + 5. By copying, distributing or modifying the Program (or any work based +on the Program) you indicate your acceptance of this license to do so, +and all its terms and conditions. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the original +licensor to copy, distribute or modify the Program subject to these +terms and conditions. You may not impose any further restrictions on the +recipients' exercise of the rights granted herein. + + 7. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of the license which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +the license, you may choose any version ever published by the Free Software +Foundation. + + 8. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to humanity, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively convey +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) 19yy <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 1, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19xx name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, the +commands you use may be called something other than `show w' and `show +c'; they could even be mouse-clicks or menu items--whatever suits your +program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + program `Gnomovision' (a program to direct compilers to make passes + at assemblers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +That's all there is to it! + + +--- The Artistic License 1.0 --- + +This software is Copyright (c) 2013 by Gerhard Gossen. + +This is free software, licensed under: + + The Artistic License 1.0 + +The Artistic License + +Preamble + +The intent of this document is to state the conditions under which a Package +may be copied, such that the Copyright Holder maintains some semblance of +artistic control over the development of the package, while giving the users of +the package the right to use and distribute the Package in a more-or-less +customary fashion, plus the right to make reasonable modifications. + +Definitions: + + - "Package" refers to the collection of files distributed by the Copyright + Holder, and derivatives of that collection of files created through + textual modification. + - "Standard Version" refers to such a Package if it has not been modified, + or has been modified in accordance with the wishes of the Copyright + Holder. + - "Copyright Holder" is whoever is named in the copyright or copyrights for + the package. + - "You" is you, if you're thinking about copying or distributing this Package. + - "Reasonable copying fee" is whatever you can justify on the basis of media + cost, duplication charges, time of people involved, and so on. (You will + not be required to justify it to the Copyright Holder, but only to the + computing community at large as a market that must bear the fee.) + - "Freely Available" means that no fee is charged for the item itself, though + there may be fees involved in handling the item. It also means that + recipients of the item may redistribute it under the same conditions they + received it. + +1. You may make and give away verbatim copies of the source form of the +Standard Version of this Package without restriction, provided that you +duplicate all of the original copyright notices and associated disclaimers. + +2. You may apply bug fixes, portability fixes and other modifications derived +from the Public Domain or from the Copyright Holder. A Package modified in such +a way shall still be considered the Standard Version. + +3. You may otherwise modify your copy of this Package in any way, provided that +you insert a prominent notice in each changed file stating how and when you +changed that file, and provided that you do at least ONE of the following: + + a) place your modifications in the Public Domain or otherwise make them + Freely Available, such as by posting said modifications to Usenet or an + equivalent medium, or placing the modifications on a major archive site + such as ftp.uu.net, or by allowing the Copyright Holder to include your + modifications in the Standard Version of the Package. + + b) use the modified Package only within your corporation or organization. + + c) rename any non-standard executables so the names do not conflict with + standard executables, which must also be provided, and provide a separate + manual page for each non-standard executable that clearly documents how it + differs from the Standard Version. + + d) make other distribution arrangements with the Copyright Holder. + +4. You may distribute the programs of this Package in object code or executable +form, provided that you do at least ONE of the following: + + a) distribute a Standard Version of the executables and library files, + together with instructions (in the manual page or equivalent) on where to + get the Standard Version. + + b) accompany the distribution with the machine-readable source of the Package + with your modifications. + + c) accompany any non-standard executables with their corresponding Standard + Version executables, giving the non-standard executables non-standard + names, and clearly documenting the differences in manual pages (or + equivalent), together with instructions on where to get the Standard + Version. + + d) make other distribution arrangements with the Copyright Holder. + +5. You may charge a reasonable copying fee for any distribution of this +Package. You may charge any fee you choose for support of this Package. You +may not charge a fee for this Package itself. However, you may distribute this +Package in aggregate with other (possibly commercial) programs as part of a +larger (possibly commercial) software distribution provided that you do not +advertise this Package as a product of your own. + +6. The scripts and library files supplied as input to or produced as output +from the programs of this Package do not automatically fall under the copyright +of this Package, but belong to whomever generated them, and may be sold +commercially, and may be aggregated with this Package. + +7. C or perl subroutines supplied by you and linked into this Package shall not +be considered part of this Package. + +8. The name of the Copyright Holder may not be used to endorse or promote +products derived from this software without specific prior written permission. + +9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +The End + diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/MANIFEST b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/MANIFEST new file mode 100644 index 00000000000..b9b800a52e7 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/MANIFEST @@ -0,0 +1,36 @@ +Changes +LICENSE +MANIFEST +META.yml +Makefile.PL +README +dist.ini +lib/BibTeX/Parser.pm +lib/BibTeX/Parser/Author.pm +lib/BibTeX/Parser/Entry.pm +notes +t/00-load.t +t/01-parse.t +t/02-parse_string.t +t/03-parse_entry.t +t/04-entry.t +t/05-author.t +t/06-parse_complex.t +t/07-parse_englishbib.t +t/08-parse_large.t +t/09-complex.t +t/10-funnyname.t +t/bibs/01.bib +t/bibs/06.bib +t/bibs/09-complex.bib +t/bibs/10-funnyname.bib +t/bibs/endnote.txt +t/bibs/engineering_village.txt +t/bibs/english.bib +t/bibs/mathscinet.txt +t/bug66325.t +t/cleaned_field.t +t/pod-coverage.t +t/pod.t +t/release-pod-coverage.t +t/release-pod-syntax.t diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/META.yml b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/META.yml new file mode 100644 index 00000000000..c8bb09663ed --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/META.yml @@ -0,0 +1,22 @@ +--- +abstract: 'A pure perl BibTeX parser' +author: + - 'Gerhard Gossen <gerhard.gossen@googlemail.com>' +build_requires: + Test::More: 0.88 +configure_requires: + ExtUtils::MakeMaker: 6.30 +dynamic_config: 0 +generated_by: 'Dist::Zilla version 4.300037, CPAN::Meta::Converter version 2.120921' +license: perl +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 +name: BibTeX-Parser +requires: + File::Spec: 0 + IO::File: 0 + IO::String: 0 + LaTeX::ToUnicode: 0.02 + Test::More: 0 +version: 0.65 diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Makefile.PL b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Makefile.PL new file mode 100644 index 00000000000..bd0f7c0d16b --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Makefile.PL @@ -0,0 +1,71 @@ + +use strict; +use warnings; + + + +use ExtUtils::MakeMaker 6.30; + + + +my %WriteMakefileArgs = ( + "ABSTRACT" => "A pure perl BibTeX parser", + "AUTHOR" => "Gerhard Gossen <gerhard.gossen\@googlemail.com>", + "BUILD_REQUIRES" => {}, + "CONFIGURE_REQUIRES" => { + "ExtUtils::MakeMaker" => "6.30" + }, + "DISTNAME" => "BibTeX-Parser", + "EXE_FILES" => [], + "LICENSE" => "perl", + "NAME" => "BibTeX::Parser", + "PREREQ_PM" => { + "File::Spec" => 0, + "IO::File" => 0, + "IO::String" => 0, + "LaTeX::ToUnicode" => "0.02", + "Test::More" => 0 + }, + "TEST_REQUIRES" => { + "Test::More" => "0.88" + }, + "VERSION" => "0.65", + "test" => { + "TESTS" => "t/*.t" + } +); + + +unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { + my $tr = delete $WriteMakefileArgs{TEST_REQUIRES}; + my $br = $WriteMakefileArgs{BUILD_REQUIRES}; + for my $mod ( keys %$tr ) { + if ( exists $br->{$mod} ) { + $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod}; + } + else { + $br->{$mod} = $tr->{$mod}; + } + } +} + +unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { + my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; + my $pp = $WriteMakefileArgs{PREREQ_PM}; + for my $mod ( keys %$br ) { + if ( exists $pp->{$mod} ) { + $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; + } + else { + $pp->{$mod} = $br->{$mod}; + } + } +} + +delete $WriteMakefileArgs{CONFIGURE_REQUIRES} + unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; + +WriteMakefile(%WriteMakefileArgs); + + + diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Makefile.TDS b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Makefile.TDS new file mode 100644 index 00000000000..7072d1f20d0 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Makefile.TDS @@ -0,0 +1,25 @@ +# +# This is Makefile for TDS-compliant TeX distributions +# Written by Boris Veytsman, boris@varphi.com +# +# This file is in public domain +# +PREFIX = /usr/local + +LIBDIR = $(PREFIX)/scripts/bibtexperllibs + +DOCDIR = $(PREFIX)/doc/bibtex/bibtexperllibs + +all: + + + +install: + mkdir -p $(LIBDIR) + cp -r lib/* $(LIBDIR) + mkdir -p $(DOCDIR) + cp -r man/man3/* $(DOCDIR) + +clean: + +distclean: clean diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/README b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/README new file mode 100644 index 00000000000..016740c5516 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/README @@ -0,0 +1,13 @@ + + +This archive contains the distribution BibTeX-Parser, +version 0.65: + + A pure perl BibTeX parser + +This software is copyright (c) 2013 by Gerhard Gossen. + +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/source/support/bibtexperllibs/BibTeX-Parser/dist.ini b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/dist.ini new file mode 100644 index 00000000000..60d9924ad7a --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/dist.ini @@ -0,0 +1,28 @@ +name = BibTeX-Parser +version = 0.65 +author = Gerhard Gossen <gerhard.gossen@googlemail.com> +license = Perl_5 +copyright_holder = Gerhard Gossen + +[@Classic] + +[NextRelease] +format = %-7v %{yyyy-MM-dd HH:mm:ss}d + +[PodWeaver] + +[Prereqs] +Test::More = 0 +IO::String = 0 +IO::File = 0 +File::Spec = 0 +LaTeX::ToUnicode = 0.02 + +[Prereqs / TestRequires] +Test::More = 0.88 ; for done_testing + +[PruneFiles] +filenames = t/bibs/java.bib + +[Repository] +[@Git] diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/notes b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/notes new file mode 100644 index 00000000000..5e41df40905 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/notes @@ -0,0 +1,26 @@ +from Biblio::Catalog::BibTeX : + +sub tex2html { + my $latex = shift; + return "" unless defined($latex); + + for ($latex) { + s/\\textit\{([^{]+)\}/<i>$1<\/i>/g; + s/\\textbf\{([^{]+)\}/<b>$1<\/b>/g; + s/\\texttt\{([^{]+)\}/<tt>$1<\/tt>/g; + s/\\emph{([^{]+)}/<i>$1<\/i>/g; + s/\\item\b/<li>/g; + s/\\_/_/g; + s/\\mbox{([^}]+)}/$1/g; + s/{\\it\s([^}]+)}/<i>$1<\/i>/g; + s/\\LaTeX/LaTeX/g; + s/\\begin{itemize}/<ul>/g; + s/\\begin{quote}/<blockquote><i>/g; + s/\\end{quote}/<\/i><\/blockquote>/g; + s/\\end{itemize}/<\/ul>/g; + s/[}{]//g; + } + + return $latex; +} + diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/00-load.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/00-load.t new file mode 100644 index 00000000000..9862dc79865 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/00-load.t @@ -0,0 +1,11 @@ +#!/usr/bin/perl -w + +use Test::More tests => 3; + +BEGIN { + use_ok( 'BibTeX::Parser' ); + use_ok( 'BibTeX::Parser::Author' ); + use_ok( 'BibTeX::Parser::Entry' ); +} + +diag( "Testing BibTeX::Parser $BibTeX::Parser::VERSION, Perl $], $^X" ); diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/01-parse.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/01-parse.t new file mode 100644 index 00000000000..70e298d4be2 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/01-parse.t @@ -0,0 +1,36 @@ +#!/usr/bin/perl -w + +use Test::More tests => 11; + +use BibTeX::Parser; +use IO::File; + +use constant ENTRIES => 1; + +my $fh = new IO::File "t/bibs/01.bib", "r" ; + +if (defined $fh) { + my $parser = new BibTeX::Parser $fh; + + isa_ok($parser, "BibTeX::Parser"); + + my $count = 0; + + while (my $entry = $parser->next) { + $count++; + isa_ok($entry, "BibTeX::Parser::Entry"); + is($entry->key, "key01", "key"); + is($entry->type, "ARTICLE", "type"); + ok($entry->parse_ok, "parse_ok"); + is($entry->field("year"), 1950, "field"); + is($entry->field("month"), "January~1", "field"); + + my @authors = $entry->author; + is(scalar @authors, 2, "#authors"); + isa_ok($authors[0], "BibTeX::Parser::Author"); + is("$authors[0]", "Duck, Donald", "correct author"); + } + + is($count, ENTRIES, "number of entries"); +} + diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/02-parse_string.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/02-parse_string.t new file mode 100644 index 00000000000..90b87eba14c --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/02-parse_string.t @@ -0,0 +1,39 @@ +#!/usr/bin/perl -w + +use Test::More tests => 7; + +use BibTeX::Parser; + +my %strings = (); + +$_ = 1234; +parse_ok("parse digit string"); + +$_ = '"simple double quoted string"'; +parse_is("simple double quoted string", "- double quoted string"); + +$_ = '"double quotes { with embeded } brackets"'; +parse_is("double quotes { with embeded } brackets", "- with embeded brackets"); + +$_ = '"string 1 " # "string 2"'; +parse_is("string 1 string 2", "- concatenation"); + +$strings{test} = "string"; +$strings{other} = "text"; + +$_ = "test"; +parse_is("string", "- string variable"); + +$_ = "test # other"; +parse_is("stringtext", "- concatenation of string variables"); + +$_ = '"M{\"{u}}nchen"'; +parse_is('M{\"{u}}nchen', "- escaped quote"); + +sub parse_ok { + is(BibTeX::Parser::_parse_string(\%strings), $_, shift); +} + +sub parse_is { + is(BibTeX::Parser::_parse_string(\%strings), shift, shift); +} diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/03-parse_entry.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/03-parse_entry.t new file mode 100644 index 00000000000..92597173a94 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/03-parse_entry.t @@ -0,0 +1,61 @@ +#!/usr/bin/perl -w + +use Test::More tests => 2; + +use IO::String; +use BibTeX::Parser; + +{ + my $string = q|@article{lin1973, + author = "Shen Lin and Brian W. Kernighan", + title = "An Effective Heuristic Algorithm for the Travelling-Salesman Problem", + journal = "Operations Research", + volume = 21, + year = 1973, + pages = "498--516" + }|; + my $fh = IO::String->new($string); + + my $parser = BibTeX::Parser->new( $fh ); + +#my @result = BibTeX::Parser->_parse($fh); + + my $entry = $parser->next; + + is_deeply($entry, {_type => 'ARTICLE', _key => 'lin1973', author => "Shen Lin and Brian W. Kernighan", + title => "An Effective Heuristic Algorithm for the Travelling-Salesman Problem", + journal => "Operations Research", + volume => 21, + year => 1973, + pages => "498--516", _parse_ok => 1, + _raw => $string}, "parse \@ARTICLE"); + +} +{ + my $string = q|@InProceedings{Herper:2001:MVS, + author = {Henry Herper}, + title = {{M}odellierung von {S}ystemen: ein + {A}pplikationsgebiet im {I}nformatikunterricht}, + booktitle = {Informatikunterricht und Medienbildung, INFOS 2001 + (9. Fachtagung Informatik und Schule, Paderborn + 17.-20- September 2001) -- Tagungsband}, + editor = {Reinhard Keil-Slavik and Johannes Magenheim}, + year = {2001}, +}|; + my $fh = IO::String->new($string); + + my $parser = BibTeX::Parser->new( $fh ); + + my $entry = $parser->next; + + is_deeply($entry, { + _type => 'INPROCEEDINGS', + _key => 'Herper:2001:MVS', + author => "Henry Herper", + title => "{M}odellierung von {S}ystemen: ein {A}pplikationsgebiet im {I}nformatikunterricht", + booktitle => "Informatikunterricht und Medienbildung, INFOS 2001 (9. Fachtagung Informatik und Schule, Paderborn 17.-20- September 2001) -- Tagungsband", + editor => "Reinhard Keil-Slavik and Johannes Magenheim", + year => 2001, + _parse_ok => 1, + _raw => $string}, "parse \@ARTICLE"); +} diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/04-entry.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/04-entry.t new file mode 100644 index 00000000000..3ca9797011d --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/04-entry.t @@ -0,0 +1,42 @@ +#!/usr/bin/perl -w + +use Test::More tests => 13; + +use BibTeX::Parser::Entry; + + +my $entry = new BibTeX::Parser::Entry("type", "key", 1, {title => "title"}); + +isa_ok($entry, "BibTeX::Parser::Entry"); + +is($entry->type, "TYPE", "Entry::type get"); + +$entry->type("newtype"); + +is($entry->type, "NEWTYPE", "Entry::type set"); + +is($entry->key, "key", "Entry::key get"); + +$entry->key("newkey"); + +is($entry->key, "newkey", "Entry::key set"); + +is($entry->field("title"), "title", "Entry::field with new"); + +$entry->field("title" => "newtitle"); + +is($entry->field("title"), "newtitle", "Entry::field overwrite"); + +$entry->field("year" => 2008); + +is($entry->field("year"), 2008, "Entry::field set"); + +is($entry->field("pages"), undef, "Entry::field undef on unknown value"); + +is($entry->fieldlist, 2, "size of fieldlist"); + +ok($entry->has("title"), "Entry::has true on known value"); + +ok($entry->has("year"), "Entry::has true on known value"); + +ok( ! $entry->has("pages"), "Entry::has false on unknown value"); diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/05-author.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/05-author.t new file mode 100644 index 00000000000..cae7824099e --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/05-author.t @@ -0,0 +1,68 @@ +#!/usr/bin/perl + +use Test::More; + +use BibTeX::Parser::Author; + +# Names from Mittelbach, Goossens: The LaTeX Companion, Second Edition. +my %names = ( + "Donald E. Knuth" => ["Donald E.", undef, "Knuth", undef], + "John Chris Smith" => ["John Chris", undef, "Smith", undef], + "Smith, John Chris" => ["John Chris", undef, "Smith", undef], + "Thomas von Neumann" => ["Thomas", "von", "Neumann", undef], + "von Neumann, Thomas" => ["Thomas", "von", "Neumann", undef], + "Lopez Fernandez, Miguel" => ["Miguel", undef, "Lopez Fernandez", undef], + "Pierre de la Porte" => ["Pierre", "de la", "Porte", undef], + "Smith, Jr., Robert" => ["Robert", undef, "Smith", "Jr."], + "von Smith, Jr., Robert" => ["Robert", "von", "Smith", "Jr."], + "Johannes Martinus Albertus van de Groene Heide" => ["Johannes Martinus Albertus", "van de", "Groene Heide", undef], + "Maria-Victoria Delgrande" => ["Maria-Victoria", undef, "Delgrande", undef], + "Anonymous" => [undef, undef, "Anonymous", undef], + "von Neumann" => [undef, "von", "Neumann", undef], + "N. Tetteh-Lartey" => ["N.", undef, "Tetteh-Lartey", undef], + "von Tetteh-Lartey, N." => ["N.", "von", "Tetteh-Lartey", undef], + "von Tetteh-Lartey, Jr., N." => ["N.", "von", "Tetteh-Lartey", "Jr."], + "" => [undef, undef, undef, undef], + " " => [undef, undef, undef, undef], + "\n" => [undef, undef, undef, undef], + "al." => [undef, undef, "al.", undef], + "et. al." => [undef, undef, "et. al.", undef], + "O'Malley, A." => ["A.", undef, "O'Malley", undef], + "A. O'Malley" => ["A.", undef, "O'Malley", undef], + "Arthur O'Malley" => ["Arthur", undef, "O'Malley", undef], + "O'Malley, Arthur" => ["Arthur", undef, "O'Malley", undef], + 'L.M. M\"uller' => ["L.M.", undef, 'M\"uller', undef], + 'M\"uller, L.M.' => ["L.M.", undef, 'M\"uller', undef], + 'L.M. M"uller' => ["L.M.", undef, 'M"uller', undef], + 'M"uller, L.M.' => ["L.M.", undef, 'M"uller', undef], + 'van Beethoven, Ludwig' => ["Ludwig", "van", "Beethoven", undef ], + '{Barnes and Noble, Inc.}' => [undef, undef, 'Barnes and Noble, Inc.', undef], + "Ludwigg {van Beethoven}" => ["Ludwigg", undef, "van Beethoven", undef], + '{van Beethoven}, Ludwig' => ["Ludwig", undef, "van Beethoven", undef ], +); + +plan tests => (keys(%names) * 6 + 5); + +my $author = new BibTeX::Parser::Author; + +isa_ok($author, "BibTeX::Parser::Author", "Correct type"); + +is($author->first, undef, "Initial state 'first'"); +is($author->von, undef, "Initial state 'von'"); +is($author->last, undef, "Initial state 'last'"); +is($author->jr, undef, "Initial state 'jr'"); + + +foreach my $name (keys %names) { + + is_deeply([BibTeX::Parser::Author->split($name)], $names{$name}, $name =~ /\w/ ? $name : "whitespace name: '$name'" ); + + $author = new BibTeX::Parser::Author $name; + + isa_ok($author, "BibTeX::Parser::Author"); + + is($author->first, $names{$name}->[0] ); + is($author->von, $names{$name}->[1]); + is($author->last, $names{$name}->[2]); + is($author->jr, $names{$name}->[3]); +} diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/06-parse_complex.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/06-parse_complex.t new file mode 100644 index 00000000000..95a5848a717 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/06-parse_complex.t @@ -0,0 +1,46 @@ +#!/usr/bin/perl + +use Test::More tests => 19; + +use strict; +use IO::File; +use BibTeX::Parser; + +my $fh = IO::File->new("t/bibs/06.bib"); + +my $parser = new BibTeX::Parser $fh; + + +my $entry = $parser->next; + +isa_ok($entry, 'BibTeX::Parser::Entry', "Correct type"); +ok($entry->parse_ok, "Entry parsed correctly"); +is($entry->type, "ARTICLE", "BibTeX type is correct"); +is($entry->field("title"), "Paper title", "Title attribute"); +is($entry->field("year"), 2008); +is($entry->field("month"), "August", "Month expansion"); +is($entry->key, 'key1', "key"); + +my @authors = $entry->author; +is(scalar @authors, 2, "number of authors correct"); +my $author = shift @authors; +is_deeply( + [$author->first, $author->von, $author->last, $author->jr], + ['Gerhard', undef, 'Gossen', undef], "author correct"); + +$author = shift @authors; +is_deeply( + [$author->first, $author->von, $author->last, $author->jr], + ['Ludwig', 'van', 'Beethoven', undef], "author correct"); + +$entry = $parser->next; +isa_ok($entry, 'BibTeX::Parser::Entry', "Correct type"); +ok($entry->parse_ok, "Entry parsed correctly"); +is($entry->type, "BOOK", "BibTeX type is correct"); +is($entry->field("title"), "Book title", "Title attribute"); +is($entry->field("year"), 2008); +is($entry->field("month"), "August", "Month expansion"); +is($entry->key, 'key2', "key"); +@authors = $entry->author; +is(scalar @authors, 1, "number of authors"); +is(scalar $entry->editor, 0, "number of editors"); diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/07-parse_englishbib.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/07-parse_englishbib.t new file mode 100644 index 00000000000..3348a55248f --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/07-parse_englishbib.t @@ -0,0 +1,42 @@ +#!/usr/bin/perl + +use Test::More tests => 8; + +use strict; +use IO::File; +use BibTeX::Parser; + + +my $fh = IO::File->new("t/bibs/english.bib"); + +my $parser = new BibTeX::Parser $fh; + +my $count = 0; + +my $entry = $parser->next; + +is($entry->parse_ok, 0, "Ignore spurious @ before parenthesis"); + +$entry = $parser->next; + +is($entry->parse_ok, 0, "Ignore spurious @ in email address"); + +$entry = $parser->next; + +is(scalar $entry->author, 1, "# authors"); +#@BOOK{Carey, +# AUTHOR="G. V. Carey", +is($entry->field("title"), "Mind the Stop: A Brief Guide to Punctuation", "title"); +is($entry->field("publisher"), "Penguin", "publisher"); +is($entry->field("year"), 1958, "year"); +$count++; + +while ($entry = $parser->next) { + $count++; + if ($count == 8) { + is( scalar $entry->author, 4, 'Last entry has 4 authors'); + } +} + + +is($count, 8, "number of entries"); diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/08-parse_large.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/08-parse_large.t new file mode 100644 index 00000000000..5375d9a0620 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/08-parse_large.t @@ -0,0 +1,24 @@ +#!/usr/bin/perl -w + +use Test::More skip_all => "Performance test", tests => 1; + +use IO::File; +use BibTeX::Parser; + +my $starttime = time; + +my $fh = IO::File->new('t/bibs/java.bib'); #cl-nlp8x.bib'); + +my $parser = new BibTeX::Parser $fh; +my $entries = 0; + +#my @result = BibTeX::Parser->_parse($fh); + +while(my $entry = $parser->next) { + $entries++; +} + +my $parsetime = time - $starttime; + +warn "Parsed $entries entries in $parsetime seconds"; +ok(1, "Parsed $entries entries in $parsetime seconds"); diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/09-complex.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/09-complex.t new file mode 100644 index 00000000000..eff8f751b29 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/09-complex.t @@ -0,0 +1,37 @@ +#!/usr/bin/perl -w + +use Test::More tests => 1; + +use IO::File; +use BibTeX::Parser; + + +my $fh = IO::File->new('t/bibs/09-complex.bib'); + +my $parser = new BibTeX::Parser $fh; + +#my @result = BibTeX::Parser->_parse($fh); + +my $entry = $parser->next; + +is_deeply($entry, {_type => 'ARTICLE', _key => 'Ahrenberg88', + author => "L. Ahrenberg and A. Jonsson", + title => "An interactive system for tagging dialogues", + journal => 'Literary \& Linguistic Computing', + volume => 3, + number => "2", + pages => "66--70", + year => "1988", + keywords => "conver", + _parse_ok => 1, + _raw => '@Article{Ahrenberg88, + author = "L. Ahrenberg and A. Jonsson", + title = "An interactive system for tagging dialogues", + journal = "Literary \& Linguistic Computing", + volume = "3", + number = "2", + pages = "66--70", + year = "1988", + keywords = "conver", +}' + }, "parse \@ARTICLE"); diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/10-funnyname.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/10-funnyname.t new file mode 100644 index 00000000000..1d21a2ea093 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/10-funnyname.t @@ -0,0 +1,56 @@ +#!/usr/bin/perl -w + +use Test::More tests => 11; + +use IO::File; +use BibTeX::Parser; + +my $fh = IO::File->new('t/bibs/10-funnyname.bib'); + +my $parser = BibTeX::Parser->new($fh); + +#my @result = BibTeX::Parser->_parse($fh); + +my $entry = $parser->next; + +is_deeply( + $entry, + { + _type => 'ARTICLE', + _key => 'testkey', + author => 'A. Bar and L.M. M\"uller', + title => 'foo', + journal => 'journal', + volume => 1, + number => 1, + pages => 1, + year => 2008, + _parse_ok => 1, + _raw => '@article{testkey, + year = {2008}, + title = "foo", + author = {A. Bar and L.M. M\"uller}, + journal = {journal}, + volume = {1}, + number = {1}, + pages = {1}, +}', + }, + "parse \@ARTICLE" +); + +my @authors = $entry->author; + +pass("->author didn't loop forever"); +ok(@authors == 2, "Two authors"); + +is($authors[0]->first, 'A.', "A1 first name"); +is($authors[0]->last, 'Bar', "A1 last name"); +ok(!$authors[0]->von, "A1 no 'von'"); +ok(!$authors[0]->jr, "A1 no 'jr'"); + +is($authors[1]->first, 'L.M.', "A2 first name"); +is($authors[1]->last, 'M\"uller', "A2 last name"); +ok(!$authors[1]->von, "A2 no 'von'"); +ok(!$authors[1]->jr, "A2 no 'jr'"); + diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/01.bib b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/01.bib new file mode 100644 index 00000000000..eb12c43c200 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/01.bib @@ -0,0 +1,6 @@ +@ARTICLE{key01, + year = 1950, + author = {Donald Duck and Someone Else}, + title = {Title text}, + month = jan # "~1" +} diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/06.bib b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/06.bib new file mode 100644 index 00000000000..242ae662cc6 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/06.bib @@ -0,0 +1,27 @@ +this is text, which is ignored by bibtex. + +@PREAMBLE{ + This is only used for BibTeX files used in LaTeX documents +} + +@Comment{ + Comments are ignored too. +} + +@ARTICLE{key1, + author = {Gerhard Gossen and Ludwig van Beethoven}, + title = "Paper title", + year = 2008, + month = aug, +} + +@STRING{ gerhard = "Gerhard" } + +@STRING{ gossen = "Gossen" } + +@BOOK{ key2, + author = gerhard # " " # gossen, + title = "Book title", + year = "2008", + month = aug, +} diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/09-complex.bib b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/09-complex.bib new file mode 100644 index 00000000000..cacf3227230 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/09-complex.bib @@ -0,0 +1,11 @@ +@Article{Ahrenberg88, + author = "L. Ahrenberg and A. Jonsson", + title = "An interactive system for tagging dialogues", + journal = "Literary \& Linguistic Computing", + volume = "3", + number = "2", + pages = "66--70", + year = "1988", + keywords = "conver", +} + diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/10-funnyname.bib b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/10-funnyname.bib new file mode 100644 index 00000000000..050fbc05348 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/10-funnyname.bib @@ -0,0 +1,10 @@ +@article{testkey, + year = {2008}, + title = "foo", + author = {A. Bar and L.M. M\"uller}, + journal = {journal}, + volume = {1}, + number = {1}, + pages = {1}, +} + diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/endnote.txt b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/endnote.txt new file mode 100644 index 00000000000..b15f5f2e0de --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/endnote.txt @@ -0,0 +1,6 @@ +@article{ + volume = {59}, + number = {6}, + year = {1999} +} + diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/engineering_village.txt b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/engineering_village.txt new file mode 100644 index 00000000000..256f5a853da --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/engineering_village.txt @@ -0,0 +1,24 @@ +@inproceedings{1997493856789 , +language = {English}, +year = {1997}, +} + + +@inproceedings{1998043944915 , +language = {English}, +year = {1997}, +} + + +@article{2003137419501 , +language = {English}, +year = {2002}, +} + + +@inproceedings{2002367072517 , +language = {English}, +year = {2002}, +} + + diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/english.bib b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/english.bib new file mode 100644 index 00000000000..6893e1e4111 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/english.bib @@ -0,0 +1,55 @@ +$Id: english.bib,v 1.1.1.1 2015/10/25 01:25:20 boris Exp $ + +Please notify Adrian F Clark <alien@uk.ac.essex.ese> of any additions +or corrections to this list. + +@BOOK{Carey, + AUTHOR="G. V. Carey", + TITLE="Mind the Stop: A Brief Guide to Punctuation", + PUBLISHER="Penguin", YEAR="1958"} + +@BOOK{Cooper, + AUTHOR="Bruce M. Cooper", + TITLE="Writing Technical Reports", + PUBLISHER="Penguin", YEAR="1964"} + +@BOOK{Fowler-ModernEnglish, + AUTHOR="H. W. Fowler", + TITLE="[A Dictionary of] Modern {E}nglish Usage", + PUBLISHER="Oxford University Press", + EDITION="2", YEAR="1965"} + (but first published in 1926) + +@BOOK{Fowler-KingsEnglish, + AUTHOR="H. W. Fowler and F. G. Fowler", + TITLE="The {K}ing's {E}nglish", + PUBLISHER="Oxford University Press", + EDITION="3", YEAR="1931"} + (but first published in 1906) + +@BOOK{Gowers, + AUTHOR="Sir Ernest Gowers", + TITLE="The Complete Plain Words", + PUBLISHER="Penguin", YEAR="1954"} + (but first published by HMSO) + +@BOOK{Hart, + AUTHOR="Horace Hart", + TITLE="[Hart's] Rules for Compositors and Readers + [at the Oxford University Press]", + PUBLISHER="Oxford University Press", + EDITION="39", YEAR="1983"} + (but first published in 1893) + +@BOOK{Partridge, + AUTHOR="Eric Partridge", + TITLE="Use and Abuse: a Guide to Good {E}nglish", + PUBLISHER="Hamish Hamilton", + EDITION="4", YEAR="1970"} + (but first published in 1947) + +@BOOK{Quirk-CompGram, + AUTHOR="Randolph Quirk and Sydney Greenbaum and Geoffrey Leach and + Jan Svartnik", + TITLE="A Comprehensive Grammar of the {E}nglish Language", + PUBLISHER="Longman", YEAR="1985"} diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/mathscinet.txt b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/mathscinet.txt new file mode 100644 index 00000000000..d46bd244e28 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/mathscinet.txt @@ -0,0 +1,40 @@ +MathSciNet </mathscinet/index.html> + + * + Clipboard </mathscinet/clipboard.html> + * Home </mathscinet/index.html> + * Preferences </mathscinet/preferences.html> + * Help </mathscinet/help/headline_review_help_full.html> + * Support Mail </mathscinet/support_mail.html> + * Terms of Use </mathscinet/help/mathscinet_terms_of_use.html> + * University of Southampton + +@article {MR2254280, + VOLUME = {23}, + YEAR = {2006}, +} + + +@article {MR2254274, + VOLUME = {23}, + YEAR = {2006}, +} + + +@article {MR2248052, + VOLUME = {23}, + YEAR = {2006}, +} + + +*Matches:* 3 +Mirror Sites + + +© Copyright 2011, American Mathematical Society +<http://www.ams.org/ams/copyright.html> +Privacy Statement <http://www.ams.org/ams/privacy.html> +American Mathematical Society <http://www.ams.org> +American Mathematical Society +201 Charles Street +Providence, RI 02904-2294 diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bug66325.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bug66325.t new file mode 100644 index 00000000000..ac83b43aa97 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bug66325.t @@ -0,0 +1,71 @@ +#!/usr/bin/perl -w + +use Test::More; + +use BibTeX::Parser; +use IO::File; + +{ + my $fh = new IO::File "t/bibs/endnote.txt", "r" ; + + if (defined $fh) { + my $parser = new BibTeX::Parser $fh; + + while (my $entry = $parser->next) { + isa_ok($entry, "BibTeX::Parser::Entry"); + ok($entry->parse_ok, "parse_ok"); + is($entry->key, undef, "key"); + is($entry->type, "ARTICLE", "type"); + is($entry->field("year"), 1999, "field"); + is($entry->field("volume"), 59, "first field"); + } + } +} + +{ + my $fh = new IO::File "t/bibs/mathscinet.txt", "r" ; + my @keys = qw(MR2254280 MR2254274 MR2248052); + + if (defined $fh) { + my $parser = new BibTeX::Parser $fh; + my $count = 0; + + while (my $entry = $parser->next) { + isa_ok($entry, "BibTeX::Parser::Entry"); + ok($entry->parse_ok, "parse_ok"); + is($entry->key, $keys[$count], "key"); + is($entry->type, "ARTICLE", "type"); + is($entry->field("volume"), 23, "first field"); + is($entry->field("year"), 2006, "field"); + $count++; + } + + is($count, 3, "number of entries"); + } +} + +{ + my $fh = new IO::File "t/bibs/engineering_village.txt", "r" ; + + my @types = qw( inproceedings inproceedings article inproceedings ); + my @keys = qw( 1997493856789 1998043944915 2003137419501 2002367072517 ); + my @years = qw( 1997 1997 2002 2002 ); + + if (defined $fh) { + my $parser = new BibTeX::Parser $fh; + my $count = 0; + + while (my $entry = $parser->next) { + isa_ok($entry, "BibTeX::Parser::Entry"); + ok($entry->parse_ok, "parse_ok"); + is($entry->key, $keys[$count], "key"); + is($entry->type, uc $types[$count], "type"); + is($entry->field("language"), "English", "first field"); + is($entry->field("year"), $years[$count], "field"); + $count++; + } + + is($count, 4, "number of entries"); + } +} +done_testing; diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/cleaned_field.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/cleaned_field.t new file mode 100644 index 00000000000..33a38784cd7 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/cleaned_field.t @@ -0,0 +1,142 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use utf8; + +use Test::More; +use BibTeX::Parser::Entry; + +sub new_entry { + BibTeX::Parser::Entry->new( 'ARTICLE', 'Foo2010', 1, { @_ } ); +} +{ + my @german_tests = ( + [ '"a' => 'ä' ], + ['"`' => '„' ], + ["\"'" => '“' ], + ); + + foreach my $test ( @german_tests ) { + my $entry = new_entry( foo => $test->[0] ); + is( $entry->cleaned_field( 'foo', german => 1 ), $test->[1], "Convert $test->[0], german => 1" ); + } +} + +{ + binmode( DATA, ':utf8' ); + while (<DATA>) { + chomp; + my ( $tex, $result ) = split /\t/; + is( new_entry( foo => $tex )->cleaned_field( 'foo' ), $result, "Convert $tex" ); + } + close DATA; +} + +{ + my $entry_with_authors = new_entry( author => 'F{\"o}o Bar and B"ar, F.' ); + my @authors = $entry_with_authors->author; + is( scalar @authors, 2, "Number of authors is correct"); + is( $authors[0]->first, 'F{\"o}o', "non-cleaned version of first" ); + is( $authors[0]->last, 'Bar', "non-cleaned version of last" ); + + is( $authors[1]->first, 'F.', "non-cleaned version of first" ); + is( $authors[1]->last, 'B"ar', "non-cleaned version of last" ); + + my @clean_authors = $entry_with_authors->cleaned_author; + is( $clean_authors[0]->first, 'Föo', "cleaned version of first" ); + is( $clean_authors[0]->last, 'Bar', "cleaned version of last" ); + + is( $clean_authors[1]->first, 'F.', "cleaned version of first" ); + is( $clean_authors[1]->last, 'B"ar', "cleaned version of last" ); +} +done_testing; + +__DATA__ +\& & +{\`a} à +{\^a} â +{\~a} ã +{\'a} á +{\'{a}} á +{\"a} ä +{\`A} À +{\'A} Á +{\"A} Ä +{\aa} å +{\AA} Å +{\ae} æ +{\bf 12} 12 +{\'c} ć +{\cal P} P +{\c{c}} ç +{\c{C}} Ç +{\c{e}} ȩ +{\c{s}} ş +{\c{S}} Ş +{\c{t}} ţ +{\-d} d +{\`e} è +{\^e} ê +{\'e} é +{\"e} ë +{\'E} É +{\em bits} bits +{\H{o}} ő +{\`i} ì +{\^i} î +{\i} ı +{\`i} ì +{\'i} í +{\"i} ï +{\`\i} ì +{\'\i} í +{\"\i} ï +{\`{\i}} ì +{\'{\i}} í +{\"{\i}} ï +{\it Note} Note +{\k{e}} ę +{\l} ł +{\-l} l +{\log} log +{\~n} ñ +{\'n} ń +{\^o} ô +{\o} ø +{\'o} ó +{\"o} ö +{\"{o}} ö +{\'O} Ó +{\"O} Ö +{\"{O}} Ö +{\rm always} always +{\-s} s +{\'s} ś +{\sc JoiN} JoiN +{\sl bit\/ \bf 7} bit 7 +{\sl L'Informatique Nouvelle} L’Informatique Nouvelle +{\small and} and +{\ss} ß +{\TeX} TEX +{\TM} ™ +{\tt awk} awk +{\^u} û +{\'u} ú +{\"u} ü +{\"{u}} ü +{\'U} Ú +{\"U} Ü +{\u{a}} ă +{\u{g}} ğ +{\v{c}} č +{\v{C}} Č +{\v{e}} ě +{\v{n}} ň +{\v{r}} ř +{\v{s}} š +{\v{S}} Š +{\v{z}} ž +{\v{Z}} Ž +{\'y} ý +{\.{z}} ż diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/pod-coverage.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/pod-coverage.t new file mode 100644 index 00000000000..fc40a57c2a4 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/pod-coverage.t @@ -0,0 +1,18 @@ +use strict; +use warnings; +use Test::More; + +# Ensure a recent version of Test::Pod::Coverage +my $min_tpc = 1.08; +eval "use Test::Pod::Coverage $min_tpc"; +plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage" + if $@; + +# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version, +# but older versions don't recognize some common documentation styles +my $min_pc = 0.18; +eval "use Pod::Coverage $min_pc"; +plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" + if $@; + +all_pod_coverage_ok(); diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/pod.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/pod.t new file mode 100644 index 00000000000..e22a39b5244 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/pod.t @@ -0,0 +1,12 @@ +#!/usr/bin/perl -w + +use strict; +use warnings; +use Test::More; + +# Ensure a recent version of Test::Pod +my $min_tp = 1.22; +eval "use Test::Pod $min_tp"; +plan skip_all => "Test::Pod $min_tp required for testing POD" if $@; + +all_pod_files_ok(); diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/release-pod-coverage.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/release-pod-coverage.t new file mode 100644 index 00000000000..3a818499f0e --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/release-pod-coverage.t @@ -0,0 +1,21 @@ +#!perl + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + + +use Test::More; + +eval "use Test::Pod::Coverage 1.08"; +plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage" + if $@; + +eval "use Pod::Coverage::TrustPod"; +plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage" + if $@; + +all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/release-pod-syntax.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/release-pod-syntax.t new file mode 100644 index 00000000000..d46a9556946 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/release-pod-syntax.t @@ -0,0 +1,15 @@ +#!perl + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + +use Test::More; + +eval "use Test::Pod 1.41"; +plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; + +all_pod_files_ok(); |