Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.

Commit db0735c

Browse files
committed
Fix ArgWithDefault TextRange
1 parent f0d200c commit db0735c

13 files changed

+12503
-5411
lines changed

ast/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ mod ranged;
2222

2323
#[cfg(feature = "malachite-bigint")]
2424
pub use malachite_bigint as bigint;
25-
#[cfg(feature = "num-bigint")]
25+
#[cfg(all(feature = "num-bigint", not(feature = "malachite-bigint")))]
2626
pub use num_bigint as bigint;
2727

2828
pub use builtin::*;

format/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ itertools = "0.10.5"
1515
num-traits = { workspace = true }
1616
num-bigint = { workspace = true, optional = true }
1717
malachite-bigint = { workspace = true, optional = true }
18+
19+
[features]
20+
default = ["malachite-bigint"]

format/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[cfg(feature = "malachite-bigint")]
22
pub use malachite_bigint as bigint;
3-
#[cfg(feature = "num-bigint")]
3+
#[cfg(all(feature = "num-bigint", not(feature = "malachite-bigint")))]
44
pub use num_bigint as bigint;
55

66
pub use crate::format::*;

parser/src/python.lalrpop

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,8 +1067,12 @@ ParameterDefs<ArgType>: (Vec<ast::ArgWithDefault>, Vec<ast::ArgWithDefault>) = {
10671067

10681068
ParameterDef<ArgType>: ast::ArgWithDefault = {
10691069
<i:ArgType> => i,
1070-
<mut i:ArgType> "=" <e:Test<"all">> => {
1070+
<mut i:ArgType> "=" <e:Test<"all">> <end_location:@R> => {
10711071
i.default = Some(Box::new(e));
1072+
#[cfg(feature = "all-nodes-with-ranges")]
1073+
{
1074+
i.range = optional_range(i.range.start(), end_location);
1075+
}
10721076
i
10731077
},
10741078
};

0 commit comments

Comments
 (0)