mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-09 22:25:23 +00:00
Add optional serde dependency
This commit is contained in:
parent
969ea23d67
commit
713dd2b91e
3 changed files with 7 additions and 0 deletions
|
@ -13,5 +13,6 @@ bstr = { workspace = true }
|
||||||
itertools = { workspace = true }
|
itertools = { workspace = true }
|
||||||
num-bigint = { workspace = true }
|
num-bigint = { workspace = true }
|
||||||
num-complex = { workspace = true }
|
num-complex = { workspace = true }
|
||||||
|
serde = { version = "1.0.133", optional = true, default-features = false }
|
||||||
|
|
||||||
lz4_flex = "0.9.2"
|
lz4_flex = "0.9.2"
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
|
#[cfg(feature = "serde")]
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
/// Sourcecode location.
|
/// Sourcecode location.
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
|
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||||
pub struct Location {
|
pub struct Location {
|
||||||
pub(super) row: u32,
|
pub(super) row: u32,
|
||||||
pub(super) column: u32,
|
pub(super) column: u32,
|
||||||
|
|
|
@ -10,6 +10,7 @@ edition = "2021"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["lalrpop"] # removing this causes potential build failure
|
default = ["lalrpop"] # removing this causes potential build failure
|
||||||
|
serde = ["dep:serde", "rustpython-compiler-core/serde"]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
anyhow = { workspace = true }
|
anyhow = { workspace = true }
|
||||||
|
@ -33,6 +34,7 @@ unic-ucd-ident = "0.9.0"
|
||||||
lalrpop-util = "0.19.8"
|
lalrpop-util = "0.19.8"
|
||||||
phf = "0.11.1"
|
phf = "0.11.1"
|
||||||
rustc-hash = "1.1.0"
|
rustc-hash = "1.1.0"
|
||||||
|
serde = { version = "1.0.133", optional = true, default-features = false }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
insta = { workspace = true }
|
insta = { workspace = true }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue