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

Too many parens required in first class module syntax #7216

Closed
vicuna opened this issue Apr 7, 2016 · 5 comments
Closed

Too many parens required in first class module syntax #7216

vicuna opened this issue Apr 7, 2016 · 5 comments
Assignees
Labels
Milestone

Comments

@vicuna
Copy link

vicuna commented Apr 7, 2016

Original bug ID: 7216
Reporter: @sliquister
Assigned to: @garrigue
Status: resolved (set by @garrigue on 2016-12-13T08:25:19Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.3
Target version: 4.03.1+dev
Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @diml @hcarty

Bug description

include A(val x);;

Error: Syntax error

include A((val x));;

Error: Unbound value x

File attachments

@vicuna
Copy link
Author

vicuna commented Apr 8, 2016

Comment author: @garrigue

This is originally designed to avoid any syntactic conflict between the core and module levels.
I see at least two way it could be improved:

  • By allowing to omit the parenthesis where there is no (potential) ambiguity, i.e. everywhere except functor positions.
    In theory it's ok, but one would have to fix the conflicts by hand. Painful.
  • Just remove the need for double parentheses.
    I.e. create a paren_module_expr non-terminal, which can be used directly as argument to a functor.

The second option is much simpler. I include a patch that seems to work.

@vicuna
Copy link
Author

vicuna commented Sep 14, 2016

Comment author: @sliquister

I ran into this issue of having to write double parens again. Any chance this patch can be merged? The patch looks good to me (the error case that's removed is now covered by an error case that was there for parenthesized module expr, if someone is curious), and it works as intended.

@vicuna
Copy link
Author

vicuna commented Dec 12, 2016

Comment author: @mshinwell

@sliquister Please provide a Github PR with the patch, thanks.

@vicuna
Copy link
Author

vicuna commented Dec 13, 2016

Comment author: @garrigue

This is #949 (almost ready to merge).

@vicuna
Copy link
Author

vicuna commented Dec 13, 2016

Comment author: @garrigue

#949 merged at commit d8fc8dc.

@vicuna vicuna closed this as completed Dec 13, 2016
@vicuna vicuna added this to the 4.03.1 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants