git.delta.rocks / jrsonnet / refs/commits / a3646b331c9c

difftreelog

style fix formatting

wsyrkszxYaroslav Bolyukin2026-04-25parent: #112adb2.patch.diff
in: master

31 files changed

modifiedcrates/jrsonnet-evaluator/src/analyze.rsdiffbeforeafterboth
21use jrsonnet_gcmodule::Acyclic;21use jrsonnet_gcmodule::Acyclic;
22use jrsonnet_interner::IStr;22use jrsonnet_interner::IStr;
23use jrsonnet_ir::{23use jrsonnet_ir::{
24 function::FunctionSignature, ArgsDesc, AssertExpr, AssertStmt, BinaryOp, BinaryOpType,24 ArgsDesc, AssertExpr, AssertStmt, BinaryOp, BinaryOpType, BindSpec, CompSpec, Destruct, Expr,
25 BindSpec, CompSpec, Destruct, Expr, ExprParams, FieldName, ForSpecData, IfElse, IfSpecData,25 ExprParams, FieldName, ForSpecData, IfElse, IfSpecData, ImportKind, LiteralType, NumValue,
26 ImportKind, LiteralType, NumValue, ObjBody, ObjComp, ObjMembers, Slice, SliceDesc, Span,26 ObjBody, ObjComp, ObjMembers, Slice, SliceDesc, Span, Spanned, UnaryOpType, Visibility,
27 Spanned, UnaryOpType, Visibility,27 function::FunctionSignature,
28};28};
29use rustc_hash::FxHashMap;29use rustc_hash::FxHashMap;
30use smallvec::SmallVec;30use smallvec::SmallVec;
modifiedcrates/jrsonnet-evaluator/src/arr/mod.rsdiffbeforeafterboth
5 rc::Rc,5 rc::Rc,
6};6};
77
8use jrsonnet_gcmodule::{cc_dyn, Cc};8use jrsonnet_gcmodule::{Cc, cc_dyn};
99
10use crate::{analyze::LExpr, function::NativeFn, typed::IntoUntyped, Context, Result, Thunk, Val};10use crate::{Context, Result, Thunk, Val, analyze::LExpr, function::NativeFn, typed::IntoUntyped};
1111
12mod spec;12mod spec;
13pub use spec::{ArrayLike, *};13pub use spec::{ArrayLike, *};
modifiedcrates/jrsonnet-evaluator/src/arr/spec.rsdiffbeforeafterboth
1111
12use super::ArrValue;12use super::ArrValue;
13use crate::{13use crate::{
14 Context, Error, ObjValue, Result, Thunk, Val,
14 analyze::LExpr,15 analyze::LExpr,
15 error::ErrorKind::InfiniteRecursionDetected,16 error::ErrorKind::InfiniteRecursionDetected,
16 evaluate::evaluate,17 evaluate::evaluate,
17 function::NativeFn,18 function::NativeFn,
18 typed::{IntoUntyped, Typed},19 typed::{IntoUntyped, Typed},
19 val::ThunkValue,20 val::ThunkValue,
20 Context, Error, ObjValue, Result, Thunk, Val,
21};21};
2222
23pub trait ArrayLike: Any + Trace + Debug {23pub trait ArrayLike: Any + Trace + Debug {
modifiedcrates/jrsonnet-evaluator/src/ctx.rsdiffbeforeafterboth
4use jrsonnet_gcmodule::{Cc, Trace};4use jrsonnet_gcmodule::{Cc, Trace};
5use jrsonnet_interner::IStr;5use jrsonnet_interner::IStr;
66
7use crate::{analyze::LocalId, error, error::ErrorKind::*, Pending, Result, SupThis, Thunk, Val};7use crate::{Pending, Result, SupThis, Thunk, Val, analyze::LocalId, error, error::ErrorKind::*};
88
9#[derive(Debug, Trace, Clone, Educe)]9#[derive(Debug, Trace, Clone, Educe)]
10#[educe(PartialEq)]10#[educe(PartialEq)]
modifiedcrates/jrsonnet-evaluator/src/error.rsdiffbeforeafterboth
9use thiserror::Error;9use thiserror::Error;
1010
11use crate::{11use crate::{
12 ObjValue, ResolvePathOwned,
12 function::{CallLocation, FunctionSignature, ParamName},13 function::{CallLocation, FunctionSignature, ParamName},
13 stdlib::format::FormatError,14 stdlib::format::FormatError,
14 typed::TypeLocError,15 typed::TypeLocError,
15 ObjValue, ResolvePathOwned,
16};16};
1717
18#[derive(Debug, Clone, Acyclic)]18#[derive(Debug, Clone, Acyclic)]
286}286}
287impl fmt::Display for Error {287impl fmt::Display for Error {
288 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {288 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
289 writeln!(f, "{}", self.0 .0)?;289 writeln!(f, "{}", self.0.0)?;
290 for el in &self.0 .1 .0 {290 for el in &self.0.1.0 {
291 write!(f, "\t{}", el.desc)?;291 write!(f, "\t{}", el.desc)?;
292 if let Some(loc) = &el.location {292 if let Some(loc) = &el.location {
293 write!(f, "at {}", loc.0 .0 .0)?;293 write!(f, "at {}", loc.0.0.0)?;
294 loc.0.map_source_locations(&[loc.1, loc.2]);294 loc.0.map_source_locations(&[loc.1, loc.2]);
295 }295 }
296 writeln!(f)?;296 writeln!(f)?;
modifiedcrates/jrsonnet-evaluator/src/evaluate/compspec.rsdiffbeforeafterboth
7 evaluate_field_member_static, evaluate_field_member_unbound,7 evaluate_field_member_static, evaluate_field_member_unbound,
8};8};
9use crate::{9use crate::{
10 Context, ContextBuilder, ObjValue, ObjValueBuilder, Pending, Result, Thunk, Val,
10 analyze::{LArrComp, LBind, LCompSpec, LDestruct, LExpr, LFieldMember, LObjComp, LocalId},11 analyze::{LArrComp, LBind, LCompSpec, LDestruct, LExpr, LFieldMember, LObjComp, LocalId},
11 arr::ArrValue,12 arr::ArrValue,
12 bail,13 bail,
13 error::ErrorKind::*,14 error::ErrorKind::*,
14 evaluate::evaluate,15 evaluate::evaluate,
15 Context, ContextBuilder, ObjValue, ObjValueBuilder, Pending, Result, Thunk, Val,
16};16};
1717
18trait CompCollector {18trait CompCollector {
modifiedcrates/jrsonnet-evaluator/src/evaluate/destructure.rsdiffbeforeafterboth
3use jrsonnet_gcmodule::Trace;3use jrsonnet_gcmodule::Trace;
44
5use crate::{5use crate::{
6 Context, ContextBuilder, Pending, Result, SupThis, Thunk, Unbound, Val,
6 analyze::{LBind, LDestruct, LDestructField, LDestructRest, LExpr, LocalId},7 analyze::{LBind, LDestruct, LDestructField, LDestructRest, LExpr, LocalId},
7 bail,8 bail,
8 evaluate::evaluate,9 evaluate::evaluate,
9 Context, ContextBuilder, Pending, Result, SupThis, Thunk, Unbound, Val,
10};10};
1111
12#[allow(dead_code, reason = "not dead in exp-destruct")]12#[allow(dead_code, reason = "not dead in exp-destruct")]
97 use jrsonnet_interner::IStr;97 use jrsonnet_interner::IStr;
98 use rustc_hash::FxHashSet;98 use rustc_hash::FxHashSet;
9999
100 use crate::{bail, ObjValueBuilder};100 use crate::{ObjValueBuilder, bail};
101101
102 let captured_fields: FxHashSet<IStr> = fields.iter().map(|f| f.name.clone()).collect();102 let captured_fields: FxHashSet<IStr> = fields.iter().map(|f| f.name.clone()).collect();
103 let field_names: Vec<(IStr, bool)> = fields103 let field_names: Vec<(IStr, bool)> = fields
modifiedcrates/jrsonnet-evaluator/src/evaluate/mod.rsdiffbeforeafterboth
11 operator::evaluate_binary_op_special,11 operator::evaluate_binary_op_special,
12};12};
13use crate::{13use crate::{
14 Context, Error, ObjValue, ObjValueBuilder, ObjectAssertion, Result, ResultExt as _, SupThis,
15 Unbound, Val,
14 analyze::{16 analyze::{
15 LArgsDesc, LAssertStmt, LExpr, LFieldMember, LFieldName, LFunction, LIndexPart, LObjBody,17 LArgsDesc, LAssertStmt, LExpr, LFieldMember, LFieldName, LFunction, LIndexPart, LObjBody,
16 LObjMembers,18 LObjMembers,
17 },19 },
18 bail,20 bail,
19 error::{suggest_object_fields, ErrorKind::*},21 error::{ErrorKind::*, suggest_object_fields},
20 evaluate::operator::evaluate_unary_op,22 evaluate::operator::evaluate_unary_op,
21 function::{prepared::PreparedFuncVal, CallLocation, FuncDesc, FuncVal},23 function::{CallLocation, FuncDesc, FuncVal, prepared::PreparedFuncVal},
22 in_frame, runtime_error,24 in_frame, runtime_error,
23 typed::FromUntyped as _,25 typed::FromUntyped as _,
24 val::{CachedUnbound, Thunk},26 val::{CachedUnbound, Thunk},
25 with_state, Context, Error, ObjValue, ObjValueBuilder, ObjectAssertion, Result, ResultExt as _,27 with_state,
26 SupThis, Unbound, Val,
27};28};
2829
29pub mod compspec;30pub mod compspec;
modifiedcrates/jrsonnet-evaluator/src/evaluate/operator.rsdiffbeforeafterboth
3use jrsonnet_ir::{BinaryOpType, UnaryOpType};3use jrsonnet_ir::{BinaryOpType, UnaryOpType};
44
5use crate::{5use crate::{
6 Context, Result, Val,
6 analyze::LExpr,7 analyze::LExpr,
7 arr::ArrValue,8 arr::ArrValue,
8 bail, error,9 bail, error,
9 error::ErrorKind::*,10 error::ErrorKind::*,
10 evaluate::evaluate,11 evaluate::evaluate,
11 stdlib::std_format,12 stdlib::std_format,
12 typed::IntoUntyped as _,13 typed::IntoUntyped as _,
13 val::{equals, StrValue},14 val::{StrValue, equals},
14 Context, Result, Val,
15};15};
1616
17pub fn evaluate_unary_op(op: UnaryOpType, b: &Val) -> Result<Val> {17pub fn evaluate_unary_op(op: UnaryOpType, b: &Val) -> Result<Val> {
modifiedcrates/jrsonnet-evaluator/src/function/mod.rsdiffbeforeafterboth
88
9use self::{9use self::{
10 builtin::Builtin,10 builtin::Builtin,
11 prepared::{parse_prepared_builtin_call, PreparedCall},11 prepared::{PreparedCall, parse_prepared_builtin_call},
12};12};
13use crate::{13use crate::{
14 Context, ContextBuilder, Result, Thunk, Val,
14 analyze::{LDestruct, LExpr, LFunction},15 analyze::{LDestruct, LExpr, LFunction},
15 evaluate::{destructure::destruct, ensure_sufficient_stack, evaluate, evaluate_trivial},16 evaluate::{destructure::destruct, ensure_sufficient_stack, evaluate, evaluate_trivial},
16 function::builtin::BuiltinFunc,17 function::builtin::BuiltinFunc,
17 Context, ContextBuilder, Result, Thunk, Val,
18};18};
1919
20pub mod builtin;20pub mod builtin;
modifiedcrates/jrsonnet-evaluator/src/function/parse.rsdiffbeforeafterboth
1use std::rc::Rc;1use std::rc::Rc;
22
3use crate::{3use crate::{
4 Context, ContextBuilder, Result, Thunk,
4 analyze::LFunction,5 analyze::LFunction,
5 evaluate::{destructure::destruct, evaluate},6 evaluate::{destructure::destruct, evaluate},
6 Context, ContextBuilder, Result, Thunk,
7};7};
88
9/// Creates Context with all argument default values applied9/// Creates Context with all argument default values applied
modifiedcrates/jrsonnet-evaluator/src/function/prepared.rsdiffbeforeafterboth
7use super::{CallLocation, FuncVal};7use super::{CallLocation, FuncVal};
8use crate::{8use crate::{Result, Thunk, Val, bail, error::ErrorKind::*};
9 Result, Thunk, Val, bail,
10 error::ErrorKind::*,
11};
129
13#[derive(Debug, Trace, Clone)]10#[derive(Debug, Trace, Clone)]
modifiedcrates/jrsonnet-evaluator/src/integrations/serde.rsdiffbeforeafterboth
3use jrsonnet_interner::{IBytes, IStr};3use jrsonnet_interner::{IBytes, IStr};
4use jrsonnet_ir::NumValue;4use jrsonnet_ir::NumValue;
5use serde::{5use serde::{
6 Deserialize, Serialize, Serializer,
6 de::{self, Visitor},7 de::{self, Visitor},
7 ser::{8 ser::{
8 Error, SerializeMap, SerializeSeq, SerializeStruct, SerializeStructVariant, SerializeTuple,9 Error, SerializeMap, SerializeSeq, SerializeStruct, SerializeStructVariant, SerializeTuple,
9 SerializeTupleStruct, SerializeTupleVariant,10 SerializeTupleStruct, SerializeTupleVariant,
10 },11 },
11 Deserialize, Serialize, Serializer,
12};12};
1313
14use crate::{14use crate::{
15 in_description_frame, runtime_error, Error as JrError, ObjValue, ObjValueBuilder, Result, Val,15 Error as JrError, ObjValue, ObjValueBuilder, Result, Val, in_description_frame, runtime_error,
16};16};
1717
18impl<'de> Deserialize<'de> for Val {18impl<'de> Deserialize<'de> for Val {
modifiedcrates/jrsonnet-evaluator/src/lib.rsdiffbeforeafterboth
39pub use evaluate::ensure_sufficient_stack;39pub use evaluate::ensure_sufficient_stack;
40use function::CallLocation;40use function::CallLocation;
41pub use import::*;41pub use import::*;
42use jrsonnet_gcmodule::{cc_dyn, Cc, Trace};42use jrsonnet_gcmodule::{Cc, Trace, cc_dyn};
43pub use jrsonnet_interner::{IBytes, IStr};43pub use jrsonnet_interner::{IBytes, IStr};
44use jrsonnet_ir::Expr;44use jrsonnet_ir::Expr;
45pub use jrsonnet_ir::{NumValue, Source, SourcePath, Span};45pub use jrsonnet_ir::{NumValue, Source, SourcePath, Span};
modifiedcrates/jrsonnet-evaluator/src/manifest.rsdiffbeforeafterboth
1use std::{borrow::Cow, fmt::Write, hint::black_box, ptr};1use std::{borrow::Cow, fmt::Write, hint::black_box, ptr};
22
3use crate::{3use crate::{
4 bail, evaluate::ensure_sufficient_stack, in_description_frame, Error,4 Error, Result, ResultExt, Val, bail, evaluate::ensure_sufficient_stack, in_description_frame,
5 Result, ResultExt, Val,
6};5};
76
8pub trait ManifestFormat {7pub trait ManifestFormat {
modifiedcrates/jrsonnet-evaluator/src/obj/mod.rsdiffbeforeafterboth
11};11};
1212
13use educe::Educe;13use educe::Educe;
14use im_rc::{vector, Vector};14use im_rc::{Vector, vector};
15use jrsonnet_gcmodule::{cc_dyn, Acyclic, Cc, Trace, Weak};15use jrsonnet_gcmodule::{Acyclic, Cc, Trace, Weak, cc_dyn};
16use jrsonnet_interner::IStr;16use jrsonnet_interner::IStr;
17use jrsonnet_ir::Span;17use jrsonnet_ir::Span;
18use rustc_hash::{FxHashMap, FxHashSet};18use rustc_hash::{FxHashMap, FxHashSet};
23pub use oop::ObjValueBuilder;23pub use oop::ObjValueBuilder;
2424
25use crate::{25use crate::{
26 CcUnbound, MaybeUnbound, Result, Thunk, Unbound, Val,
26 arr::{PickObjectKeyValues, PickObjectValues},27 arr::{PickObjectKeyValues, PickObjectValues},
27 bail,28 bail,
28 error::{suggest_object_fields, ErrorKind::*},29 error::{ErrorKind::*, suggest_object_fields},
29 evaluate::operator::evaluate_add_op,30 evaluate::operator::evaluate_add_op,
30 identity_hash,31 identity_hash,
31 val::{ArrValue, ThunkValue},32 val::{ArrValue, ThunkValue},
32 CcUnbound, MaybeUnbound, Result, Thunk, Unbound, Val,
33};33};
3434
35#[cfg(not(feature = "exp-preserve-order"))]35#[cfg(not(feature = "exp-preserve-order"))]
modifiedcrates/jrsonnet-evaluator/src/trace/mod.rsdiffbeforeafterboth
10#[cfg(feature = "explaining-traces")]10#[cfg(feature = "explaining-traces")]
11use jrsonnet_ir::Span;11use jrsonnet_ir::Span;
1212
13use crate::{error::ErrorKind, Error};13use crate::{Error, error::ErrorKind};
1414
15/// The way paths should be displayed15/// The way paths should be displayed
16#[derive(Clone, Trace)]16#[derive(Clone, Trace)]
259 struct ResetData {259 struct ResetData {
260 loc: Span,260 loc: Span,
261 }261 }
262 use hi_doc::{source_to_ansi, Formatting, SnippetBuilder, Text};262 use hi_doc::{Formatting, SnippetBuilder, Text, source_to_ansi};
263263
264 write!(out, "{}", error.error())?;264 write!(out, "{}", error.error())?;
265 if let ErrorKind::ImportSyntaxError { path, error } = error.error() {265 if let ErrorKind::ImportSyntaxError { path, error } = error.error() {
295 }296 }
296 let b = builder.as_mut().unwrap();297 let b = builder.as_mut().unwrap();
297 let ab = match diag.level {298 let ab = match diag.level {
298 DiagLevel::Error => b.error(Text::fragment(299 DiagLevel::Error => {
299 diag.message.clone(),300 b.error(Text::fragment(diag.message.clone(), Formatting::default()))
300 Formatting::default(),301 }
301 )),
302 DiagLevel::Warning => b.warning(Text::fragment(302 DiagLevel::Warning => {
303 diag.message.clone(),303 b.warning(Text::fragment(diag.message.clone(), Formatting::default()))
304 Formatting::default(),304 }
305 )),
306 };305 };
307 ab.range(span.range()).build();306 ab.range(span.range()).build();
308 } else {307 } else {
modifiedcrates/jrsonnet-evaluator/src/val.rsdiffbeforeafterboth
23 function::FuncVal,
24 gc::WithCapacityExt as _,
25 manifest::{ManifestFormat, ToStringFormat},
26 typed::BoundedUsize,
21};27};
2228
23pub trait ThunkValue: Trace {29pub trait ThunkValue: Trace {
modifiedcrates/jrsonnet-ir-parser/src/lib.rsdiffbeforeafterboth
1use jrsonnet_gcmodule::Acyclic;1use jrsonnet_gcmodule::Acyclic;
2use jrsonnet_ir::{2use jrsonnet_ir::{
3 unescape, ArgsDesc, AssertExpr, AssertStmt, BinaryOp, BinaryOpType, BindSpec, CompSpec,3 ArgsDesc, AssertExpr, AssertStmt, BinaryOp, BinaryOpType, BindSpec, CompSpec, Destruct, Expr,
4 Destruct, Expr, ExprParam, ExprParams, FieldMember, FieldName, ForSpecData, IStr, IfElse,4 ExprParam, ExprParams, FieldMember, FieldName, ForSpecData, IStr, IfElse, IfSpecData,
5 IfSpecData, ImportKind, IndexPart, LiteralType, Member, NumValue, ObjBody, ObjComp, ObjMembers,5 ImportKind, IndexPart, LiteralType, Member, NumValue, ObjBody, ObjComp, ObjMembers, Slice,
6 Slice, SliceDesc, Source, Span, Spanned, UnaryOpType, Visibility,6 SliceDesc, Source, Span, Spanned, UnaryOpType, Visibility, unescape,
7};7};
8use jrsonnet_lexer::{collect_lexed_str_block, Lexeme, Lexer, Span as LexSpan, SyntaxKind, T};8use jrsonnet_lexer::{Lexeme, Lexer, Span as LexSpan, SyntaxKind, T, collect_lexed_str_block};
99
10pub struct ParserSettings {10pub struct ParserSettings {
11 pub source: Source,11 pub source: Source,
modifiedcrates/jrsonnet-ir/src/expr.rsdiffbeforeafterboth
7use jrsonnet_interner::IStr;7use jrsonnet_interner::IStr;
88
9use crate::{9use crate::{
10 NumValue,
10 function::{FunctionSignature, ParamDefault, ParamName, ParamParse},11 function::{FunctionSignature, ParamDefault, ParamName, ParamParse},
11 source::Source,12 source::Source,
12 NumValue,
13};13};
1414
15#[derive(Debug, PartialEq, Acyclic)]15#[derive(Debug, PartialEq, Acyclic)]
modifiedcrates/jrsonnet-macros/src/lib.rsdiffbeforeafterboth
3use proc_macro2::TokenStream;3use proc_macro2::TokenStream;
4use quote::{quote, quote_spanned};4use quote::{quote, quote_spanned};
5use syn::{5use syn::{
6 parenthesized,
7 parse::{Parse, ParseStream},
8 parse_macro_input,
9 punctuated::Punctuated,
10 spanned::Spanned,
11 token::Comma,
12 Attribute, DeriveInput, Error, Expr, ExprClosure, FnArg, GenericArgument, Ident, ItemFn,6 Attribute, DeriveInput, Error, Expr, ExprClosure, FnArg, GenericArgument, Ident, ItemFn,
13 LitStr, Meta, Pat, Path, PathArguments, Result, ReturnType, Token, Type,7 LitStr, Meta, Pat, Path, PathArguments, Result, ReturnType, Token, Type, parenthesized,
8 parse::{Parse, ParseStream},
9 parse_macro_input,
10 punctuated::Punctuated,
11 spanned::Spanned,
12 token::Comma,
14};13};
1514
16use self::typed::{derive_from_untyped_inner, derive_into_untyped_inner, derive_typed_inner};15use self::typed::{derive_from_untyped_inner, derive_into_untyped_inner, derive_typed_inner};
modifiedcrates/jrsonnet-stdlib/src/arrays.rsdiffbeforeafterboth
1#![allow(non_snake_case)]1#![allow(non_snake_case)]
22
3use jrsonnet_evaluator::{3use jrsonnet_evaluator::{
4 bail, error,4 Either, IStr, ObjValue, ObjValueBuilder, Result, ResultExt, Thunk, Val, bail, error,
5 function::{builtin, NativeFn},5 function::{NativeFn, builtin},
6 runtime_error,6 runtime_error,
7 typed::{BoundedUsize, Either2, FromUntyped},7 typed::{BoundedUsize, Either2, FromUntyped},
8 val::{equals, ArrValue, IndexableVal},8 val::{ArrValue, IndexableVal, equals},
9 Either, IStr, ObjValue, ObjValueBuilder, Result, ResultExt, Thunk, Val,
10};9};
1110
12pub fn eval_on_empty(on_empty: Option<Thunk<Val>>) -> Result<Val> {11pub fn eval_on_empty(on_empty: Option<Thunk<Val>>) -> Result<Val> {
modifiedcrates/jrsonnet-stdlib/src/compat.rsdiffbeforeafterboth
1use std::cmp::Ordering;1use std::cmp::Ordering;
22
3use jrsonnet_evaluator::{function::builtin, val::ArrValue, Result, Val};3use jrsonnet_evaluator::{Result, Val, function::builtin, val::ArrValue};
44
5#[builtin]5#[builtin]
6#[allow(non_snake_case)]6#[allow(non_snake_case)]
modifiedcrates/jrsonnet-stdlib/src/lib.rsdiffbeforeafterboth
17 function::{CallLocation, FuncVal, builtin_id},
18 tla::TlaArg,
19 trace::PathResolver,
20 typed::SerializeTypedObj as _,
16};21};
17use jrsonnet_gcmodule::{Acyclic, Cc, Trace};22use jrsonnet_gcmodule::{Acyclic, Cc, Trace};
18use jrsonnet_macros::{IntoUntyped, Typed};23use jrsonnet_macros::{IntoUntyped, Typed};
modifiedcrates/jrsonnet-stdlib/src/manifest/toml.rsdiffbeforeafterboth
4 Error, IStr, ObjValue, Result, ResultExt, Val, bail, ensure_sufficient_stack, in_description_frame, manifest::{ManifestFormat, escape_string_json_buf}, val::ArrValue4 Error, IStr, ObjValue, Result, ResultExt, Val, bail, ensure_sufficient_stack,
5 in_description_frame,
6 manifest::{ManifestFormat, escape_string_json_buf},
7 val::ArrValue,
5};8};
69
7pub struct TomlFormat<'s> {10pub struct TomlFormat<'s> {
218 }221 }
219 first = false;222 first = false;
220 path.push(k.clone());223 path.push(k.clone());
221 ensure_sufficient_stack(|| in_description_frame(224 ensure_sufficient_stack(|| {
225 in_description_frame(
222 || format!("section <{k}> manifestification"),226 || format!("section <{k}> manifestification"),
223 || match v {227 || match v {
224 Val::Obj(obj) => manifest_table(&obj, path, buf, cur_padding, options),228 Val::Obj(obj) => manifest_table(&obj, path, buf, cur_padding, options),
225 Val::Arr(arr) => manifest_table_array(&arr, path, buf, cur_padding, options),229 Val::Arr(arr) => manifest_table_array(&arr, path, buf, cur_padding, options),
226 _ => unreachable!("iterating over sections"),230 _ => unreachable!("iterating over sections"),
227 },231 },
228 ))?;232 )
233 })?;
229 path.pop();234 path.pop();
230 }235 }
231 Ok(())236 Ok(())
modifiedcrates/jrsonnet-stdlib/src/misc.rsdiffbeforeafterboth
1use std::{cell::RefCell, collections::BTreeSet};1use std::{cell::RefCell, collections::BTreeSet};
22
3use jrsonnet_evaluator::{3use jrsonnet_evaluator::{
4 bail,4 Either, IStr, ObjValue, ObjValueBuilder, ResultExt, Thunk, Val, bail,
5 error::{ErrorKind::*, Result},5 error::{ErrorKind::*, Result},
6 function::{builtin, CallLocation, FuncVal},6 function::{CallLocation, FuncVal, builtin},
7 manifest::JsonFormat,7 manifest::JsonFormat,
8 typed::{Either2, Either4},8 typed::{Either2, Either4},
9 val::{equals, ArrValue},9 val::{ArrValue, equals},
10 Either, IStr, ObjValue, ObjValueBuilder, ResultExt, Thunk, Val,
11};10};
12use jrsonnet_gcmodule::Cc;11use jrsonnet_gcmodule::Cc;
1312
modifiedcrates/jrsonnet-stdlib/src/operator.rsdiffbeforeafterboth
2//! However, in our case we instead implement them in native, and implement native functions on top of core for backwards compatibility2//! However, in our case we instead implement them in native, and implement native functions on top of core for backwards compatibility
33
4use jrsonnet_evaluator::{4use jrsonnet_evaluator::{
5 IStr, NumValue, Result, Val,
5 function::builtin,6 function::builtin,
6 stdlib::std_format,7 stdlib::std_format,
7 typed::{Either, Either2},8 typed::{Either, Either2},
8 val::{equals, primitive_equals},9 val::{equals, primitive_equals},
9 IStr, NumValue, Result, Val,
10};10};
1111
12#[builtin]12#[builtin]
modifiedcrates/jrsonnet-stdlib/src/sets.rsdiffbeforeafterboth
1use std::cmp::Ordering;1use std::cmp::Ordering;
22
3use jrsonnet_evaluator::{function::builtin, val::ArrValue, Result, Thunk, Val};3use jrsonnet_evaluator::{Result, Thunk, Val, function::builtin, val::ArrValue};
44
5use crate::keyf::KeyF;5use crate::keyf::KeyF;
66
modifiedcrates/jrsonnet-stdlib/src/sort.rsdiffbeforeafterboth
3use std::cmp::Ordering;3use std::cmp::Ordering;
44
5use jrsonnet_evaluator::{5use jrsonnet_evaluator::{
6 bail,6 Result, Thunk, Val, bail,
7 function::builtin,7 function::builtin,
8 val::{equals, ArrValue},8 val::{ArrValue, equals},
9 Result, Thunk, Val,
10};9};
1110
12use crate::{eval_on_empty, keyf::KeyF};11use crate::{eval_on_empty, keyf::KeyF};
modifiedtests/tests/builtin.rsdiffbeforeafterboth
1mod common;1mod common;
22
3use jrsonnet_evaluator::{3use jrsonnet_evaluator::{
4 ContextInitializer, FileImportResolver, InitialContextBuilder, Result, Source, State, Thunk, Val, function::{CallLocation, FuncVal, builtin, builtin::{Builtin}}, trace::PathResolver, typed::FromUntyped4 ContextInitializer, FileImportResolver, InitialContextBuilder, Result, Source, State, Thunk,
5 Val,
6 function::{CallLocation, FuncVal, builtin, builtin::Builtin},
7 trace::PathResolver,
8 typed::FromUntyped,
5};9};
6use jrsonnet_gcmodule::Trace;10use jrsonnet_gcmodule::Trace;
7use jrsonnet_stdlib::ContextInitializer as StdContextInitializer;11use jrsonnet_stdlib::ContextInitializer as StdContextInitializer;
modifiedtests/tests/common.rsdiffbeforeafterboth
1use jrsonnet_evaluator::{1use jrsonnet_evaluator::{
2 ContextBuilder, ContextInitializer as ContextInitializerT, InitialContextBuilder, ObjValueBuilder, Result, Thunk, Val, bail, function::{FuncVal, builtin}, Source2 ContextBuilder, ContextInitializer as ContextInitializerT, InitialContextBuilder,
3 ObjValueBuilder, Result, Source, Thunk, Val, bail,
4 function::{FuncVal, builtin},
3};5};
4use jrsonnet_gcmodule::Trace;6use jrsonnet_gcmodule::Trace;