From 4c7903f5c384957d3e44dad766405383e92b9bdf Mon Sep 17 00:00:00 2001 From: gluax Date: Tue, 5 Apr 2022 11:24:34 -0700 Subject: [PATCH] remove tendril dep and cmpd assignments --- Cargo.lock | 43 ------------------------- compiler/ast/Cargo.toml | 3 -- compiler/parser/Cargo.toml | 3 -- compiler/parser/src/parser/statement.rs | 14 +------- compiler/parser/src/tokenizer/lexer.rs | 12 ------- compiler/parser/src/tokenizer/token.rs | 10 ------ leo/errors/Cargo.toml | 3 -- leo/span/Cargo.toml | 3 -- leo/span/src/lib.rs | 2 -- leo/span/src/tendril_json.rs | 30 ----------------- 10 files changed, 1 insertion(+), 122 deletions(-) delete mode 100644 leo/span/src/tendril_json.rs diff --git a/Cargo.lock b/Cargo.lock index 2fd675137b..6c2e792b01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -672,16 +672,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -[[package]] -name = "futf" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c9c1ce3fa9336301af935ab852c437817d14cd33690446569392e65170aac3b" -dependencies = [ - "mac", - "new_debug_unreachable", -] - [[package]] name = "futures-channel" version = "0.3.19" @@ -1079,7 +1069,6 @@ dependencies = [ "serde", "serde_json", "smallvec", - "tendril", ] [[package]] @@ -1116,7 +1105,6 @@ dependencies = [ "eyre", "leo-span", "serde", - "tendril", "thiserror", ] @@ -1183,7 +1171,6 @@ dependencies = [ "serde_yaml", "smallvec", "structopt", - "tendril", "tracing", ] @@ -1195,7 +1182,6 @@ dependencies = [ "indexmap", "scoped-tls", "serde", - "tendril", ] [[package]] @@ -1231,12 +1217,6 @@ dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "mac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" - [[package]] name = "matches" version = "0.1.9" @@ -1384,12 +1364,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "new_debug_unreachable" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" - [[package]] name = "nias" version = "0.5.0" @@ -2274,17 +2248,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "tendril" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ef557cb397a4f0a5a3a628f06515f78563f2209e64d47055d9dc6052bf5e33" -dependencies = [ - "futf", - "mac", - "utf-8", -] - [[package]] name = "termcolor" version = "1.1.2" @@ -2590,12 +2553,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - [[package]] name = "valuable" version = "0.1.0" diff --git a/compiler/ast/Cargo.toml b/compiler/ast/Cargo.toml index 748d65c171..d4193ad5f0 100644 --- a/compiler/ast/Cargo.toml +++ b/compiler/ast/Cargo.toml @@ -41,9 +41,6 @@ features = [ "derive", "rc" ] version = "1.0" features = [ "preserve_order" ] -[dependencies.tendril] -version = "0.4" - [dev-dependencies.criterion] version = "0.3" diff --git a/compiler/parser/Cargo.toml b/compiler/parser/Cargo.toml index 9003397d8b..4b5ff2ccaa 100644 --- a/compiler/parser/Cargo.toml +++ b/compiler/parser/Cargo.toml @@ -48,9 +48,6 @@ version = "1.3.0" version = "1.0" features = [ "derive" ] -[dependencies.tendril] -version = "0.4" - [dependencies.tracing] version = "0.1" diff --git a/compiler/parser/src/parser/statement.rs b/compiler/parser/src/parser/statement.rs index ce2fdaa0a6..354257738c 100644 --- a/compiler/parser/src/parser/statement.rs +++ b/compiler/parser/src/parser/statement.rs @@ -19,14 +19,7 @@ use super::*; use leo_errors::{ParserError, Result}; use leo_span::sym; -const ASSIGN_TOKENS: &[Token] = &[ - Token::Assign, - Token::AddEq, - Token::MinusEq, - Token::MulEq, - Token::DivEq, - Token::ExpEq, -]; +const ASSIGN_TOKENS: &[Token] = &[Token::Assign]; impl ParserContext<'_> { /// @@ -85,11 +78,6 @@ impl ParserContext<'_> { assignee, operation: match operator.token { Token::Assign => AssignOperation::Assign, - Token::AddEq => AssignOperation::Add, - Token::MinusEq => AssignOperation::Sub, - Token::MulEq => AssignOperation::Mul, - Token::DivEq => AssignOperation::Div, - Token::ExpEq => AssignOperation::Pow, _ => unreachable!("parse_assign_statement_ shouldn't produce this"), }, value, diff --git a/compiler/parser/src/tokenizer/lexer.rs b/compiler/parser/src/tokenizer/lexer.rs index f8f87ae77c..68932ca5aa 100644 --- a/compiler/parser/src/tokenizer/lexer.rs +++ b/compiler/parser/src/tokenizer/lexer.rs @@ -261,20 +261,12 @@ impl Token { Some('*') => { input.next(); if input.next_if_eq(&'*').is_some() { - if input.next_if_eq(&'=').is_some() { - return Ok((3, Token::ExpEq)); - } return Ok((2, Token::Exp)); - } else if input.next_if_eq(&'=').is_some() { - return Ok((2, Token::MulEq)); } return Ok((1, Token::Mul)); } Some('+') => { input.next(); - if input.next_if_eq(&'=').is_some() { - return Ok((2, Token::AddEq)); - } return Ok((1, Token::Add)); } Some(',') => { @@ -285,8 +277,6 @@ impl Token { input.next(); if input.next_if_eq(&'>').is_some() { return Ok((2, Token::Arrow)); - } else if input.next_if_eq(&'=').is_some() { - return Ok((2, Token::MinusEq)); } return Ok((1, Token::Minus)); } @@ -333,8 +323,6 @@ impl Token { return Err(ParserError::lexer_block_comment_does_not_close_before_eof(comment).into()); } return Ok((comment.len(), Token::CommentBlock(comment))); - } else if input.next_if_eq(&'=').is_some() { - return Ok((2, Token::DivEq)); } return Ok((1, Token::Div)); } diff --git a/compiler/parser/src/tokenizer/token.rs b/compiler/parser/src/tokenizer/token.rs index f4f3fed866..a4d1f039ac 100644 --- a/compiler/parser/src/tokenizer/token.rs +++ b/compiler/parser/src/tokenizer/token.rs @@ -76,11 +76,6 @@ pub enum Token { Div, Exp, Assign, - AddEq, - MinusEq, - MulEq, - DivEq, - ExpEq, LeftParen, RightParen, LeftSquare, @@ -247,11 +242,6 @@ impl fmt::Display for Token { Div => write!(f, "/"), Exp => write!(f, "**"), Assign => write!(f, "="), - AddEq => write!(f, "+="), - MinusEq => write!(f, "-="), - MulEq => write!(f, "*="), - DivEq => write!(f, "/="), - ExpEq => write!(f, "**="), LeftParen => write!(f, "("), RightParen => write!(f, ")"), LeftSquare => write!(f, "["), diff --git a/leo/errors/Cargo.toml b/leo/errors/Cargo.toml index db0b886495..7cf8d2406d 100644 --- a/leo/errors/Cargo.toml +++ b/leo/errors/Cargo.toml @@ -42,8 +42,5 @@ default-features = false version = "1.0.133" features = [ "derive", "rc" ] -[dependencies.tendril] -version = "0.4.2" - [dependencies.thiserror] version = "1.0.30" diff --git a/leo/span/Cargo.toml b/leo/span/Cargo.toml index f6b8744bf6..4bf317337a 100644 --- a/leo/span/Cargo.toml +++ b/leo/span/Cargo.toml @@ -31,6 +31,3 @@ features = [ "derive", "rc" ] [dependencies.scoped-tls] version = "1.0.0" - -[dependencies.tendril] -version = "0.4.2" diff --git a/leo/span/src/lib.rs b/leo/span/src/lib.rs index 85d52015b3..6851878fbe 100644 --- a/leo/span/src/lib.rs +++ b/leo/span/src/lib.rs @@ -23,5 +23,3 @@ pub mod span; pub use span::Span; pub mod span_json; - -pub mod tendril_json; diff --git a/leo/span/src/tendril_json.rs b/leo/span/src/tendril_json.rs deleted file mode 100644 index 5f2194ab4c..0000000000 --- a/leo/span/src/tendril_json.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2019-2022 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -//! Provides logic for serializing and deserializing the `StrTendril` type. - -use serde::{Deserialize, Deserializer, Serializer}; -use tendril::StrTendril; - -/// Serialization for the StrTendril type. -pub fn serialize(tendril: &StrTendril, serializer: S) -> Result { - serializer.serialize_str(tendril) -} - -/// Deserialization for the StrTendril type. -pub fn deserialize<'de, D: Deserializer<'de>>(deserializer: D) -> Result { - Ok(String::deserialize(deserializer)?.into()) -}