remove tendril dep and cmpd assignments

This commit is contained in:
gluax 2022-04-05 11:24:34 -07:00
parent 5353b33c1b
commit 4c7903f5c3
10 changed files with 1 additions and 122 deletions

43
Cargo.lock generated
View File

@ -672,16 +672,6 @@ version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 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]] [[package]]
name = "futures-channel" name = "futures-channel"
version = "0.3.19" version = "0.3.19"
@ -1079,7 +1069,6 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"smallvec", "smallvec",
"tendril",
] ]
[[package]] [[package]]
@ -1116,7 +1105,6 @@ dependencies = [
"eyre", "eyre",
"leo-span", "leo-span",
"serde", "serde",
"tendril",
"thiserror", "thiserror",
] ]
@ -1183,7 +1171,6 @@ dependencies = [
"serde_yaml", "serde_yaml",
"smallvec", "smallvec",
"structopt", "structopt",
"tendril",
"tracing", "tracing",
] ]
@ -1195,7 +1182,6 @@ dependencies = [
"indexmap", "indexmap",
"scoped-tls", "scoped-tls",
"serde", "serde",
"tendril",
] ]
[[package]] [[package]]
@ -1231,12 +1217,6 @@ dependencies = [
"cfg-if 1.0.0", "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]] [[package]]
name = "matches" name = "matches"
version = "0.1.9" version = "0.1.9"
@ -1384,12 +1364,6 @@ dependencies = [
"winapi 0.3.9", "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]] [[package]]
name = "nias" name = "nias"
version = "0.5.0" version = "0.5.0"
@ -2274,17 +2248,6 @@ dependencies = [
"winapi 0.3.9", "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]] [[package]]
name = "termcolor" name = "termcolor"
version = "1.1.2" version = "1.1.2"
@ -2590,12 +2553,6 @@ dependencies = [
"percent-encoding", "percent-encoding",
] ]
[[package]]
name = "utf-8"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
[[package]] [[package]]
name = "valuable" name = "valuable"
version = "0.1.0" version = "0.1.0"

View File

@ -41,9 +41,6 @@ features = [ "derive", "rc" ]
version = "1.0" version = "1.0"
features = [ "preserve_order" ] features = [ "preserve_order" ]
[dependencies.tendril]
version = "0.4"
[dev-dependencies.criterion] [dev-dependencies.criterion]
version = "0.3" version = "0.3"

View File

@ -48,9 +48,6 @@ version = "1.3.0"
version = "1.0" version = "1.0"
features = [ "derive" ] features = [ "derive" ]
[dependencies.tendril]
version = "0.4"
[dependencies.tracing] [dependencies.tracing]
version = "0.1" version = "0.1"

View File

@ -19,14 +19,7 @@ use super::*;
use leo_errors::{ParserError, Result}; use leo_errors::{ParserError, Result};
use leo_span::sym; use leo_span::sym;
const ASSIGN_TOKENS: &[Token] = &[ const ASSIGN_TOKENS: &[Token] = &[Token::Assign];
Token::Assign,
Token::AddEq,
Token::MinusEq,
Token::MulEq,
Token::DivEq,
Token::ExpEq,
];
impl ParserContext<'_> { impl ParserContext<'_> {
/// ///
@ -85,11 +78,6 @@ impl ParserContext<'_> {
assignee, assignee,
operation: match operator.token { operation: match operator.token {
Token::Assign => AssignOperation::Assign, 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"), _ => unreachable!("parse_assign_statement_ shouldn't produce this"),
}, },
value, value,

View File

@ -261,20 +261,12 @@ impl Token {
Some('*') => { Some('*') => {
input.next(); input.next();
if input.next_if_eq(&'*').is_some() { if input.next_if_eq(&'*').is_some() {
if input.next_if_eq(&'=').is_some() {
return Ok((3, Token::ExpEq));
}
return Ok((2, Token::Exp)); return Ok((2, Token::Exp));
} else if input.next_if_eq(&'=').is_some() {
return Ok((2, Token::MulEq));
} }
return Ok((1, Token::Mul)); return Ok((1, Token::Mul));
} }
Some('+') => { Some('+') => {
input.next(); input.next();
if input.next_if_eq(&'=').is_some() {
return Ok((2, Token::AddEq));
}
return Ok((1, Token::Add)); return Ok((1, Token::Add));
} }
Some(',') => { Some(',') => {
@ -285,8 +277,6 @@ impl Token {
input.next(); input.next();
if input.next_if_eq(&'>').is_some() { if input.next_if_eq(&'>').is_some() {
return Ok((2, Token::Arrow)); return Ok((2, Token::Arrow));
} else if input.next_if_eq(&'=').is_some() {
return Ok((2, Token::MinusEq));
} }
return Ok((1, Token::Minus)); 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 Err(ParserError::lexer_block_comment_does_not_close_before_eof(comment).into());
} }
return Ok((comment.len(), Token::CommentBlock(comment))); 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)); return Ok((1, Token::Div));
} }

View File

@ -76,11 +76,6 @@ pub enum Token {
Div, Div,
Exp, Exp,
Assign, Assign,
AddEq,
MinusEq,
MulEq,
DivEq,
ExpEq,
LeftParen, LeftParen,
RightParen, RightParen,
LeftSquare, LeftSquare,
@ -247,11 +242,6 @@ impl fmt::Display for Token {
Div => write!(f, "/"), Div => write!(f, "/"),
Exp => write!(f, "**"), Exp => write!(f, "**"),
Assign => write!(f, "="), Assign => write!(f, "="),
AddEq => write!(f, "+="),
MinusEq => write!(f, "-="),
MulEq => write!(f, "*="),
DivEq => write!(f, "/="),
ExpEq => write!(f, "**="),
LeftParen => write!(f, "("), LeftParen => write!(f, "("),
RightParen => write!(f, ")"), RightParen => write!(f, ")"),
LeftSquare => write!(f, "["), LeftSquare => write!(f, "["),

View File

@ -42,8 +42,5 @@ default-features = false
version = "1.0.133" version = "1.0.133"
features = [ "derive", "rc" ] features = [ "derive", "rc" ]
[dependencies.tendril]
version = "0.4.2"
[dependencies.thiserror] [dependencies.thiserror]
version = "1.0.30" version = "1.0.30"

View File

@ -31,6 +31,3 @@ features = [ "derive", "rc" ]
[dependencies.scoped-tls] [dependencies.scoped-tls]
version = "1.0.0" version = "1.0.0"
[dependencies.tendril]
version = "0.4.2"

View File

@ -23,5 +23,3 @@ pub mod span;
pub use span::Span; pub use span::Span;
pub mod span_json; pub mod span_json;
pub mod tendril_json;

View File

@ -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 <https://www.gnu.org/licenses/>.
//! 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<S: Serializer>(tendril: &StrTendril, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(tendril)
}
/// Deserialization for the StrTendril type.
pub fn deserialize<'de, D: Deserializer<'de>>(deserializer: D) -> Result<StrTendril, D::Error> {
Ok(String::deserialize(deserializer)?.into())
}