Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions external-crates/move/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

#![forbid(unsafe_code)]

pub mod address;
pub mod character_sets;
pub mod display;
pub mod env;
pub mod error_bitset;
pub mod files;
pub mod interactive;
pub mod parser;
pub mod testing;
pub mod types;
pub mod values;

pub use move_core_types::parsing::address;
pub use move_core_types::parsing::parser;
pub use move_core_types::parsing::types;
pub use move_core_types::parsing::values;
1 change: 1 addition & 0 deletions external-crates/move/crates/move-core-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ bcs.workspace = true
leb128.workspace = true
thiserror.workspace = true
serde_with.workspace = true
num-bigint.workspace = true

[dev-dependencies]
proptest.workspace = true
Expand Down
1 change: 1 addition & 0 deletions external-crates/move/crates/move-core-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub mod language_storage;
pub mod metadata;
pub mod move_resource;
pub mod parser;
pub mod parsing;
#[cfg(any(test, feature = "fuzzing"))]
pub mod proptest_types;
pub mod resolver;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

use crate::parser::{parse_address_number, NumberFormat};
use crate::account_address::AccountAddress;
use crate::parsing::parser::{parse_address_number, NumberFormat};
use anyhow::anyhow;
use move_core_types::account_address::AccountAddress;
use num_bigint::BigUint;
use std::{fmt, hash::Hash};

Expand Down
10 changes: 10 additions & 0 deletions external-crates/move/crates/move-core-types/src/parsing/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (c) The Diem Core Contributors
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

#![forbid(unsafe_code)]

pub mod address;
pub mod parser;
pub mod types;
pub mod values;
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

use crate::{
use crate::parsing::{
address::{NumericalAddress, ParsedAddress},
types::{ParsedFqName, ParsedModuleId, ParsedStructType, ParsedType, TypeToken},
values::{ParsableValue, ParsedValue, ValueToken},
};
use anyhow::{anyhow, bail, Result};
use move_core_types::{
use crate::{
account_address::AccountAddress,
u256::{U256FromStrError, U256},
};
use anyhow::{anyhow, bail, Result};
use num_bigint::BigUint;
use std::{fmt::Display, iter::Peekable, num::ParseIntError};

Expand Down Expand Up @@ -460,12 +460,12 @@ pub fn parse_address_number(s: &str) -> Option<([u8; AccountAddress::LENGTH], Nu

#[cfg(test)]
mod tests {
use crate::{
use crate::parsing::{
address::{NumericalAddress, ParsedAddress},
types::{ParsedStructType, ParsedType},
values::ParsedValue,
};
use move_core_types::{account_address::AccountAddress, identifier::Identifier, u256::U256};
use crate::{account_address::AccountAddress, identifier::Identifier, u256::U256};
use proptest::prelude::*;
use proptest::proptest;

Expand Down Expand Up @@ -516,7 +516,7 @@ mod tests {
AccountAddress::from_hex_literal("0x0")
.unwrap()
.into_bytes(),
crate::parser::NumberFormat::Hex,
crate::parsing::parser::NumberFormat::Hex,
))),
),
(
Expand All @@ -525,7 +525,7 @@ mod tests {
AccountAddress::from_hex_literal("0x0")
.unwrap()
.into_bytes(),
crate::parser::NumberFormat::Hex,
crate::parsing::parser::NumberFormat::Hex,
))),
),
(
Expand All @@ -534,7 +534,7 @@ mod tests {
AccountAddress::from_hex_literal("0x54afa3526")
.unwrap()
.into_bytes(),
crate::parser::NumberFormat::Hex,
crate::parsing::parser::NumberFormat::Hex,
))),
),
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

use std::fmt::{self, Display};

use anyhow::bail;
use move_core_types::{
use crate::{
account_address::AccountAddress,
identifier::{self, Identifier},
language_storage::{ModuleId, StructTag, TypeTag},
};
use anyhow::bail;

use crate::{address::ParsedAddress, parser::Token};
use crate::parsing::{address::ParsedAddress, parser::Token};

#[derive(Eq, PartialEq, Debug, Clone, Copy)]
pub enum TypeToken {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

use crate::{
use crate::parsing::{
address::ParsedAddress,
parser::{Parser, Token},
};
use anyhow::bail;
use move_core_types::{
use crate::{
account_address::AccountAddress,
identifier,
runtime_value::{MoveStruct, MoveValue},
};
use anyhow::bail;
use std::fmt::{self, Display};

#[derive(Eq, PartialEq, Debug, Clone, Copy)]
Expand Down Expand Up @@ -39,13 +39,13 @@ pub enum ValueToken {
#[derive(Eq, PartialEq, Debug, Clone)]
pub enum ParsedValue<Extra: ParsableValue = ()> {
Address(ParsedAddress),
InferredNum(move_core_types::u256::U256),
InferredNum(crate::u256::U256),
U8(u8),
U16(u16),
U32(u32),
U64(u64),
U128(u128),
U256(move_core_types::u256::U256),
U256(crate::u256::U256),
Bool(bool),
Vector(Vec<ParsedValue<Extra>>),
Struct(Vec<ParsedValue<Extra>>),
Expand Down
Loading