#[cfg(target_arch = "wasm32")]
#[wasm_bindgen]
pub fn eval_code(s: &str) -> String {
- use web_sys::console;
use machine::mock_wam::*;
let mut wam = Machine::with_test_streams();
use std::fs::{File, OpenOptions};
use std::hash::Hash;
use std::io;
-use std::io::{BufRead, Cursor, ErrorKind, Read, Seek, SeekFrom, Write};
+use std::io::{Cursor, ErrorKind, Read, Seek, SeekFrom, Write};
+#[cfg(feature = "http")]
+use std::io::BufRead;
use std::mem;
use std::net::{Shutdown, TcpStream};
use std::ops::{Deref, DerefMut};
use std::ffi::CString;
use std::fs;
use std::hash::{BuildHasher, BuildHasherDefault};
-use std::io::{ErrorKind, Read, BufRead, Write};
+use std::io::{ErrorKind, Read, Write};
+#[cfg(feature = "http")]
+use std::io::BufRead;
use std::iter::{once, FromIterator};
use std::mem;
-use std::net::{SocketAddr, TcpListener, TcpStream, ToSocketAddrs};
+use std::net::{TcpListener, TcpStream};
+#[cfg(feature = "http")]
+use std::net::{SocketAddr, ToSocketAddrs};
use std::num::NonZeroU32;
use std::ops::Sub;
use std::process;
+#[cfg(feature = "http")]
use std::str::FromStr;
+#[cfg(feature = "http")]
use std::sync::{Mutex, Arc, Condvar};
use chrono::{offset::Local, DateTime};
use warp::{Buf, Filter};
#[cfg(feature = "http")]
use reqwest::Url;
-//use hyper_util::rt::TokioIo;
+#[cfg(feature = "http")]
use futures::future;
#[cfg(feature = "repl")]
use rustyline::{Config, Editor};
use std::collections::VecDeque;
-use std::io::{Cursor, Error, ErrorKind, Read};
+use std::io::{Cursor, Read};
+#[cfg(feature = "repl")]
+use std::io::{Error, ErrorKind};
use std::sync::Arc;
type SubtermDeque = VecDeque<(usize, usize)>;
}
static mut PROMPT: bool = false;
+#[cfg(feature = "repl")]
const HISTORY_FILE: &'static str = ".scryer_history";
pub(crate) fn set_prompt(value: bool) {
}
}
+#[cfg(feature = "repl")]
#[inline]
fn get_prompt() -> &'static str {
unsafe {
#[cfg(feature = "repl")]
rl: Editor<Helper, DefaultHistory>,
pending_input: CharReader<Cursor<String>>,
+ #[allow(dead_code)]
add_history: bool,
}
}
}
+ #[allow(unused_variables)]
pub fn set_atoms_for_completion(&mut self, atoms: &Arc<AtomTable>) {
#[cfg(feature = "repl")]
{
}
}
+ #[allow(dead_code)]
#[cfg(not(feature = "repl"))]
fn save_history(&mut self) {}