-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python tree-sitter to CAST porting: Classes (#850)
This PR introduces support for generating CAST for Python Classes. In CAST the translation for these is RecordDef. This is part of the ongoing effort of porting over the Python to CAST generation to use tree-sitter instead of the Python AST. ### Summary of Changes - Adds support in python/ts2cast.py for generating RecordDef CAST nodes, which represent Python classes. - Adds test script test_record_cast.py for maintaining consistency with basic examples. - Adds a handler of CAST Name nodes for when they're being used in Operators or returns (get_operand_node). This is to make sure the correct CAST node is being used in these at all times. - Very minor code cleanup. Resolves #805 --------- Co-authored-by: Vincent Raymond <vincent@lum.ai> 1e379f3
- Loading branch information
1 parent
6c73026
commit ca046e6
Showing
1,756 changed files
with
226,623 additions
and
224,703 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
205 changes: 193 additions & 12 deletions
205
api/python/skema/program_analysis/CAST/python/ts2cast.html
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,090 changes: 1,090 additions & 0 deletions
1,090
api/python/skema/program_analysis/tests/test_record_cast.html
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.