support 'p' to reprint answer with max depth, allowing w -> p -> w ...
This commit is contained in:
@@ -34,6 +34,7 @@ pub enum ContinueResult {
|
|||||||
ContinueQuery,
|
ContinueQuery,
|
||||||
Conclude,
|
Conclude,
|
||||||
PrintWithoutMaxDepth,
|
PrintWithoutMaxDepth,
|
||||||
|
PrintWithMaxDepth
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn next_keypress() -> ContinueResult {
|
pub fn next_keypress() -> ContinueResult {
|
||||||
@@ -44,6 +45,9 @@ pub fn next_keypress() -> ContinueResult {
|
|||||||
KeyCode::Char('w') => {
|
KeyCode::Char('w') => {
|
||||||
return ContinueResult::PrintWithoutMaxDepth;
|
return ContinueResult::PrintWithoutMaxDepth;
|
||||||
}
|
}
|
||||||
|
KeyCode::Char('p') => {
|
||||||
|
return ContinueResult::PrintWithMaxDepth;
|
||||||
|
}
|
||||||
KeyCode::Char(' ') | KeyCode::Char(';') | KeyCode::Char('n') => {
|
KeyCode::Char(' ') | KeyCode::Char(';') | KeyCode::Char('n') => {
|
||||||
return ContinueResult::ContinueQuery;
|
return ContinueResult::ContinueQuery;
|
||||||
}
|
}
|
||||||
@@ -2348,6 +2352,7 @@ impl MachineState {
|
|||||||
ContinueResult::ContinueQuery => ';',
|
ContinueResult::ContinueQuery => ';',
|
||||||
ContinueResult::Conclude => '.',
|
ContinueResult::Conclude => '.',
|
||||||
ContinueResult::PrintWithoutMaxDepth => 'w',
|
ContinueResult::PrintWithoutMaxDepth => 'w',
|
||||||
|
ContinueResult::PrintWithMaxDepth => 'p',
|
||||||
};
|
};
|
||||||
|
|
||||||
let target = self[temp_v!(1)].clone();
|
let target = self[temp_v!(1)].clone();
|
||||||
|
|||||||
@@ -184,14 +184,19 @@
|
|||||||
|
|
||||||
'$read_input'(ThreadedGoals, NewVarList) :-
|
'$read_input'(ThreadedGoals, NewVarList) :-
|
||||||
'$raw_input_read_char'(C),
|
'$raw_input_read_char'(C),
|
||||||
( C == ('w'), !,
|
( C == w ->
|
||||||
nl,
|
nl,
|
||||||
write(' '),
|
write(' '),
|
||||||
'$write_eq'(ThreadedGoals, NewVarList, 0),
|
'$write_eq'(ThreadedGoals, NewVarList, 0),
|
||||||
'$read_input'(ThreadedGoals, NewVarList)
|
'$read_input'(ThreadedGoals, NewVarList)
|
||||||
; C == (';'), !,
|
; C == p ->
|
||||||
|
nl,
|
||||||
|
write(' '),
|
||||||
|
'$write_eq'(ThreadedGoals, NewVarList, 20),
|
||||||
|
'$read_input'(ThreadedGoals, NewVarList)
|
||||||
|
; C == (';') ->
|
||||||
nl, write('; '), false
|
nl, write('; '), false
|
||||||
; C == ('.'), !,
|
; C == '.',
|
||||||
nl, write(' ...'), nl
|
nl, write(' ...'), nl
|
||||||
).
|
).
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user