merge with master

This commit is contained in:
Mark Thom
2020-04-05 20:33:45 -06:00
5 changed files with 1277 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
extern crate crossterm;
#[macro_use]
extern crate downcast;
extern crate git_version;
extern crate indexmap;
#[macro_use]
extern crate lazy_static;
@@ -11,6 +12,7 @@ extern crate prolog_parser;
#[macro_use]
extern crate ref_thread_local;
use git_version::git_version;
use nix::sys::signal;
mod prolog;
@@ -19,6 +21,7 @@ use crate::prolog::machine::*;
use crate::prolog::machine::streams::*;
use crate::prolog::read::*;
use std::env;
use std::sync::atomic::Ordering;
extern fn handle_sigint(signal: libc::c_int) {
@@ -32,6 +35,11 @@ fn main() {
let handler = signal::SigHandler::Handler(handle_sigint);
unsafe { signal::signal(signal::Signal::SIGINT, handler) }.unwrap();
if env::args().skip(1).any(|a| a == "-v" || a == "--version") {
println!("{:}", git_version!());
return;
}
let mut wam = Machine::new(readline::input_stream(), Stream::stdout());
wam.run_top_level();
}

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
*
* find_min_time/2 solves a problem sometimes posed in the first round
* of Google interviews: given a time of day in 24 H format, what is the
* lexographically least permutation of the time that is itself a
* lexicographically least permutation of the time that is itself a
* valid time in 24 H format?
*
* Full generality is achieved using the reif library.