Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python tree sitter: Imports #804

Closed
4 tasks done
Tracked by #489
titomeister opened this issue Feb 16, 2024 · 1 comment · Fixed by #826
Closed
4 tasks done
Tracked by #489

Python tree sitter: Imports #804

titomeister opened this issue Feb 16, 2024 · 1 comment · Fixed by #826
Assignees
Labels
Code2FN lang/Python Used for work related to Python (ex. frontend support)

Comments

@titomeister
Copy link
Contributor

titomeister commented Feb 16, 2024

As part of porting the PyAST2CAST generation to tree-sitter, we're porting all the features that we currently support piece-by-piece.

This issue is to track support for Imports. Add handling for imports for Python tree-sitter, and also create any appropriate unit tests.

Tasks

@github-project-automation github-project-automation bot moved this to TODO in skema Feb 16, 2024
@titomeister titomeister self-assigned this Feb 16, 2024
@titomeister titomeister added this to the [DARPA] Milestone 12 milestone Feb 16, 2024
@titomeister titomeister added Code2FN lang/Python Used for work related to Python (ex. frontend support) labels Feb 16, 2024
@titomeister titomeister moved this from TODO to In Progress in skema Feb 16, 2024
@titomeister
Copy link
Contributor Author

Update:

  • Have gotten initial generation for the imports, but needs some more looking over.
  • I realized that I need to do some initial support for attributes in order to fully support the imports. Will update the issue accordingly.

titomeister added a commit that referenced this issue Mar 4, 2024
This PR introduces support for generating CAST import statements. This
is using tree sitter, as part of the ongoing effort to port over the
Python AST to CAST generation to use tree-sitter.

### Summary of Changes

- Adds handlers to python/ts2cast.py to support CAST generation for
import statements.
- Adds basic CAST generation for the attribute idiom. In order to
support function calls from imports.
- Adds test script test_import_cast.py with unit tests to maintain
consistency.
- Added 'support' for yields and assert statements. The current
generation is to passthrough them, so nothing important gets generated
from these.

### Related issues
- 

Resolves #804

---------

Co-authored-by: Vincent Raymond <vincent@lum.ai>
@github-project-automation github-project-automation bot moved this from In Progress to Done in skema Mar 4, 2024
github-actions bot added a commit that referenced this issue Mar 4, 2024
This PR introduces support for generating CAST import statements. This
is using tree sitter, as part of the ongoing effort to port over the
Python AST to CAST generation to use tree-sitter.

### Summary of Changes

- Adds handlers to python/ts2cast.py to support CAST generation for
import statements.
- Adds basic CAST generation for the attribute idiom. In order to
support function calls from imports.
- Adds test script test_import_cast.py with unit tests to maintain
consistency.
- Added 'support' for yields and assert statements. The current
generation is to passthrough them, so nothing important gets generated
from these.

### Related issues
-

Resolves #804

---------

Co-authored-by: Vincent Raymond <vincent@lum.ai> 102dd72
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code2FN lang/Python Used for work related to Python (ex. frontend support)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant