Skip to content

Navigation Menu

Sign in
Sign up

add python parsing capabilities - #37

Open
celinaLind wants to merge 3 commits into
CoderAgent:main from
celinaLind:main
Open

add python parsing capabilities #37
celinaLind wants to merge 3 commits into
CoderAgent:main from
celinaLind:main

Conversation

@celinaLind

@celinaLind celinaLind commented Nov 24, 2024
edited
Loading

Copy link
Copy Markdown

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /