Skip to content

Conversation

@celinaLind
Copy link

@celinaLind celinaLind commented Nov 24, 2024

This pull request includes significant updates to the src/context/language/python-parser.ts file, focusing on implementing methods for parsing Python files and determining the largest enclosing context. The changes introduce a new parser, a custom listener for AST traversal, and robust error handling.

Key changes include:

Implementation of Python Parsing Methods:

  • Introduction of Python3Parser: Added import and instantiation of Python3Parser to parse Python files.
  • Implementation of findEnclosingContext Method: Created a method to find the largest enclosing context in a Python file by traversing the AST with a custom listener.
  • Implementation of dryRun Method: Added a method to validate Python files by parsing them and handling any parsing errors.

Helper Functions:

  • processNode Function: Added a helper function to process each AST node and determine if it is the largest enclosing context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant