Skip to content

Buggy line continuation in Elixir #1089

@alco

Description

@alco

Related to #1051.

iex(4)> ["a]
...(4)> "
...(4)> "
...(4)> "
...(4)> "
...(4)> ]
...(4)> "
...(4)> ]
** (SyntaxError) iex:6: syntax error before: [<<"\n">>]

IEx is waiting for all missing tokens. However, my natural reaction after forgetting to put the closing quote and seeing that it didn't help is to try to put another quote. This leads to cascading effect.

The problem is that there is no way to leave this cycle other then by entering all closing characters. I understand that this mechanism is currently used to implemented do-blocks, but it's too harsh to force the user to quit the shell if they missed some character accidentally and are confused about what's going on.

A plausible solution, in my opinion, would be to catch ^D and break out of the loop with a syntax error. Is it technically possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions