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

Make Parser.mkoption available #6839

Closed
vicuna opened this issue Apr 15, 2015 · 1 comment
Closed

Make Parser.mkoption available #6839

vicuna opened this issue Apr 15, 2015 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Apr 15, 2015

Original bug ID: 6839
Reporter: @zoggy
Assigned to: @diml
Status: assigned (set by @mshinwell on 2016-12-12T16:19:35Z)
Resolution: open
Priority: normal
Severity: feature
Version: 4.02.1
Category: otherlibs
Tags: junior_job
Monitored by: @diml

Bug description

When building parsetrees using ppx, it is possible to define types using the "option" constructor.

But internally, these constructor has a "special" longident defined in parser.ml with the mkoption function:

let mkoption d =
let loc = {d.ptyp_loc with loc_ghost = true} in
Typ.mk ~loc (Ptyp_constr(mkloc (Ldot (Lident "predef", "option")) loc,[d]))

Then, this special longident is required in various places to be exactly this one, for example in the is_predef_option of parsing/pprint_ast.ml .

Adding mkoption to parser.mli would ease the generation of the option constructor in ppx tools.
By now, I create the same longident but if this internal longident changes in the future, my code will break.

@Octachron
Copy link
Member

There are no more mkoption or Lident "*predef*" in the parser .

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

2 participants