void jl_input_line_callback(char *input) { int end=0, doprint=1; if (!input || ios_eof(ios_stdin)) { end = 1; rl_ast = NULL; } else if (!rl_ast) { // In vi mode, it's possible for this function to be called w/o a // previous call to return_callback. rl_ast = jl_parse_input_line(rl_line_buffer); } if (rl_ast != NULL) { doprint = !ends_with_semicolon(input); add_history_permanent(input); jl_putc('\n', jl_uv_stdout); free(input); } callback_en = 0; rl_callback_handler_remove(); handle_input(rl_ast, end, doprint); rl_ast = NULL; }
void jl_input_line_callback(char *input) { if (input) { jl_value_t *ast = jl_parse_input_line(input); int line_done = !ast || !jl_is_expr(ast) || (((jl_expr_t*)ast)->head != jl_continue_sym); if (line_done) { jl_deprep_terminal(); int doprint = !ends_with_semicolon(input); stdin_buf[0] = 0; //also sets input[0] == 0 stdin_buf_len = 0; handle_input(ast, 0, doprint); } } }
DLLEXPORT void jl_input_line_callback(char *input) { int end=0, doprint=1; if (!input || ios_eof(ios_stdin)) { end = 1; rl_ast = NULL; } if (rl_ast != NULL) { doprint = !ends_with_semicolon(input); add_history_permanent(input); ios_putc('\n', ios_stdout); free(input); } handle_input(rl_ast, end, doprint); }