Skip to content

Conversation

@doorgan
Copy link
Contributor

@doorgan doorgan commented Jan 30, 2026

... + 1 * 2 is not parsed the same as with the elixir parser

Spitfire:

{:+, [line: 1, column: 5], [{:..., [line: 1, column: 1], []}, {:*, [line: 1, column: 9], [1, 2]}]}

Elixir:

{:+, [line: 1, column: 5], [{:..., [line: 1, column: 1], []}, {:*, [line: 1, column: 9], [1, 2]}]}

The problem was that ... was parsed as an empty node, like the ones occurring at typespecs (eg @type foo :: [atom(), ...]) but never as a unary operator.
The fix is to consider it a unary_op if it's not followed by a terminal, then parse the right hand side.

@doorgan doorgan force-pushed the doorgan/ellipsis_op branch from 0b534a2 to 31bb884 Compare January 30, 2026 17:24
@doorgan doorgan force-pushed the doorgan/ellipsis_op branch from 31bb884 to 3b88e46 Compare January 30, 2026 17:27
@mhanberg mhanberg merged commit e86f1f4 into elixir-tools:main Jan 30, 2026
37 checks passed
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