fix(library/vm/vm_io): capture put_str/put_nat output in server mode
This commit is contained in:
parent
133b70c0e3
commit
044b989679
1 changed files with 5 additions and 3 deletions
|
|
@ -6,20 +6,22 @@ Author: Leonardo de Moura
|
|||
*/
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include "library/io_state.h"
|
||||
#include "library/tactic/tactic_state.h"
|
||||
#include "library/vm/vm.h"
|
||||
#include "library/vm/vm_string.h"
|
||||
|
||||
namespace lean {
|
||||
vm_obj put_str(vm_obj const & str, vm_obj const &) {
|
||||
std::cout << to_string(str);
|
||||
get_global_ios().get_regular_stream() << to_string(str);
|
||||
return mk_vm_unit();
|
||||
}
|
||||
|
||||
vm_obj put_nat(vm_obj const & n, vm_obj const &) {
|
||||
if (is_simple(n))
|
||||
std::cout << cidx(n);
|
||||
get_global_ios().get_regular_stream() << cidx(n);
|
||||
else
|
||||
std::cout << to_mpz(n);
|
||||
get_global_ios().get_regular_stream() << to_mpz(n);
|
||||
return mk_vm_unit();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue