mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-18 08:39:40 +03:00
fix(skd-compile): Designer-compatible empty parameter values
Centralized empty-value handling: shorthand `=`, `= _`, `= null` and object-form `value: null` / `""` now serialize per type, matching what 1C Designer writes: - ref / no-type → <value xsi:nil="true"/> - string → <value xsi:type="xs:string"/> - date/decimal/boolean → typed zero (0001-01-01 / 0 / false) - StandardPeriod → Custom variant with zero dates - @valueList → omit <value> entirely Closes BUG-1 (StandardPeriod @autoDates) and BUG-2 (CatalogRef.X = _ producing invalid <value>_</value>) reported by titan team. New helpers Test-EmptyValue / Emit-EmptyValue (ps1) and is_empty_value / emit_empty_value (py) shared by Emit-ParamValue, availableValues loop, and explicit dataParameters emit. Shorthand regex .+ → .* so trailing `=` parses as empty. Reference: upload/erf/ПроверкаЭкранирования (live Designer dump). New test case empty-param-values covers all 10 type×sentinel combos; 3 existing snapshots regenerated to include the now-correct <value> tags. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "Параметры с пустыми значениями (все типы, разные sentinel-формы)",
|
||||
"params": { "outputPath": "Template.xml" },
|
||||
"input": {
|
||||
"dataSets": [{
|
||||
"name": "Основной",
|
||||
"query": "ВЫБРАТЬ 1 КАК Поле1",
|
||||
"fields": ["Поле1: число(1,0)"]
|
||||
}],
|
||||
"parameters": [
|
||||
"Параметр1",
|
||||
"Параметр2: string =",
|
||||
"ПараметрСписок: EnumRef.СтатусТеста @valueList = _",
|
||||
"ПараметрСсылка: CatalogRef.ПлоскийПростой",
|
||||
"ПараметрДата: date = null",
|
||||
{ "name": "ПараметрЧисло", "type": "decimal", "value": null },
|
||||
"ПараметрБулево: boolean = ",
|
||||
"ПараметрСтандартныйПериод: StandardPeriod = _",
|
||||
{ "name": "ПараметрТипНеЗадан", "value": null },
|
||||
"ПараметрСписокСтрок: string @valueList"
|
||||
]
|
||||
},
|
||||
"validatePath": "Template.xml",
|
||||
"expect": {
|
||||
"files": ["Template.xml"]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user