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

Wrong priority for if then else #6

Closed
aryx opened this issue Nov 3, 2022 · 1 comment · Fixed by #9
Closed

Wrong priority for if then else #6

aryx opened this issue Nov 3, 2022 · 1 comment · Fixed by #9

Comments

@aryx
Copy link

aryx commented Nov 3, 2022

This currently does not parse:

local all = yml.rules + semgrep_rules + pfff.rules + ocaml.rules;

  { rules:
      [  if std.objectHas(override_messages, r.id)
         then r + {message: override_messages[r.id]}
         else r
        for r in all
        if !std.member(todo_skipped_for_now, r.id)
      ]
  }

If I add extra parenthesis around 'r + {message: ...}' then it parses correctly.

@tjdevries
Copy link
Contributor

ok, I'm half-time at work right now, but can try and take a look some time in the next few weeks. Sorry for the delays!

aryx pushed a commit to semgrep/tree-sitter-jsonnet that referenced this issue Dec 13, 2022
This also lays the ground work for fixing the priority
for the binary operators in another PR.

This closes sourcegraph#6

test plan:
make test
tjdevries pushed a commit that referenced this issue Dec 13, 2022
This also lays the ground work for fixing the priority
for the binary operators in another PR.

This closes #6

test plan:
make test
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

Successfully merging a pull request may close this issue.

2 participants