Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Nickel: Start infix-chains also for annotated infix_expr #553

Merged
merged 1 commit into from
Jul 3, 2023

Conversation

ErinvanderVeen
Copy link
Collaborator

This resolves part of #547, in particular the issue investigated by @torhovland.

[
  a && (b & c | d),
  a &&
  (b & c | d),
  a &&
  (b &
  c | d)
]

Get correctly formatted as:

[
  a && (b & c | d),
  a
  && (b & c | d),
  a
  && (
    b
    & c | d
  )
]

@torhovland's reasoning was correct, there was a scoping issue. The scope was started by the [, ending after the infix expression. Since the [ was on a previous line, the entire expression was considered to be multi-line, and thus expanded as such. The scope was started there (and not on the next line) because that line was considered a annotated_infix_expr instead of an infix_expr which we did not include in our query to start the scope.

@ErinvanderVeen ErinvanderVeen requested a review from torhovland July 3, 2023 13:46
@ErinvanderVeen
Copy link
Collaborator Author

ErinvanderVeen commented Jul 3, 2023

Also, this PR makes it so that the debug messages for appending and prepending are correct. Previously these messages always reported Empty for the Atom, since the Atom was removed. For our sanity it also removes the message entirely when it is empty.

@ErinvanderVeen ErinvanderVeen enabled auto-merge July 3, 2023 13:47
@ErinvanderVeen ErinvanderVeen merged commit 008e983 into main Jul 3, 2023
@ErinvanderVeen ErinvanderVeen deleted the erin/nickel-infix-chain-annotated branch July 3, 2023 13:49
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants