You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importlibcstascstcode="""from math import (nan as NaN)"""compile(code, "<string>", "exec") # (no error)cst.parse_module(code) # ParserSyntaxError: Syntax Error @ 4:9.# Internal error: There must be at least one space before 'as'.
While this is really weird code, it does actually happen in the wild, e.g. here in the regex package.
The text was updated successfully, but these errors were encountered:
#566 contains the new parser that works with this input. After merging that, you'll need to set the following environment variable LIBCST_PARSER_TYPE=native in whatever process that runs libcst to turn on the new parser (this will be the default in a future release)
I'm aiming for a month or two. The parser is fairly stable at this point, and it's used to parse hundreds of millions of lines of Python at Meta. It's mostly a question of feature-completeness, the biggest gap being support for different versions of the Python grammar (these fields).
While this is really weird code, it does actually happen in the wild, e.g. here in the
regex
package.The text was updated successfully, but these errors were encountered: