Skip to content

fix(parser): parse closing brace of error_block#364

Merged
Wodann merged 1 commit intomun-lang:mainfrom
jonatcln:fix/parser-typo
Feb 10, 2022
Merged

fix(parser): parse closing brace of error_block#364
Wodann merged 1 commit intomun-lang:mainfrom
jonatcln:fix/parser-typo

Conversation

@jonatcln
Copy link
Copy Markdown
Contributor

@jonatcln jonatcln commented Feb 1, 2022

Small fix: replaced a { by } when parsing an error_block.

Example demonstrating wrong behavior:

{ /* error_block */ }
fn main() {}

Original output:

error: syntax error
 --> mod.mun:1:1
  |
1 | { /* error_block */ }
  | ^ expected a declaration
  |error: syntax error
 --> mod.mun:1:21
  |
1 | { /* error_block */ }
  |                     ^ unmatched }
  |

Output after fix (here, the } is parsed as part of the error_block):

error: syntax error
 --> mod.mun:1:1
  |
1 | { /* error_block */ }
  | ^ expected a declaration
  |

Does this need a test case? I'm not really sure what would be the best example for this (nor how this test case would be named).

Copy link
Copy Markdown
Collaborator

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

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

Thanks!

@baszalmstra
Copy link
Copy Markdown
Collaborator

Yes! #366 has been merged! Could you rebase on main? Should fix the CI!

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 10, 2022

Codecov Report

Merging #364 (3aafa43) into main (6fa4e7b) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #364   +/-   ##
=======================================
  Coverage   82.63%   82.63%           
=======================================
  Files         264      264           
  Lines       15297    15297           
=======================================
  Hits        12641    12641           
  Misses       2656     2656           
Impacted Files Coverage Δ
crates/mun_syntax/src/parsing/grammar.rs 95.55% <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 6fa4e7b...3aafa43. Read the comment docs.

@jonatcln
Copy link
Copy Markdown
Contributor Author

Rebased!

@Wodann Wodann merged commit cc967b4 into mun-lang:main Feb 10, 2022
@jonatcln jonatcln deleted the fix/parser-typo branch February 10, 2022 14:19
@Wodann Wodann added this to the Mun v0.4.0 milestone Jul 8, 2022
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.

3 participants