File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -220,6 +220,13 @@ Char GET_NEXT_CHAR(void)
220220 // if we see a backlash without a line terminator after it, stop
221221 break ;
222222 }
223+
224+ // if we get here, we saw a line continuation; change the prompt to a
225+ // partial prompt from now on
226+ if (!SyQuiet )
227+ STATE (Prompt ) = "> " ;
228+ else
229+ STATE (Prompt ) = "" ;
223230 }
224231
225232 return * STATE (In );
Original file line number Diff line number Diff line change @@ -8,11 +8,17 @@ gap> START_TEST("linecontinuation.tst");
88gap> x:= " foo\
99> bar" ;
1010" foobar"
11+ gap> " foo\
12+ > bar" ;
13+ " foobar"
1114
1215# in triple quoted string
13- gap> x:= " " " haha\
14- > !" " " ;
15- " haha!"
16+ gap> x:= " " " foo\
17+ > bar" " " ;
18+ " foobar"
19+ gap> " " " foo\
20+ > bar" " " ;
21+ " foobar"
1622
1723# break keywords and operators like :=, <=, >= etc. in the middle
1824gap> 1 m\
@@ -35,6 +41,19 @@ gap> {x.\
3541> .. } -> x;
3642function ( x... ) .. . end
3743
44+ # inside float expressions
45+ gap> 1. 2e\
46+ > 0 ;
47+ 1.2
48+ gap> 1.1 \
49+ > ;
50+ 1.1
51+
52+ # inside integer expressions
53+ gap> 12 \
54+ > 3 ;
55+ 123
56+
3857# however, in comments, you cannot use line continuations:
3958gap> # 1234\
4059gap> 5 ;
You can’t perform that action at this time.
0 commit comments