Skip to content

Python tree-sitter to CAST Porting: Compound Conditionals#861

Draft
titomeister wants to merge 8 commits intomainfrom
ferra/python_ts_swap
Draft

Python tree-sitter to CAST Porting: Compound Conditionals#861
titomeister wants to merge 8 commits intomainfrom
ferra/python_ts_swap

Conversation

@titomeister
Copy link
Contributor

@titomeister titomeister commented Mar 22, 2024

This PR addresses a missing feature of the python tree-sitter to CAST generation. This was discovered as work to swap the CAST generation was being done. Compound conditionals involve conditional statements that include the keywords and and or.

NOTE: This was originally a PR to merge in the swapping of PyAST2CAST to tree-sitter, but has been repurposed to merge these changes in.

Summary of Changes

  • Adds support to python/ts2cast.py for generating compound conditional CAST.
  • Introduces a new helper method for fetching a tree-sitter from a specified set of tree-sitter types.
  • Adds test script test_compound_conditional.py to ensure consistency of the newly supported idioms.

Related issues

Resolves #875

@titomeister titomeister changed the title PyAST to tree-switter Code2FN Swap PR Python tree-sitter to CAST Porting: Compound Conditionals Apr 3, 2024
@titomeister titomeister marked this pull request as ready for review April 3, 2024 20:44
@titomeister titomeister marked this pull request as draft April 5, 2024 15:23
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.

Python tree sitter: Compound Conditionals

2 participants