Skip to content

Fix 'not in' as continuation operator in IEx - #15678

Merged
josevalim merged 2 commits into
elixir-lang:mainfrom
AlexGx:ag-iex_not_in_cont-fix
Jul 26, 2026
Merged

Fix 'not in' as continuation operator in IEx#15678
josevalim merged 2 commits into
elixir-lang:mainfrom
AlexGx:ag-iex_not_in_cont-fix

Conversation

@AlexGx

@AlexGx AlexGx commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Current

iex> 4
iex> in [1, 2]
false

```elixir
iex> 4
iex> not in [1, 2]
** (SyntaxError) invalid syntax found on iex:4:1:
    error: syntax error before: {in_op,{4,1,nil},'not in',{4,5,nil}}4not in [1, 2]^
    │
    └─ iex:4:1
    (iex 1.21.0-dev) lib/iex/server.ex:403: IEx.Server.__parse__/3
    (stdlib 8.0.2) io_lib.erl:1649: :io_lib.get_until/4
    (kernel 11.0.3) group.erl:407: :group.xterm/3
    (stdlib 8.0.2) gen_statem.erl:3741: :gen_statem.loop_state_callback/11
    (stdlib 8.0.2) proc_lib.erl:333: :proc_lib.init_p_do_apply/3

Expected

true, same as:

iex> 4 not in [1, 2]
true

Tokenizer represents composite not in as four-element token, like: {in_op,{4,1,nil},'not in',{4,5,nil}}

Comment thread lib/iex/lib/iex/evaluator.ex
@josevalim
josevalim merged commit a598106 into elixir-lang:main Jul 26, 2026
15 checks passed
@josevalim

Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

@AlexGx
AlexGx deleted the ag-iex_not_in_cont-fix branch July 26, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants