dlang-community / libdparse

Library for lexing and parsing D source code
https://libdparse.dlang.io
Boost Software License 1.0
114 stars 56 forks source link

allow in/out contract expressions in shortened methods #454

Closed WebFreak001 closed 2 years ago

WebFreak001 commented 2 years ago

Fixes contract expressions with shortened methods introduced in the previous PR #439

Might want to improve syntax errors with it, but this should work for now.

codecov[bot] commented 2 years ago

Codecov Report

Merging #454 (df248d4) into master (413a416) will increase coverage by 0.02%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #454      +/-   ##
==========================================
+ Coverage   82.79%   82.82%   +0.02%     
==========================================
  Files          11       11              
  Lines        8290     8301      +11     
==========================================
+ Hits         6864     6875      +11     
  Misses       1426     1426              
Impacted Files Coverage Δ
src/dparse/ast.d 70.25% <ø> (ø)
src/dparse/parser.d 91.26% <100.00%> (+0.02%) :arrow_up:

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 413a416...df248d4. Read the comment docs.

WebFreak001 commented 2 years ago

note: errors like `do` expected after InStatement or OutStatement seem to never be emitted. Unsure if this is because of this PR, though they aren't tested anyway. Might want to add error message tests in the future and improve some areas (like the fail file in fail_files/shortenedMethod.d as well)