Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

fix(Parsing): Handle more AST nodes; log don't raise #6

Closed
nokome opened this issue Dec 16, 2019 · 0 comments
Closed

fix(Parsing): Handle more AST nodes; log don't raise #6

nokome opened this issue Dec 16, 2019 · 0 comments
Assignees

Comments

@nokome
Copy link
Member

nokome commented Dec 16, 2019

Currently, there are some AST nodes that are passed (ie. not parsed :) and all others not handled throw TypeError:

elif isinstance(statement, (ast.ClassDef, ast.Num, ast.Str, ast.Pass)):
pass
else:
raise TypeError('Unrecognized statement: {}'.format(statement))

While trying to compile someipynb files from the wild I got exceptions thrown for:

  • NameConstant
  • UnaryOp
  • Lambda

I think all of these probably need to be handled. Also, I wonder if it would be better to log instead of to raise for unhandled nodes e.g.

        elif isinstance(statement, (ast.ClassDef, ast.Num, ast.Str, ast.Pass)):
            pass
        else:
            LOGGER.warning(...)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants