Skip to content

Conversation

@rma97
Copy link
Contributor

@rma97 rma97 commented Feb 9, 2026

Based on #81 and fixes the failing tests.

  • Treat ... as a standalone term before binary operators (like ranges).
  • Allow ... to consume unary +/- so arithmetic precedence matches Elixir.
  • Tests now pass for ellipsis operator precedence cases.

There were 3 failing tests:

  1) test ... operator - unary ellipsis as term before range (Spitfire.OperatorsTest)
     test/operators_test.exs:1038
     Assertion with == failed
     code:  assert spitfire_parse(code) == s2q(code)
     left:  {:error, :parse_error}
     right: {:ok, {:.., [line: 1, column: 5], [{:..., [line: 1, column: 1], []}, 1]}}
     stacktrace:
       test/operators_test.exs:1040: (test)

  2) test ... operator - unary ellipsis as term before infix operator (Spitfire.OperatorsTest)
     test/operators_test.exs:1033
     Assertion with == failed
     code:  assert spitfire_parse(code) == s2q(code)
     left:  {:error, :parse_error}
     right: {:ok, {:*, [line: 1, column: 5], [{:..., [line: 1, column: 1], []}, 1]}}
     stacktrace:
       test/operators_test.exs:1035: (test)


  3) test ... operator - unary = has higher precedence than ... (Spitfire.OperatorsTest)
     test/operators_test.exs:1018
     Assertion with == failed
     code:  assert spitfire_parse(code) == s2q(code)
     left:  {:error, :parse_error}
     right: {
              :ok,
              {:=, [line: 1, column: 5], [{:..., [line: 1, column: 1], []}, {:=, [line: 1, column: 9], [{:a, [line: 1, column: 7], nil}, {:b, [line: 1, column: 11], nil}]}]}
            }
     stacktrace:
       test/operators_test.exs:1020: (test)

@mhanberg
Copy link
Contributor

mhanberg commented Feb 9, 2026

Please remove the actual test.

Once we merge this, I'll rebase that PR and merge it separately.

But I can see currently that it passes so that's sweet 😎

@rma97
Copy link
Contributor Author

rma97 commented Feb 9, 2026

Please remove the actual test.

Once we merge this, I'll rebase that PR and merge it separately.

But I can see currently that it passes so that's sweet 😎

Done

@mhanberg mhanberg merged commit b4f94c9 into elixir-tools:main Feb 9, 2026
37 checks passed
mhanberg pushed a commit that referenced this pull request Feb 10, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.3.4](v0.3.3...v0.3.4)
(2026-02-09)


### Bug Fixes

* align ellipsis operator precedence with elixir
([#96](#96))
([b4f94c9](b4f94c9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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 this pull request may close these issues.

2 participants