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

Bad error syntax on tuple with trailing comma #7858

Open
vicuna opened this issue Oct 3, 2018 · 9 comments
Open

Bad error syntax on tuple with trailing comma #7858

vicuna opened this issue Oct 3, 2018 · 9 comments

Comments

@vicuna
Copy link

vicuna commented Oct 3, 2018

Original bug ID: 7858
Reporter: @gasche
Assigned to: @let-def
Status: assigned (set by @gasche on 2018-10-03T13:14:59Z)
Resolution: open
Priority: normal
Severity: minor
Version: 4.08.0+dev/beta1/beta2
Target version: undecided
Category: lexing and parsing
Tags: syntax-error-messages
Monitored by: @nojb

Bug description

Consider the input "(foo,);;"

4.07.0 behaves as follows:

# (foo,);;
       ^
Error: Syntax error: operator expected.

Trunk (4.08+dev) behaves as follows:

# (foo,);;
       ^
Error: Syntax error: ')' expected
Line 1, characters 0-1: This '(' might be unmatched

Both messages are bad, but arguably the new one is even worse.

@AndrewLitteken
Copy link
Contributor

Is this bug being handled by anyone? I would like to work on it if not.

@gasche
Copy link
Member

gasche commented Apr 6, 2019

@AndrewLitteken: unfortunately, we don't have a good story for syntax error messages right now, and we are planning to change how they are done in a couple OCaml versions. I would encourage you to focus on some other task, because this one is likely to (1) turn out to be more difficult than it looks and (2) have the solution space change quite a bit in 6-12 months.

@copy
Copy link
Contributor

copy commented Nov 27, 2019

Probably the same bug, but may be worth adding as a test case:

File "./test.ml", line 1, characters 16-17:
1 | (x >>= fun y -> )
                    ^
Error: Syntax error: ')' expected

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label Nov 30, 2020
@copy
Copy link
Contributor

copy commented Nov 30, 2020

Still reproducible.

@github-actions github-actions bot removed the Stale label Dec 2, 2020
@github-actions
Copy link

github-actions bot commented Dec 6, 2021

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label Dec 6, 2021
@copy
Copy link
Contributor

copy commented Dec 6, 2021

This has been partially fixed in #10095: The incorrect ')' expected is gone.

@github-actions github-actions bot removed the Stale label Dec 8, 2021
@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@OlivierNicole
Copy link
Contributor

On 5.0.0 rc1, both (foo,) and (x >>= fun y -> ) result in a mere “Syntax error” at the position of the closing parenthesis.

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

6 participants