mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-24 07:48:04 +03:00
remove tendril dep and cmpd assignments
This commit is contained in:
parent
5353b33c1b
commit
4c7903f5c3
43
Cargo.lock
generated
43
Cargo.lock
generated
@ -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"
|
||||
|
@ -41,9 +41,6 @@ features = [ "derive", "rc" ]
|
||||
version = "1.0"
|
||||
features = [ "preserve_order" ]
|
||||
|
||||
[dependencies.tendril]
|
||||
version = "0.4"
|
||||
|
||||
[dev-dependencies.criterion]
|
||||
version = "0.3"
|
||||
|
||||
|
@ -48,9 +48,6 @@ version = "1.3.0"
|
||||
version = "1.0"
|
||||
features = [ "derive" ]
|
||||
|
||||
[dependencies.tendril]
|
||||
version = "0.4"
|
||||
|
||||
[dependencies.tracing]
|
||||
version = "0.1"
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -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, "["),
|
||||
|
@ -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"
|
||||
|
@ -31,6 +31,3 @@ features = [ "derive", "rc" ]
|
||||
|
||||
[dependencies.scoped-tls]
|
||||
version = "1.0.0"
|
||||
|
||||
[dependencies.tendril]
|
||||
version = "0.4.2"
|
||||
|
@ -23,5 +23,3 @@ pub mod span;
|
||||
pub use span::Span;
|
||||
|
||||
pub mod span_json;
|
||||
|
||||
pub mod tendril_json;
|
||||
|
@ -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())
|
||||
}
|
Loading…
Reference in New Issue
Block a user