Skip to content

Commit

Permalink
fix(evaluator): fix padding argument in yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
CertainLach committed Aug 26, 2020
1 parent 0f6b269 commit 0bd0b86
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions crates/jrsonnet-evaluator/src/val.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{
native::NativeCallback,
throw, with_state, Context, ObjValue, Result,
};
use jrsonnet_parser::{el, Arg, ArgsDesc, Expr, ExprLocation, LocExpr, ParamsDesc};
use jrsonnet_parser::{el, Arg, ArgsDesc, Expr, ExprLocation, LiteralType, LocExpr, ParamsDesc};
use std::{
cell::RefCell,
collections::HashMap,
Expand Down Expand Up @@ -431,7 +431,14 @@ impl Val {
)),
ArgsDesc(vec![
Arg(None, el!(Expr::Var("__tmp__to_json__".into()))),
Arg(None, el!(Expr::Str(" ".repeat(padding).into())))
Arg(
None,
el!(Expr::Literal(if padding != 0 {
LiteralType::True
} else {
LiteralType::False
}))
)
]),
false
)),
Expand Down

0 comments on commit 0bd0b86

Please sign in to comment.