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

Error message for _ in expression is incomprehensible #6400

Closed
vicuna opened this issue May 6, 2014 · 4 comments
Closed

Error message for _ in expression is incomprehensible #6400

vicuna opened this issue May 6, 2014 · 4 comments
Assignees
Labels
Milestone

Comments

@vicuna
Copy link

vicuna commented May 6, 2014

Original bug ID: 6400
Reporter: @whitequark
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2017-02-16T14:16:12Z)
Resolution: fixed
Priority: normal
Severity: minor
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Tags: patch
Child of: #5068
Monitored by: @gasche

Bug description

For example:

[{pstr_desc = Pstr_extension (extension_of_error error, _)}];;

Error: Syntax error: operator expected.

First, the error message makes no sense at all. Second, the `_' is underlined, which adds to the confusion.

File attachments

@vicuna
Copy link
Author

vicuna commented May 7, 2014

Comment author: @gasche

For the record, the reason why you get this error is that the error production that fires is

[{pstr_desc = Pstr_extension (ERROR)}]

and that (ERROR) is interpreted as an infix operator (+) where the operator is erroneous.

Adding a couple error production seems to fix that, but I'm not sure that's a good long-term solution.

@vicuna
Copy link
Author

vicuna commented May 7, 2014

Comment author: @whitequark

Agreed; it seems like migrating to Merlin would be a much better one.

@vicuna
Copy link
Author

vicuna commented May 14, 2014

Comment author: @alainfrisch

I've attached a different patch, which recognizes "_" in the "expr" grammar entry. This explicitly reserves this syntax in expression, which could be useful later (e.g. if add "implicits" to the language; or just as a placeholder for extension node expanders).

@vicuna
Copy link
Author

vicuna commented Dec 3, 2015

Comment author: @alainfrisch

I committed (1108358) my patch to trunk.

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