just/src/main.rs

86 lines
2.0 KiB
Rust
Raw Normal View History

2017-11-16 23:30:08 -08:00
#[macro_use]
extern crate lazy_static;
extern crate ansi_term;
extern crate brev;
extern crate clap;
extern crate edit_distance;
extern crate itertools;
extern crate libc;
extern crate regex;
extern crate tempdir;
extern crate unicode_width;
2017-11-17 17:28:06 -08:00
mod assignment_evaluator;
mod assignment_resolver;
2017-11-16 23:30:08 -08:00
mod color;
2017-11-17 17:28:06 -08:00
mod command_ext;
2017-11-16 23:30:08 -08:00
mod compilation_error;
mod configuration;
2017-11-17 17:28:06 -08:00
mod cooked_string;
2017-11-16 23:30:08 -08:00
mod expression;
mod fragment;
2017-11-17 17:28:06 -08:00
mod justfile;
mod misc;
mod parameter;
mod parser;
mod platform;
2017-11-16 23:30:08 -08:00
mod range_ext;
2017-11-17 17:28:06 -08:00
mod recipe;
mod recipe_resolver;
mod run;
mod runtime_error;
mod shebang;
mod token;
mod tokenizer;
2017-11-16 23:30:08 -08:00
#[cfg(test)] mod testing;
use tokenizer::tokenize;
mod common {
pub use std::borrow::Cow;
pub use std::collections::{BTreeMap as Map, BTreeSet as Set};
pub use std::fmt::Display;
pub use std::io::prelude::*;
pub use std::ops::Range;
pub use std::path::{Path, PathBuf};
pub use std::process::Command;
pub use std::{cmp, env, fs, fmt, io, iter, process, vec, usize};
pub use color::Color;
pub use libc::{EXIT_FAILURE, EXIT_SUCCESS};
pub use regex::Regex;
pub use tempdir::TempDir;
pub use assignment_evaluator::AssignmentEvaluator;
pub use assignment_resolver::AssignmentResolver;
2017-11-16 23:30:08 -08:00
pub use command_ext::CommandExt;
2017-11-17 17:28:06 -08:00
pub use compilation_error::{CompilationError, CompilationErrorKind, CompilationResult};
2017-11-16 23:30:08 -08:00
pub use configuration::Configuration;
pub use cooked_string::CookedString;
pub use expression::Expression;
pub use fragment::Fragment;
pub use justfile::Justfile;
pub use misc::{default, empty};
pub use parameter::Parameter;
pub use parser::Parser;
pub use range_ext::RangeExt;
2017-11-16 23:30:08 -08:00
pub use recipe::Recipe;
pub use recipe_resolver::RecipeResolver;
2017-11-17 17:28:06 -08:00
pub use runtime_error::{RuntimeError, RunResult};
2017-11-16 23:30:08 -08:00
pub use shebang::Shebang;
pub use token::{Token, TokenKind};
}
use common::*;
2017-11-17 17:28:06 -08:00
fn compile(text: &str) -> CompilationResult<Justfile> {
2017-11-16 23:30:08 -08:00
let tokens = tokenize(text)?;
let parser = Parser::new(text, tokens);
parser.justfile()
}
2016-06-16 17:13:43 -07:00
2016-10-02 15:31:28 -07:00
fn main() {
2017-11-16 23:30:08 -08:00
run::run();
2016-06-16 17:13:43 -07:00
}