Update to current rust

This commit is contained in:
Greg Shuflin 2021-10-07 00:51:45 -07:00
parent a0955e07dc
commit 77bf42be6c
9 changed files with 350 additions and 364 deletions

697
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@ authors = ["greg <greg.shuflin@protonmail.com>"]
edition = "2018" edition = "2018"
[dependencies] [dependencies]
itertools = "0.8.0" itertools = "0.10"
take_mut = "0.2.2" take_mut = "0.2.2"
maplit = "1.0.1" maplit = "1.0.1"
lazy_static = "1.3.0" lazy_static = "1.3.0"

View File

@ -2,8 +2,6 @@ use std::rc::Rc;
use std::fmt::Write; use std::fmt::Write;
use std::io; use std::io;
use itertools::Itertools;
use crate::schala::SymbolTableHandle; use crate::schala::SymbolTableHandle;
use crate::util::ScopeStack; use crate::util::ScopeStack;
use crate::reduced_ast::{BoundVars, ReducedAST, Stmt, Expr, Lit, Func, Alternative, Subpattern}; use crate::reduced_ast::{BoundVars, ReducedAST, Stmt, Expr, Lit, Func, Alternative, Subpattern};

View File

@ -1,6 +1,6 @@
#![feature(trace_macros)] #![feature(trace_macros)]
//#![feature(unrestricted_attribute_tokens)] //#![feature(unrestricted_attribute_tokens)]
#![feature(slice_patterns, box_patterns, box_syntax)] #![feature(box_patterns, box_syntax)]
//! `schala-lang` is where the Schala programming language is actually implemented. //! `schala-lang` is where the Schala programming language is actually implemented.
//! It defines the `Schala` type, which contains the state for a Schala REPL, and implements //! It defines the `Schala` type, which contains the state for a Schala REPL, and implements

View File

@ -195,7 +195,7 @@ fn eval(input: reduced_ast::ReducedAST, handle: &mut Schala, comp: Option<&mut P
.collect(); .collect();
let eval_output: Result<String, String> = text_output let eval_output: Result<String, String> = text_output
.map(|v| { v.into_iter().intersperse(format!("\n")).collect() }); .map(|v| { Iterator::intersperse(v.into_iter(), "\n".to_owned()).collect() });
eval_output eval_output
} }

View File

@ -123,8 +123,7 @@ type CharData = (usize, usize, char);
pub fn tokenize(input: &str) -> Vec<Token> { pub fn tokenize(input: &str) -> Vec<Token> {
let mut tokens: Vec<Token> = Vec::new(); let mut tokens: Vec<Token> = Vec::new();
let mut input = input.lines().enumerate() let mut input = Iterator::intersperse(input.lines().enumerate(), (0, "\n"))
.intersperse((0, "\n"))
.flat_map(|(line_idx, ref line)| { .flat_map(|(line_idx, ref line)| {
line.chars().enumerate().map(move |(ch_idx, ch)| (line_idx, ch_idx, ch)) line.chars().enumerate().map(move |(ch_idx, ch)| (line_idx, ch_idx, ch))
}) })

View File

@ -7,7 +7,7 @@ edition = "2018"
[dependencies] [dependencies]
llvm-sys = "70.0.2" llvm-sys = "70.0.2"
take_mut = "0.2.2" take_mut = "0.2.2"
itertools = "0.5.8" itertools = "0.10"
getopts = "0.2.18" getopts = "0.2.18"
lazy_static = "0.2.8" lazy_static = "0.2.8"
maplit = "*" maplit = "*"

View File

@ -1,5 +1,4 @@
#![feature(link_args)] #![feature(box_patterns, box_syntax, proc_macro_hygiene, decl_macro)]
#![feature(slice_patterns, box_patterns, box_syntax, proc_macro_hygiene, decl_macro)]
#![feature(plugin)] #![feature(plugin)]
extern crate getopts; extern crate getopts;
extern crate linefeed; extern crate linefeed;

View File

@ -1,7 +1,6 @@
use super::{Repl, InterpreterDirectiveOutput}; use super::{Repl, InterpreterDirectiveOutput};
use crate::repl::help::help; use crate::repl::help::help;
use crate::language::{LangMetaRequest, LangMetaResponse, DebugAsk, DebugResponse}; use crate::language::{LangMetaRequest, LangMetaResponse, DebugAsk, DebugResponse};
use itertools::Itertools;
use std::fmt::Write as FmtWrite; use std::fmt::Write as FmtWrite;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]