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

Multi-value pick in let binding falsely highlighted as function #7

Open
turbo opened this issue Jul 28, 2022 · 3 comments
Open

Multi-value pick in let binding falsely highlighted as function #7

turbo opened this issue Jul 28, 2022 · 3 comments

Comments

@turbo
Copy link
Contributor

turbo commented Jul 28, 2022

A pick expression should highlight the same in (local (_ a b) (fn)) and (let [(_ a b) (fn)] ...), but in let, the first item is treated as a function by the highlighter:

image

@gbaptista
Copy link
Owner

gbaptista commented Jul 28, 2022

Thanks for reporting!

Could you help me isolate the scenario? I remember fixing this case, and I cannot reproduce it here.

Example:

(let [(x y z) (unpack [10 9 8])]
  (+ x y z))

Works fine:
Screenshot_20220728_090546

We have these tests to validate that scenario: syntax_test_fennel_reference.fnl#L250 and syntax_test_fennel_reference.fnl#L513

I suspect it may be an edge case with nested expressions or something like that.

@turbo
Copy link
Contributor Author

turbo commented Jul 28, 2022

Here's the smallest valid case I can produce:

(let [x y
      (_ _ a b) c])

Here's a smaller example that still exhibits the behavior, but is invalid syntax - may help debug:

(let [x 
      (_ _)])

@gbaptista
Copy link
Owner

Oh, I got it. It happens from the second pair onwards:

(let [(a b) [1 2] (c d) [3 4]])

Screenshot_20220728_092907

The c should not be highlighted as a function call.

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