openmopac / mopac

Molecular Orbital PACkage
http://openmopac.net
GNU Lesser General Public License v3.0
115 stars 31 forks source link

Keywords in strings #133

Closed godotalgorithm closed 1 year ago

godotalgorithm commented 1 year ago

The keyword line can include strings such as filenames. The parser presently can be confused by keywords that incidentally appear in strings - some of the parsing successfully ignores them, but other parsing steps will erroneously confuse them with actual, intended keywords if they appear before the actual keyword.

This bug has a high priority, but it isn't easy to fix as keyword-line parsing occurs in a very large number of places throughout the source code. One possible solution is to replace most uses of the Fortran index function with a custom version that ignores substrings inside quotes or some functional equivalent of this.

godotalgorithm commented 1 year ago

Various small adjustments to the input parser recently have resolved the most common instances of this problem. This should be practically resolved, unless new edge cases are reported in the future.