diff --git a/kclvm/cmd/src/test_data/instances/test_inst_10/expected b/kclvm/cmd/src/test_data/instances/test_inst_10/expected index 7987170eb..2e394772b 100644 --- a/kclvm/cmd/src/test_data/instances/test_inst_10/expected +++ b/kclvm/cmd/src/test_data/instances/test_inst_10/expected @@ -1,2 +1,3 @@ a: id: 102 +inst102: [] diff --git a/kclvm/parser/src/entry.rs b/kclvm/parser/src/entry.rs index fdcf348da..a8da17585 100644 --- a/kclvm/parser/src/entry.rs +++ b/kclvm/parser/src/entry.rs @@ -7,7 +7,6 @@ use kclvm_utils::path::{is_absolute, is_dir, path_exist}; use std::collections::VecDeque; use std::fs; use std::path::Path; -use std::sync::Arc; use crate::LoadProgramOptions; diff --git a/kclvm/parser/src/lib.rs b/kclvm/parser/src/lib.rs index 60128444a..99aee1612 100644 --- a/kclvm/parser/src/lib.rs +++ b/kclvm/parser/src/lib.rs @@ -19,7 +19,7 @@ use indexmap::IndexMap; use kclvm_ast::ast; use kclvm_config::modfile::{get_vendor_home, KCL_FILE_EXTENSION, KCL_FILE_SUFFIX, KCL_MOD_FILE}; use kclvm_error::diagnostic::Range; -use kclvm_error::{ErrorKind, Level, Message, Style}; +use kclvm_error::{ErrorKind, Message, Style}; use kclvm_sema::plugin::PLUGIN_MODULE_PREFIX; use kclvm_utils::path::PathPrefix; use kclvm_utils::pkgpath::parse_external_pkg_name; diff --git a/kclvm/runtime/src/api/kclvm.rs b/kclvm/runtime/src/api/kclvm.rs index 1037e6d6a..a99b132f6 100644 --- a/kclvm/runtime/src/api/kclvm.rs +++ b/kclvm/runtime/src/api/kclvm.rs @@ -327,8 +327,8 @@ pub struct ContextConfig { pub list_option_mode: bool, /// Whether to emit none value in the plan process. pub disable_none: bool, - /// Whether to output empty list in the plan process. - pub plan_empty_list: bool, + /// Whether to emit empty list in the plan process. + pub disable_empty_list: bool, } #[derive(PartialEq, Eq, Clone, Debug)] diff --git a/kclvm/runtime/src/value/val_plan.rs b/kclvm/runtime/src/value/val_plan.rs index 5fa4eda64..de79a30ac 100644 --- a/kclvm/runtime/src/value/val_plan.rs +++ b/kclvm/runtime/src/value/val_plan.rs @@ -119,7 +119,7 @@ fn filter_results(ctx: &Context, key_values: &ValueRef, opts: &PlanOptions) -> V let schema_in_list_count = ignore_schema_count + standalone_list.len(); let value = &value.as_list_ref().values; // Plan empty list to values. - if value.is_empty() && ctx.cfg.plan_empty_list { + if value.is_empty() && !ctx.cfg.disable_empty_list { let result = results.get_mut(0).unwrap(); result.dict_update_key_value(key.as_str(), ValueRef::list(None)); } diff --git a/test/grammar/expr/select_expr/in_for_0/stdout.golden b/test/grammar/expr/select_expr/in_for_0/stdout.golden index a13ffd4bb..7f05c6719 100644 --- a/test/grammar/expr/select_expr/in_for_0/stdout.golden +++ b/test/grammar/expr/select_expr/in_for_0/stdout.golden @@ -1,2 +1,3 @@ c: - name: main + volumeMounts: []