rust-peg parser updates #2
2 changed files with 5 additions and 5 deletions
|
@ -14,7 +14,7 @@ chrono = "0.4"
|
||||||
itertools = "0.8"
|
itertools = "0.8"
|
||||||
num = "0.2"
|
num = "0.2"
|
||||||
ordered-float = "1.0"
|
ordered-float = "1.0"
|
||||||
pretty = "0.2"
|
pretty = "0.9"
|
||||||
uuid = { version = "0.8", features = ["v4", "serde"] }
|
uuid = { version = "0.8", features = ["v4", "serde"] }
|
||||||
serde = { version = "1.0", optional = true }
|
serde = { version = "1.0", optional = true }
|
||||||
serde_derive = { version = "1.0", optional = true }
|
serde_derive = { version = "1.0", optional = true }
|
||||||
|
|
|
@ -56,11 +56,11 @@ impl Value {
|
||||||
I: IntoIterator<Item = &'a Value>,
|
I: IntoIterator<Item = &'a Value>,
|
||||||
{
|
{
|
||||||
let open = open.into();
|
let open = open.into();
|
||||||
let n = open.len();// as isize;
|
let n = open.len() as isize;
|
||||||
let i = vs
|
let i = vs
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|v| v.as_doc(allocator))
|
.map(|v| v.as_doc(allocator))
|
||||||
.intersperse(allocator.space());
|
.intersperse(allocator.line());
|
||||||
allocator
|
allocator
|
||||||
.text(open)
|
.text(open)
|
||||||
.append(allocator.concat(i).nest(n))
|
.append(allocator.concat(i).nest(n))
|
||||||
|
@ -84,8 +84,8 @@ impl Value {
|
||||||
let xs = vs
|
let xs = vs
|
||||||
.iter()
|
.iter()
|
||||||
.rev()
|
.rev()
|
||||||
.map(|(k, v)| k.as_doc(pp).append(pp.space()).append(v.as_doc(pp)).group())
|
.map(|(k, v)| k.as_doc(pp).append(pp.line()).append(v.as_doc(pp)).group())
|
||||||
.intersperse(pp.space());
|
.intersperse(pp.line());
|
||||||
pp.text("{")
|
pp.text("{")
|
||||||
.append(pp.concat(xs).nest(1))
|
.append(pp.concat(xs).nest(1))
|
||||||
.append(pp.text("}"))
|
.append(pp.text("}"))
|
||||||
|
|
Loading…
Reference in a new issue