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

Final semi-colon in module does not lead to parse error. #6828

Closed
vicuna opened this issue Mar 31, 2015 · 2 comments
Closed

Final semi-colon in module does not lead to parse error. #6828

vicuna opened this issue Mar 31, 2015 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Mar 31, 2015

Original bug ID: 6828
Reporter: @dbuenzli
Status: closed (set by @xavierleroy on 2017-02-16T14:15:00Z)
Resolution: won't fix
Priority: normal
Severity: minor
Version: 4.02.1
Category: ~DO NOT USE (was: OCaml general)
Related to: #4627 #6961

Bug description

I don't know if this is expected (a very quick look at the grammar language seems to indicate that it should not be accepted):

module M = struct let f x = x; end;;

module M : sig val f : 'a -> 'a end

It may be related to #4627

@vicuna
Copy link
Author

vicuna commented Apr 3, 2015

Comment author: @damiendoligez

This has nothing to do with modules: a semicolon is accepted at the end of expressions. It's not documented, but it is working as designed : a semicolon is accepted at the end of an expr in some places, most notably so we can write:
begin
expr;
expr;
expr;
end

Indeed, this is related to #4627.

@vicuna
Copy link
Author

vicuna commented Apr 17, 2015

Comment author: @dbuenzli

Ok. But I don't think it's a good thing to not to document the fact. There may be tools that are interested in having a complete language grammar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant