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

Diagnostics includes path before message #102

Open
rktjmp opened this issue May 2, 2023 · 0 comments
Open

Diagnostics includes path before message #102

rktjmp opened this issue May 2, 2023 · 0 comments
Labels

Comments

@rktjmp
Copy link
Owner

rktjmp commented May 2, 2023

Sometimes Fennel gives us error with an embedded path in it. We correctly strip the first location but the second is shown in the diagnostic - obscuring the message.

Eg: Fennel gives us

/path/my/file.fnl:4:4 Compile error: /path/my/file.fnl:5:18 Compile error: can't nest multi-value destructuring

      (where (< t (/ 1 6))) (-> (- q p) (* 6 t) (+ p))

Which we convert into

{:file "/path/my/file.fnl"
 :loc [4 4]
 :message "Compile error: /path/my/file.fnl:5:18 Compile error: can't nest multi-value destructuring"}

Offending code

    (case t
      (where (< t (/ 1 6))) (-> (- q p) (* 6 t) (+ p))
      (where (< t (/ 1 2))) q
      (where (< t (/ 2 3))) (-> (- q p) (* (- (/ 2 3) t) 6))
      _ p)
@rktjmp rktjmp added the external label May 2, 2023
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

1 participant