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

Uninformative message on missing "in" #1091

Closed
maedoc opened this issue Aug 18, 2020 · 1 comment
Closed

Uninformative message on missing "in" #1091

maedoc opened this issue Aug 18, 2020 · 1 comment

Comments

@maedoc
Copy link

maedoc commented Aug 18, 2020

with some code like

entry main (x:i32): f32 = 
  let f_ = map f (1..<x)
  let k_ = kura f_ 1f32 0.1f32

  reduce (+) 0.0f32 k_

where in is missing, the message is

Error at test.fut:16:1-1: unexpected end of file.

and then helpfully suggests filing an issue. I saw that in was missing but only because it was missing near the end of the file. I read that whitespace is ignored, but the compiler should know that there are only 3 arguments to kura so what sense would a call to reduce make after that?

Anyway, not a big deal, but since it suggested filing an issue, here we are

@athas
Copy link
Member

athas commented Aug 19, 2020

The parser has almost no niceties in terms of good errors. Maybe it could be given some state so it can say what it's currently trying to parse, and what it's looking for... It's been a while since I looked at what our parser generator (Happy) can provide in this area, though.

@athas athas closed this as completed in e958d1f Aug 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants