mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-06-15 18:34:57 +03:00
feat(form-decompile): form-level <CommandSet>/ExcludedCommand (кластер ExcludedCommand)
Декомпилятор читал <CommandSet> только внутри Table-элемента; на корне формы (<Form><CommandSet><ExcludedCommand>…) пропускал → excludedCommands терялись (LOST=207 в корпусе 2.17). Компилятор и DSL уже поддерживали excludedCommands на top-level — чистый баг декомпиляции (класс 1). Читаем корневой CommandSet в $dsl["excludedCommands"], порядок по spec (title → properties → excludedCommands → events). Зеркало PY не нужно (decompiler.py отложен), корпус не нужен (читаем поддерживаемую фичу). Валидация: ФормаЗаписи + ФормаЭлемента раундтрип diff→match. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# form-decompile v0.9 — Decompile 1C managed Form.xml to JSON DSL (draft)
|
||||
# form-decompile v0.10 — Decompile 1C managed Form.xml to JSON DSL (draft)
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
# ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью.
|
||||
param(
|
||||
@@ -562,6 +562,14 @@ foreach ($pn in $KNOWN_FORM_PROPS) {
|
||||
if ($dsl.Contains('title') -and $props.Contains('autoTitle') -and $props['autoTitle'] -eq $false) { $props.Remove('autoTitle') }
|
||||
if ($props.Count -gt 0) { $dsl['properties'] = $props }
|
||||
|
||||
# excludedCommands (form-level <CommandSet>)
|
||||
$csForm = $root.SelectSingleNode("lf:CommandSet", $ns)
|
||||
if ($csForm) {
|
||||
$excForm = New-Object System.Collections.ArrayList
|
||||
foreach ($ec in @($csForm.SelectNodes("lf:ExcludedCommand", $ns))) { [void]$excForm.Add($ec.InnerText) }
|
||||
if ($excForm.Count -gt 0) { $dsl['excludedCommands'] = @($excForm) }
|
||||
}
|
||||
|
||||
# events (form-level)
|
||||
$evForm = Get-Events $root $null
|
||||
if ($evForm) {
|
||||
|
||||
Reference in New Issue
Block a user