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

Remove PResult #211

Merged
merged 11 commits into from
Aug 6, 2021
Merged

Remove PResult #211

merged 11 commits into from
Aug 6, 2021

Conversation

ulmer-a
Copy link
Collaborator

@ulmer-a ulmer-a commented Jul 27, 2021

This will close #196

This PR will remove all PResults and all unneeded Results from the parser.

The changes that lead to a dead end can be found in PR #202.

@ulmer-a ulmer-a self-assigned this Jul 27, 2021
@codecov
Copy link

codecov bot commented Jul 27, 2021

Codecov Report

Merging #211 (1fcbc38) into master (5e97491) will increase coverage by 0.00%.
The diff coverage is 97.94%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #211   +/-   ##
=======================================
  Coverage   95.93%   95.94%           
=======================================
  Files          41       41           
  Lines       15430    15449   +19     
=======================================
+ Hits        14803    14822   +19     
  Misses        627      627           
Impacted Files Coverage Δ
src/codegen/tests.rs 92.85% <ø> (ø)
src/lexer.rs 95.32% <ø> (ø)
src/parser.rs 97.38% <94.95%> (-1.25%) ⬇️
src/index/tests/index_tests.rs 99.57% <100.00%> (ø)
src/lib.rs 52.61% <100.00%> (-0.17%) ⬇️
src/parser/control_parser.rs 95.88% <100.00%> (+3.93%) ⬆️
src/parser/expressions_parser.rs 97.24% <100.00%> (+0.07%) ⬆️

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 5e97491...1fcbc38. Read the comment docs.

@ulmer-a
Copy link
Collaborator Author

ulmer-a commented Jul 27, 2021

Ad expression_parser: At this point, parse_expression() will always return a Statement. In case of a syntax error, this will be the whole AST of the expression with the erroneous token replaced with an EmptyStatemen and a diagnostic logged. This is different from it returnnig just a single EmptyStatement, which is not an error condition

@ulmer-a ulmer-a marked this pull request as ready for review August 3, 2021 08:47
@ulmer-a ulmer-a changed the title Take care of PResult and control parser recovery (WIP) Remove PResult Aug 3, 2021
@ulmer-a ulmer-a requested a review from riederm August 3, 2021 08:48
@ulmer-a ulmer-a mentioned this pull request Aug 5, 2021
@ulmer-a ulmer-a removed their assignment Aug 5, 2021

pub fn parse_primary_expression(lexer: &mut ParseSession) -> Result<Statement, ParseError> {
/// parse_expression(): returns expression as Statement. if a parse error
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice, we should try to have more code-documentation for the future!
thx!

@ulmer-a ulmer-a merged commit 2200c8c into PLC-lang:master Aug 6, 2021
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.

Remove PResult where possible in parser
2 participants