Observed behaviour
In the following example, I press enter twice after entering the backslash:
gap> 1.1e\
gap>
Syntax error: Badly Formed Number: need at least one digit in the exponent
^
or
Expected behaviour
A continuation prompt should appear immediately in both cases, e.g.
resp.
Analysis
Part of the problem here is that dealing with line continuations is not handled in a uniform manner, but rather the relevant logic has to be replicated everywhere; and it is easy to forget that, or do it wrong.
As a long-term fix, I think we could add a "line reader" as an additional layer between io.c and scanner.c. It would take care of reading the input line by line, keeping track of the current line number, but also of automatically and transparently handling line continuations (including transparent support for CR, CR/LF or LF line ends).
Observed behaviour
In the following example, I press enter twice after entering the backslash:
or
Expected behaviour
A continuation prompt should appear immediately in both cases, e.g.
resp.
Analysis
Part of the problem here is that dealing with line continuations is not handled in a uniform manner, but rather the relevant logic has to be replicated everywhere; and it is easy to forget that, or do it wrong.
As a long-term fix, I think we could add a "line reader" as an additional layer between
io.candscanner.c. It would take care of reading the input line by line, keeping track of the current line number, but also of automatically and transparently handling line continuations (including transparent support for CR, CR/LF or LF line ends).