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

MATLAB function call, operator and matrix support, code cleanup #641

Merged
merged 6 commits into from
Nov 14, 2023

Conversation

jastier
Copy link
Contributor

@jastier jastier commented Nov 14, 2023

MATLAB function call, operator and matrix support, code cleanup

This PR adds support for Operators, matrix literals, and function calls. I also got rid of some old Fortran routines that didn't work with MATLAB. Added support for some Operator types, we now support four of them and have three remaining. Those are going to have to be resolved by translating them to CAST loop constructs.

Relevant features:

  • Added Operator support (Boolean, comparison, unary)
  • Added function call node support
  • Added n-dimensional matrix support for all primitive types
  • Added new CI test cases for all of the above
  • Added a file with Waterloo model Tree-sitter syntax tokens

Bugfixes

  • Fixed a bug where CAST output was getting wrapped in an extra list.
  • Fixed a bug were the source_refs node wasn't getting included on certain structures. Our CI now checks them all.

Related issues

Resolves #590 #635 #636
Work towards #562

@github-actions github-actions bot added the lang/MATLAB Used for work related to MATLAB frontend label Nov 14, 2023
@jastier jastier changed the title replaced files with those from jastier/function_call MATLAB function call, operator and matrix support, code cleanup Nov 14, 2023
@jastier jastier self-assigned this Nov 14, 2023
@jastier jastier added this to the [DARPA] Milestone 11 milestone Nov 14, 2023
@jastier jastier marked this pull request as draft November 14, 2023 10:45
@jastier jastier marked this pull request as ready for review November 14, 2023 12:33
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add developer documentation for these runnables you're adding, @jastier . You can add this to the website (the relevant source is under docs/dev).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good idea, however in this case I am no longer including the output from that script in the source code, so there is no further need for the script. It has been removed from the repo.

(parenthesized_expression)
(...) ...
(body) ...
SOURCE:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think at some point in the future it makes sense to remove these comments that have the code and syntax tree, or at least move them somewhere out of the way. This way the code is easier to read through.
However I think for now it's fine since I imagine it helps out with development.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those were Tree-sitter output that I use for designing CAST structures for unimplemented syntax keywords. I have removed them, they are easy to regenerate as I need them.

Copy link
Contributor

@titomeister titomeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@jastier jastier merged commit d193a52 into main Nov 14, 2023
8 checks passed
@jastier jastier deleted the jastier/updates branch November 14, 2023 19:28
github-actions bot added a commit that referenced this pull request Nov 14, 2023
## MATLAB function call, operator and matrix support, code cleanup
This PR adds support for Operators, matrix literals, and function calls.
I also got rid of some old Fortran routines that didn't work with
MATLAB. Added support for some Operator types, we now support four of
them and have three remaining. Those are going to have to be resolved by
translating them to CAST loop constructs.

## Relevant features:
- Added Operator support (Boolean, comparison, unary)
- Added function call node support
- Added n-dimensional matrix support for all primitive types
- Added new CI test cases for all of the above
- Added a file with Waterloo model Tree-sitter syntax tokens

## Bugfixes
- Fixed a bug where CAST output was getting wrapped in an extra list.
- Fixed a bug were the source_refs node wasn't getting included on
certain structures. Our CI now checks them all.

## Related issues
Resolves #590 #635 #636
Work towards #562

---------

Co-authored-by: Joseph Astier <[email protected]>
Co-authored-by: Gus Hahn-Powell <[email protected]> d193a52
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

Successfully merging this pull request may close these issues.

MATLAB keywords
3 participants