rust-peg parser updates #2

Merged
gburd merged 4 commits from gburd/update-peg-dep into master 2020-01-23 16:19:25 +00:00
2 changed files with 5 additions and 5 deletions
Showing only changes of commit ef1c196516 - Show all commits

View file

@ -14,7 +14,7 @@ chrono = "0.4"
itertools = "0.8"
num = "0.2"
ordered-float = "1.0"
pretty = "0.2"
pretty = "0.9"
uuid = { version = "0.8", features = ["v4", "serde"] }
serde = { version = "1.0", optional = true }
serde_derive = { version = "1.0", optional = true }

View file

@ -56,11 +56,11 @@ impl Value {
I: IntoIterator<Item = &'a Value>,
{
let open = open.into();
let n = open.len();// as isize;
let n = open.len() as isize;
let i = vs
.into_iter()
.map(|v| v.as_doc(allocator))
.intersperse(allocator.space());
.intersperse(allocator.line());
allocator
.text(open)
.append(allocator.concat(i).nest(n))
@ -84,8 +84,8 @@ impl Value {
let xs = vs
.iter()
.rev()
.map(|(k, v)| k.as_doc(pp).append(pp.space()).append(v.as_doc(pp)).group())
.intersperse(pp.space());
.map(|(k, v)| k.as_doc(pp).append(pp.line()).append(v.as_doc(pp)).group())
.intersperse(pp.line());
pp.text("{")
.append(pp.concat(xs).nest(1))
.append(pp.text("}"))