borisveytsman / BibTeXPerlLibs

BibTeX parser and other modules by Gerhard Gossen
0 stars 2 forks source link

Bug with parsing of pre #3

Open pauloney opened 6 years ago

pauloney commented 6 years ago

It is really nice that BibTeX::Parser is now is looking at the "comments" section in between records in a BibTeX file.... but may be it is going too far ... The following examples shows a file that is a completely valid BibTeX file, but it is not parsable with BibTeX::Parser.

The problem here are matched braces that span and entire record within the scope of the brace. More nefarious examples can be construed with unmatched braces -- all of them perfect valid BibTeX files.

In this example just reading (and writing back) disapears with one of the records.

%%%%

\bibitem{AKKLT}
M. Anderson, A. Katsuda, Y. Kurylev, M. Lassas, M. Taylor: Boundary regularity for the Ricci equation, Geometric Convergence, and Gel'fand's Inverse Boundary Problem,  {\sl  Inventiones Math.} 158 (2004), 261--321.

@article {AKKLT,
     MRKEY = {MR2096795},
    AUTHOR = {Anderson, Michael and Katsuda, Atsushi and Kurylev, Yaroslav
              and Lassas, Matti and Taylor, Michael},
     TITLE = {Boundary regularity for the {R}icci equation, geometric
              convergence, and {G}elfand's inverse boundary problem},
   JOURNAL = {Invent. Math.},
    VOLUME = {158},
      YEAR = {2004},
     PAGES = {261--321},
}
%%%%

\bibitem{Bao}
G. Bao, H. Zhang: Sensitivity analysis of an inverse problem for the wave equation with caustics. {\sl  J. Amer. Math. Soc.} 27 (2014),
  953--981.
%\generalizations{
@article {Bao,
     MRKEY = {MR3230816},
    AUTHOR = {Bao, Gang and Zhang, Hai},
     TITLE = {Sensitivity analysis of an inverse problem for the wave
              equation with caustics},
   JOURNAL = {J. Amer. Math. Soc.},
    VOLUME = {27},
      YEAR = {2014},
     PAGES = {953--981},
}
%%%%

\bibitem {Bardos}
C. Bardos, G. Lebeau, J. Rauch: Sharp sufficient conditions for the observation, control, and stabilization of waves from the boundary.
{\sl SIAM J. Control Optim.} 30 (1992),  1024--1065.

@article {Bardos,
     MRKEY = {MR1178650},
    AUTHOR = {Bardos, Claude and Lebeau, Gilles and Rauch, Jeffrey},
     TITLE = {Sharp sufficient conditions for the observation, control, and
              stabilization of waves from the boundary},
   JOURNAL = {SIAM J. Control Optim.},
    VOLUME = {30},
      YEAR = {1992},
     PAGES = {1024--1065},
}
%%%%

\bibitem{Hoskins}
P. Hoskins:
Principles of ultrasound elastography,
{\sl Ultrasound} (20) 2012, 8--15.
%%http://ult.sagepub.com/content/20/1/8.abstract
}

@article{Hoskins,
  title={Principles of ultrasound elastography},
  author={Hoskins, Peter R},
  journal={Ultrasound},
  volume={20},
  pages={8--15},
  year={2012},
  publisher={SAGE Publications Sage UK: London, England},
}

%%%%

\bibitem {HKM}
T. Hughes, T. Kato, J. Marsden:
Well-posed quasi-linear second-order hyperbolic systems with applications to nonlinear elastodynamics and general relativity.
{\sl  Arch. Rational Mech. Anal.} 63 (1976), 273--294.

@article {HKM,
     MRKEY = {MR0420024},
    AUTHOR = {Hughes, Thomas J. R. and Kato, Tosio and Marsden, Jerrold E.},
     TITLE = {Well-posed quasi-linear second-order hyperbolic systems with
              applications to nonlinear elastodynamics and general
              relativity},
   JOURNAL = {Arch. Rational Mech. Anal.},
    VOLUME = {63},
      YEAR = {1976},
     PAGES = {273--294 (1977)},
}
borisveytsman commented 6 years ago

It is very difficult to make the system parse files with unbalanced braces within pre...

pauloney commented 5 years ago

Boris, the point here is that it gets trown off by the comment:

%\generalizations{

that is located in between Records 1 and 2. It is essentially finding (and processing material that is contained in between two records -- while it should not. It should:

  1. Locate an @entry{...} and its matching curly braces
  2. Process the stuff that contained in between these braces only
  3. Ignore and the treat the rest as a blob

That should do and process it properly.