From cbad0fe743aa07f1c5b63e7ecfcbb851ccaf5c96 Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Fri, 22 May 2026 18:28:48 +0300 Subject: [PATCH] =?UTF-8?q?fix(skd-compile):=20=D0=B0=D0=B2=D1=82=D0=BE-?= =?UTF-8?q?=D0=BE=D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20xs:decimal=20=D0=BF=D0=BE=20=D1=82=D0=B5=D0=BA=D1=81?= =?UTF-8?q?=D1=82=D1=83=20=D1=87=D0=B8=D1=81=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Для filter right value compile уже различал bool / native-number / dateTime, но не различал числовые строки. Реальные отчёты часто хранят сравнения как числа: 5. Decompile при чтении видит "5" как строку (через InnerText), и без этого фикса compile эмитил xs:string. Теперь добавлена проверка по regex ^-?\d+(\.\d+)?$ → xs:decimal. Co-Authored-By: Claude Opus 4.7 --- .claude/skills/skd-compile/scripts/skd-compile.ps1 | 5 ++++- .claude/skills/skd-compile/scripts/skd-compile.py | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.claude/skills/skd-compile/scripts/skd-compile.ps1 b/.claude/skills/skd-compile/scripts/skd-compile.ps1 index 25ad2e22..83717196 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.47 — Compile 1C DCS from JSON +# skd-compile v1.48 — Compile 1C DCS from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$DefinitionFile, @@ -2011,6 +2011,7 @@ function Emit-FilterItem { if ($v -is [bool]) { $vt = 'xs:boolean' } elseif ($v -is [int] -or $v -is [long] -or $v -is [double]) { $vt = 'xs:decimal' } elseif ("$v" -match '^\d{4}-\d{2}-\d{2}T') { $vt = 'xs:dateTime' } + elseif ("$v" -match '^-?\d+(\.\d+)?$') { $vt = 'xs:decimal' } else { $vt = 'xs:string' } } $vStr = if ($v -is [bool]) { "$v".ToLower() } else { Esc-Xml "$v" } @@ -2027,6 +2028,8 @@ function Emit-FilterItem { $vt = "xs:decimal" } elseif ("$v" -match '^\d{4}-\d{2}-\d{2}T') { $vt = "xs:dateTime" + } elseif ("$v" -match '^-?\d+(\.\d+)?$') { + $vt = "xs:decimal" } else { $vt = "xs:string" } diff --git a/.claude/skills/skd-compile/scripts/skd-compile.py b/.claude/skills/skd-compile/scripts/skd-compile.py index faee46b0..23d988ea 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.47 — Compile 1C DCS from JSON +# skd-compile v1.48 — Compile 1C DCS from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import json @@ -1678,6 +1678,8 @@ def emit_filter_item(lines, item, indent): vt = 'xs:decimal' elif re.match(r'^\d{4}-\d{2}-\d{2}T', str(v)): vt = 'xs:dateTime' + elif re.match(r'^-?\d+(\.\d+)?$', str(v)): + vt = 'xs:decimal' else: vt = 'xs:string' v_str = str(v).lower() if isinstance(v, bool) else esc_xml(str(v)) @@ -1692,6 +1694,8 @@ def emit_filter_item(lines, item, indent): vt = 'xs:decimal' elif re.match(r'^\d{4}-\d{2}-\d{2}T', str(v)): vt = 'xs:dateTime' + elif re.match(r'^-?\d+(\.\d+)?$', str(v)): + vt = 'xs:decimal' else: vt = 'xs:string' if isinstance(val, bool):