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 and zanieb committed Jul 17, 2023
1 parent f39a6de commit dc8f422
Show file tree
Hide file tree
Showing 13 changed files with 1,356 additions and 1,293 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 @@ -1087,8 +1087,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
2,606 changes: 1,331 additions & 1,275 deletions parser/src/python.rs

Large diffs are not rendered by default.

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

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

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

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

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

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

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

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

0 comments on commit dc8f422

Please sign in to comment.