Nick Shirokov
5ca8ce2b64
fix(skd-compile): widths-unwrap и indent в template cell appearance
...
Две bug-фиксы для шаблонов:
1. PS-quirk: \$widths = if (\$t.widths) { @(\$t.widths) } else { @() }
разворачивал одно-элементный массив в строку, после чего \$widths[0]
возвращал первый Char (например '1' для "15.625"), а [double][Char]'1'=49.
Заменил if-expression на обычный if-statement.
2. Indent в <dcsat:appearance>: компайлер ставил 4 таба вместо 5
(и 5 вместо 6 у items внутри). Поправлено в обоих рантаймах.
sample30: −552 строки (2666 → 2114).
2026-05-23 17:18:50 +03:00
Nick Shirokov
6e14f2502e
feat(skd-edit): empty parameter values, decimal/time/fix/composite
...
Brings skd-edit to parity with the skd-compile fixes from 449f814 / 0537410
/ ff2d851 . Same helpers (Test-EmptyValue / Build-EmptyValueXml in ps1,
is_empty_value / build_empty_value_xml in py) shared by add-parameter,
modify-parameter (value=...), availableValues, add-dataParameter and
modify-dataParameter.
Behavior:
- Sentinel empty (null / "" / "_" / "null") serializes per declared type,
matching what 1C Designer writes — ref/no-type → xsi:nil, string →
xsi:type="xs:string" empty, date/time/decimal/boolean → typed zero,
StandardPeriod → Custom + zero dates, dataParameters → dcscor:value
xsi:nil="true". @valueList omits <value> entirely.
- Build-ValueTypeXml accepts bare decimal (10,2), decimal(N) (N,0),
string(N,fix) (AllowedLength=Fixed), time (DateFractions=Time), and
composite array of types.
- Parse-ParamShorthand / Parse-DataParamShorthand regex .+ → .* so a
trailing `=` is treated as the empty-value sentinel. New @valueList flag.
New test cases: empty-param-values-add / -modify / empty-dataparam-values.
Three outdated skd-edit snapshots regenerated to reflect upstream skd-compile
empty-value emission (rename-parameter, reorder-parameters,
conditional-appearance-v2).
Regression: 41/41 ps1 + 41/41 py runner; 41/41 verify-snapshots ps1 + py
(live load into 1С 8.3.24). skd-compile 23/23 and skd-validate 15/15
unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-20 13:38:52 +03:00