Skip to content

[ENH]: Parser errors should mention that commands do not exist #26732

Closed

Description

@mathstuf

Problem

I recently hit a parser error after upgrading matplotlib from 3.4.2 to 3.7.2 in our build:

\sum_{i=0}^\infty x_i * \frac{3}{4} \binom{3}{4} \stackrel{3}{4} * \sqrt[3]{x}
                                                 ^
ParseFatalException: Expected token, found '\'  (at char 49), (line:1, col:50)

After digging through a few rabbit holes (e.g., reverting from pyparsing 3.1.x to 3.0.9), it turns out that stackrel had been deprecated all the way back in 3.1.0.

Proposed solution

It would be nice if, instead of an error like this, it says something like 'stackrel is not a recognized command". Even better would be to have the stackrel deprecation bring up a warning/error at this point.

Activity

  1. ksunden commented on Sep 11, 2023

    @ksunden
    Member

    This is a result of a change to pyparsing that I'm pretty sure we have largely fixed, though it did incur changes in both mpl and pyparsing.

    The happy path always worked, just there are some combinations that get less helpful error messages like this.

    On main I get:

    ParseFatalException: Unknown symbol: \stackrel, found '\'  (at char 49), (line:1, col:50)
    

    xref:

    This will be fixed with 3.7.3 (when released), though also requires pyparsing !=3.1.0 for the error message. We decided not to enforce that restriction for install since working code continued to work, but did add some xfails to our test suite with the affected combinations.

    Since this is fixed on main/the release branch, I will close this

  2. mathstuf commented on Sep 11, 2023

    @mathstuf
    Author

    Thanks for the info. Can this get a 3.7.3 milestone too so that it gets tracked for others searching?

  3. added this to the v3.7.3 milestone on Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions