Remove redundant parser entry point
ClosedPublic

Authored by mpickering on Jun 24 2015, 12:30 PM.

Details

Summary

parseFullStmt and parseStatement exposed the same parser entry
point.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mpickering updated this revision to Diff 3327.Jun 24 2015, 12:30 PM
mpickering retitled this revision from to Remove redundant parser entry point.
mpickering updated this object.
mpickering edited the test plan for this revision. (Show Details)
alanz added a subscriber: alanz.Jun 24 2015, 4:36 PM

These were added by Andrew Gibiansky for IHaskell. Perhaps check with him that he is ok with this.

I believe this may be in use (if not now then soon). Regardless, it should have a comment justifying its existence.

Both of these entry points were added by the same patch. Am I missing something about why they are both needed? They are precisely the same function with two different confusing names.

alanz added a comment.Jun 25 2015, 1:06 AM

The one returns a Maybe

parseStmt returns a Maybe. parseStatement and parseFullStmt don't and expose the same entry point.

alanz added a comment.Jun 25 2015, 7:00 AM

@mpickering, I agree with you, did not look closely enough before

There is no reason for parseFullStmt to exist. I am in favor of getting rid of it. Including it was a mistake, oops.

bgamari accepted this revision.Jun 30 2015, 1:15 PM
bgamari added a reviewer: bgamari.

Thanks @gibiansky! Looks good to me.

This revision is now accepted and ready to land.Jun 30 2015, 1:15 PM
This revision was automatically updated to reflect the committed changes.