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

Modification of the function parse_mode in stdlib_experimental_io #77

Merged
merged 2 commits into from
Jan 5, 2020

Conversation

jvdp1
Copy link
Member

@jvdp1 jvdp1 commented Jan 4, 2020

I modified the function parse_mode in stdlib_experimental_io.f90 to be more flexible.
I also added a new test file test_parse_mode.f90 and removed associated tests from test_open (in case we would use a public parse_mode only for tests).
I added several cases for testing parse_mode.

@certik
Copy link
Member

certik commented Jan 5, 2020 via email

Copy link
Member

@certik certik left a comment

Choose a reason for hiding this comment

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

This does not change any public API and improves the implementation and adds tests. So I am going to go ahead and merge this.

@certik certik merged commit c789d1f into fortran-lang:master Jan 5, 2020
@certik
Copy link
Member

certik commented Jan 5, 2020

@jvdp1 thanks, it looks great! The only additional improvement that I can think of is if something calls it like this open(filename, "rr"). In Python this gives an error if "r" and other modes are used more than once. Also some other combinations are probably not allowed, like "rw", or "rtb". But as it is now, it's already very useful.

@jvdp1 jvdp1 deleted the parse_mode branch January 5, 2020 08:09
@jvdp1
Copy link
Member Author

jvdp1 commented Jan 5, 2020

@jvdp1 thanks, it looks great! The only additional improvement that I can think of is if something calls it like this open(filename, "rr"). In Python this gives an error if "r" and other modes are used more than once. Also some other combinations are probably not allowed, like "rw", or "rtb". But as it is now, it's already very useful.

Things like "rr" is not a problem, while things like "rw" are a problem. I will have a look to modify parse_mode to give an error when these cases are provided.

Edit: This should be solved with #82

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.

2 participants