diff --git a/.claude/skills/skd-compile/scripts/skd-compile.ps1 b/.claude/skills/skd-compile/scripts/skd-compile.ps1 index 3724fe8f..607453e3 100644 --- a/.claude/skills/skd-compile/scripts/skd-compile.ps1 +++ b/.claude/skills/skd-compile/scripts/skd-compile.ps1 @@ -1,4 +1,4 @@ -# skd-compile v1.72 — Compile 1C DCS from JSON +# skd-compile v1.73 — Compile 1C DCS from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$DefinitionFile, @@ -1273,6 +1273,9 @@ function Emit-SingleParam { if (Test-EmptyValue $parsed.value) { if (-not $vla) { X "`t`t" } } + } elseif ($parsed.nilValue -eq $true) { + # Принудительный xsi:nil даже когда тип известен (для bit-perfect round-trip). + if (-not $vla) { X "`t`t" } } else { Emit-ParamValue -type $parsed.type -val $parsed.value -indent "`t`t" -valueListAllowed $vla } @@ -1379,6 +1382,7 @@ function Emit-Parameters { if ($p.valueListAllowed -eq $true) { $parsed.valueListAllowed = $true } if ($p.hidden -eq $true) { $parsed.hidden = $true } if ($p.autoDates -eq $true) { $parsed.autoDates = $true } + if ($p.nilValue -eq $true) { $parsed.nilValue = $true } } # @autoDates implies use=Always + denyIncompleteValues=true by default diff --git a/.claude/skills/skd-compile/scripts/skd-compile.py b/.claude/skills/skd-compile/scripts/skd-compile.py index de946438..c1da2583 100644 --- a/.claude/skills/skd-compile/scripts/skd-compile.py +++ b/.claude/skills/skd-compile/scripts/skd-compile.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# skd-compile v1.72 — Compile 1C DCS from JSON +# skd-compile v1.73 — Compile 1C DCS from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import json @@ -1086,6 +1086,10 @@ def emit_single_param(lines, p, parsed): if is_empty_value(parsed.get('value')): if not vla: lines.append('\t\t') + elif parsed.get('nilValue') is True: + # Принудительный xsi:nil даже когда тип известен (для bit-perfect round-trip). + if not vla: + lines.append('\t\t') else: emit_param_value(lines, p_type, parsed.get('value'), '\t\t', vla) @@ -1192,6 +1196,8 @@ def emit_parameters(lines, defn): parsed['hidden'] = True if p.get('autoDates') is True: parsed['autoDates'] = True + if p.get('nilValue') is True: + parsed['nilValue'] = True # @autoDates implies use=Always + denyIncompleteValues=true by default # (derived &НачалоПериода/&КонецПериода need a populated period). diff --git a/.claude/skills/skd-decompile/scripts/skd-decompile.ps1 b/.claude/skills/skd-decompile/scripts/skd-decompile.ps1 index 25d07379..1a002227 100644 --- a/.claude/skills/skd-decompile/scripts/skd-decompile.ps1 +++ b/.claude/skills/skd-decompile/scripts/skd-decompile.ps1 @@ -1,4 +1,4 @@ -# skd-decompile v0.55 — Decompile 1C DCS Template.xml to JSON DSL (draft) +# skd-decompile v0.56 — Decompile 1C DCS Template.xml to JSON DSL (draft) # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [Parameter(Mandatory)] @@ -824,6 +824,15 @@ function Render-Parameter { if ($p.expression) { $needsObject = $true } if ($p.notAField) { $needsObject = $true } + # valueIsNil на non-композитном типе требует object form, чтобы compile + # знал что вместо xs:string/xs:decimal-default нужно эмитить xsi:nil="true". + # Для ref-типов compile в любом случае эмитит nil, шорткод покрывает. + $refTypePattern = '^(Catalog|Document|Enum|ChartOfAccounts|ChartOfCharacteristicTypes|ChartOfCalculationTypes|BusinessProcess|Task|InformationRegister|ExchangePlan|CatalogRef|DocumentRef|EnumRef|ChartOfAccountsRef|ChartOfCharacteristicTypesRef|ChartOfCalculationTypesRef|BusinessProcessRef|TaskRef|InformationRegisterRef|ExchangePlanRef|AnyRef)' + $typeIsRef = $false + if ($typeShort -is [string] -and $typeShort -match $refTypePattern) { $typeIsRef = $true } + $nilNeedsObject = $valueIsNil -and -not $typeIsRef -and $typeShort -and -not ($typeShort -is [array]) + if ($nilNeedsObject) { $needsObject = $true } + if (-not $needsObject) { $s = $name if ($title) { $s += " [$title]" } @@ -837,6 +846,7 @@ function Render-Parameter { if ($title) { $obj['title'] = $title } if ($typeShort) { $obj['type'] = $typeShort } if (-not $valueIsNil -and $null -ne $valueDisplay -and $valueDisplay -ne '') { $obj['value'] = $valueDisplay } + if ($nilNeedsObject) { $obj['nilValue'] = $true } if ($p.useAttr -and -not $p.autoDates) { $obj['use'] = $p.useAttr } if ($p.denyIncomplete -and -not $p.autoDates) { $obj['denyIncompleteValues'] = $true } if ($p.hidden) { $obj['hidden'] = $true }