Skip to content

Commit ac44e72

Browse files
committed
Keep collecting buffer in IEx parser
1 parent 2ac361a commit ac44e72

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/iex/lib/iex/evaluator.ex

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ defmodule IEx.Evaluator do
6969
"""
7070
def parse(input, opts, parser_state)
7171

72-
def parse(input, opts, []), do: parse(input, opts, :other)
72+
def parse(input, opts, []), do: parse(input, opts, {[], :other})
7373

74-
def parse(input, opts, last_op) do
74+
def parse(input, opts, {buffer, last_op}) do
75+
input = buffer ++ input
7576
file = Keyword.get(opts, :file, "nofile")
7677
line = Keyword.get(opts, :line, 1)
7778
column = Keyword.get(opts, :column, 1)
@@ -106,10 +107,10 @@ defmodule IEx.Evaluator do
106107

107108
case result do
108109
{:ok, forms, last_op} ->
109-
{:ok, forms, last_op}
110+
{:ok, forms, {[], last_op}}
110111

111112
{:error, {_, _, ""}} ->
112-
{:incomplete, last_op}
113+
{:incomplete, {input, last_op}}
113114

114115
{:error, {location, error, token}} ->
115116
:elixir_errors.parse_error(

0 commit comments

Comments
 (0)