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 RETURN keyword #234

Merged
merged 11 commits into from
Aug 12, 2021
Merged

Support RETURN keyword #234

merged 11 commits into from
Aug 12, 2021

Conversation

ulmer-a
Copy link
Collaborator

@ulmer-a ulmer-a commented Aug 12, 2021

This PR adds support for the RETURN keyword in the parser and code generator. It includes an example for experimentation as well as parser and codegen tests.

@ulmer-a ulmer-a added this to the oscat milestone Aug 12, 2021
@ulmer-a ulmer-a self-assigned this Aug 12, 2021
@codecov
Copy link

codecov bot commented Aug 12, 2021

Codecov Report

Merging #234 (2468cf3) into master (04bcbda) will increase coverage by 0.01%.
The diff coverage is 97.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #234      +/-   ##
==========================================
+ Coverage   93.58%   93.60%   +0.01%     
==========================================
  Files          34       34              
  Lines        9173     9217      +44     
==========================================
+ Hits         8585     8628      +43     
- Misses        588      589       +1     
Impacted Files Coverage Δ
src/ast.rs 87.67% <50.00%> (-0.16%) ⬇️
src/codegen/generators/pou_generator.rs 95.58% <100.00%> (+0.04%) ⬆️
src/codegen/generators/statement_generator.rs 99.78% <100.00%> (+<0.01%) ⬆️
src/parser/control_parser.rs 96.02% <100.00%> (+0.14%) ⬆️
tests/correctness/control_flow.rs 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 04bcbda...2468cf3. Read the comment docs.

Copy link
Collaborator

@ghaith ghaith left a comment

Choose a reason for hiding this comment

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

Could you also add a correctness test for an early return function?
Correctness tests will execute the code and return a value, not just codegen.

@ulmer-a ulmer-a requested a review from ghaith August 12, 2021 11:20
@ghaith ghaith merged commit 45d3d7c into PLC-lang:master Aug 12, 2021
@ulmer-a ulmer-a deleted the return_keyword branch August 12, 2021 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants