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

Support Tree-sitter parsing of MATLAB conditional logic #593

Closed
jastier opened this issue Oct 24, 2023 · 0 comments
Closed

Support Tree-sitter parsing of MATLAB conditional logic #593

jastier opened this issue Oct 24, 2023 · 0 comments
Assignees
Labels
lang/MATLAB Used for work related to MATLAB frontend

Comments

@jastier
Copy link
Contributor

jastier commented Oct 24, 2023

Support Tree-sitter parsing of MATLAB conditional logic

Support CAST generation and validation testing of this code snippet:

if x > 5
    y = 6
elseif x > 0
    y = x
else
    y = 0 
end

This will be used to represent MATLAB switch statement logic not covered by CAST
Related to issue #561

@jastier jastier added the lang/MATLAB Used for work related to MATLAB frontend label Oct 24, 2023
@jastier jastier self-assigned this Oct 24, 2023
jastier added a commit that referenced this issue Nov 1, 2023
## MATLAB conditional logic added to CAST parser

This PR fixes the if statement handler in `matlab_to_cast.py`. We now
fully support `if elseif else` conditional logic of arbitrary depth in
MATLAB.

- One `if` statement is always included
- Zero or more `elseif` clauses can be included
- Zero or one `else` clause can be included

## Relevant issues
Completes issue #593
Partially completes  issue #561

---------

Co-authored-by: Joseph Astier <[email protected]>
Co-authored-by: Vincent Raymond <[email protected]>
github-actions bot added a commit that referenced this issue Nov 1, 2023
## MATLAB conditional logic added to CAST parser

This PR fixes the if statement handler in `matlab_to_cast.py`. We now
fully support `if elseif else` conditional logic of arbitrary depth in
MATLAB.

- One `if` statement is always included
- Zero or more `elseif` clauses can be included
- Zero or one `else` clause can be included

## Relevant issues
Completes issue #593
Partially completes  issue #561

---------

Co-authored-by: Joseph Astier <[email protected]>
Co-authored-by: Vincent Raymond <[email protected]> a66fba6
@jastier jastier changed the title Support Tree-sitter parsing of MATLAB if-elseif-else logic Support Tree-sitter parsing of MATLAB conditional logic Nov 8, 2023
@jastier jastier closed this as completed Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/MATLAB Used for work related to MATLAB frontend
Projects
None yet
Development

No branches or pull requests

1 participant