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

Commit

Permalink
Fix ArgWithDefault TextRange (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser authored Jun 20, 2023
1 parent ed3b4eb commit 08ebbe4
Show file tree
Hide file tree
Showing 13 changed files with 12,521 additions and 5,423 deletions.
2 changes: 1 addition & 1 deletion ast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mod ranged;

#[cfg(feature = "malachite-bigint")]
pub use malachite_bigint as bigint;
#[cfg(feature = "num-bigint")]
#[cfg(all(feature = "num-bigint", not(feature = "malachite-bigint")))]
pub use num_bigint as bigint;

pub use builtin::*;
Expand Down
3 changes: 3 additions & 0 deletions format/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ itertools = "0.10.5"
num-traits = { workspace = true }
num-bigint = { workspace = true, optional = true }
malachite-bigint = { workspace = true, optional = true }

[features]
default = ["malachite-bigint"]
2 changes: 1 addition & 1 deletion format/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(feature = "malachite-bigint")]
pub use malachite_bigint as bigint;
#[cfg(feature = "num-bigint")]
#[cfg(all(feature = "num-bigint", not(feature = "malachite-bigint")))]
pub use num_bigint as bigint;

pub use crate::format::*;
Expand Down
6 changes: 5 additions & 1 deletion parser/src/python.lalrpop
Original file line number Diff line number Diff line change
Expand Up @@ -1067,8 +1067,12 @@ ParameterDefs<ArgType>: (Vec<ast::ArgWithDefault>, Vec<ast::ArgWithDefault>) = {

ParameterDef<ArgType>: ast::ArgWithDefault = {
<i:ArgType> => i,
<mut i:ArgType> "=" <e:Test<"all">> => {
<mut i:ArgType> "=" <e:Test<"all">> <end_location:@R> => {
i.default = Some(Box::new(e));
#[cfg(feature = "all-nodes-with-ranges")]
{
i.range = optional_range(i.range.start(), end_location);
}
i
},
};
Expand Down
Loading

0 comments on commit 08ebbe4

Please sign in to comment.