git.delta.rocks / jrsonnet / refs/commits / 00b4f053911b

difftreelog

Merge branch 'master' of github.com:CertainLach/jrsonnet into type-safety

Yaroslav Bolyukin2021-01-24parents: #3fc6c25 #847c11f.patch.diff
in: master

3 files changed

modifiedcmds/jrsonnet/src/main.rsdiffbeforeafterboth
136 let mut file = File::create(path)?;136 let mut file = File::create(path)?;
137 writeln!(file, "{}", state.manifest(val)?)?;137 writeln!(file, "{}", state.manifest(val)?)?;
138 } else {138 } else {
139 println!("{}", state.manifest(val)?);139 let output = state.manifest(val)?;
140 if !output.is_empty() {
141 println!("{}", output);
142 }
140 }143 }
141144
142 Ok(())145 Ok(())
modifiedcrates/jrsonnet-evaluator/src/builtin/manifest.rsdiffbeforeafterboth
74 } else if mtype == ManifestType::Std {74 } else if mtype == ManifestType::Std {
75 buf.push_str("\n\n");75 buf.push_str("\n\n");
76 buf.push_str(cur_padding);76 buf.push_str(cur_padding);
77 } else if mtype == ManifestType::ToString {77 } else if mtype == ManifestType::ToString || mtype == ManifestType::Manifest {
78 buf.push(' ');78 buf.push(' ');
79 }79 }
80 buf.push(']');80 buf.push(']');
112 } else if mtype == ManifestType::Std {112 } else if mtype == ManifestType::Std {
113 buf.push_str("\n\n");113 buf.push_str("\n\n");
114 buf.push_str(cur_padding);114 buf.push_str(cur_padding);
115 } else if mtype == ManifestType::ToString {115 } else if mtype == ManifestType::ToString || mtype == ManifestType::Manifest {
116 buf.push(' ');116 buf.push(' ');
117 }117 }
118 buf.push('}');118 buf.push('}');
modifiedcrates/jrsonnet-evaluator/src/builtin/mod.rsdiffbeforeafterboth
378 0, from: ty!(number) => Val::Num;378 0, from: ty!(number) => Val::Num;
379 1, to: ty!(number) => Val::Num;379 1, to: ty!(number) => Val::Num;
380 ], {380 ], {
381 if to < from {
382 return Ok(Val::Arr(Rc::new(Vec::new())))
383 }
381 let mut out = Vec::with_capacity((1+to as usize-from as usize).max(0));384 let mut out = Vec::with_capacity((1+to as usize-from as usize).max(0));
382 for i in from as usize..=to as usize {385 for i in from as usize..=to as usize {
383 out.push(Val::Num(i as f64));386 out.push(Val::Num(i as f64));