From 8ea310f72ee2f44f545f9f78ee54a9d88c68e36d Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Sun, 5 Jul 2026 12:23:40 +0300 Subject: [PATCH] =?UTF-8?q?feat(meta-compile):=20=D1=82=D0=B8=D0=BF=20?= =?UTF-8?q?=D1=80=D0=B5=D0=BA=D0=B2=D0=B8=D0=B7=D0=B8=D1=82=D0=B0=20Time?= =?UTF-8?q?=20(=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20=D0=B2=D1=80=D0=B5?= =?UTF-8?q?=D0=BC=D1=8F)=20(v1.33)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Реквизит типа Время (DateFractions=Time) компилятор писал Time (fallback) вместо xs:dateTime + DateQualifiers/DateFractions=Time. Всплыло на Catalog.Календари (ВремяНачала/ВремяОкончания). Ветка Date/DateTime обобщена на Date|DateTime|Time (структура одна, различается лишь DateFractions); + русский синоним Время→Time. Декомпилятор уже отдавал Time (InnerText DateFractions) → не менялся (v0.22). Календари acc+erp → match. Регресс 47/47 ps1+py, ps1↔py identical. spec §3.2/§3.3, кейс catalog-mixed-types (+Time/DateTime). Co-Authored-By: Claude Opus 4.8 (1M context) --- .../meta-compile/scripts/meta-compile.ps1 | 17 ++-- .../meta-compile/scripts/meta-compile.py | 16 ++-- docs/meta-dsl-spec.md | 2 + .../meta-compile/catalog-mixed-types.json | 2 + .../Catalogs/Контрагенты.xml | 96 ++++++++++++++++++- 5 files changed, 107 insertions(+), 26 deletions(-) diff --git a/.claude/skills/meta-compile/scripts/meta-compile.ps1 b/.claude/skills/meta-compile/scripts/meta-compile.ps1 index f6e08d1e..0dcba72e 100644 --- a/.claude/skills/meta-compile/scripts/meta-compile.ps1 +++ b/.claude/skills/meta-compile/scripts/meta-compile.ps1 @@ -1,4 +1,4 @@ -# meta-compile v1.32 — Compile 1C metadata object from JSON +# meta-compile v1.33 — Compile 1C metadata object from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [Parameter(Mandatory)] @@ -427,6 +427,8 @@ $script:typeSynonyms["строка"] = "String" $script:typeSynonyms["булево"] = "Boolean" $script:typeSynonyms["дата"] = "Date" $script:typeSynonyms["датавремя"]= "DateTime" +$script:typeSynonyms["время"] = "Time" +$script:typeSynonyms["time"] = "Time" $script:typeSynonyms["number"] = "Number" $script:typeSynonyms["string"] = "String" $script:typeSynonyms["boolean"] = "Boolean" @@ -546,18 +548,11 @@ function Emit-TypeContent { return } - # Date / DateTime - if ($typeStr -eq "Date") { + # Date / DateTime / Time — общая структура xs:dateTime + DateFractions (различаются лишь составом). + if ($typeStr -match '^(Date|DateTime|Time)$') { X "$indentxs:dateTime" X "$indent" - X "$indent`tDate" - X "$indent" - return - } - if ($typeStr -eq "DateTime") { - X "$indentxs:dateTime" - X "$indent" - X "$indent`tDateTime" + X "$indent`t$typeStr" X "$indent" return } diff --git a/.claude/skills/meta-compile/scripts/meta-compile.py b/.claude/skills/meta-compile/scripts/meta-compile.py index 345036e7..d99a1b84 100644 --- a/.claude/skills/meta-compile/scripts/meta-compile.py +++ b/.claude/skills/meta-compile/scripts/meta-compile.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# meta-compile v1.32 — Compile 1C metadata object from JSON +# meta-compile v1.33 — Compile 1C metadata object from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -477,6 +477,8 @@ type_synonyms = { 'булево': 'Boolean', 'дата': 'Date', 'датавремя': 'DateTime', + 'время': 'Time', + 'time': 'Time', 'number': 'Number', 'string': 'String', 'boolean': 'Boolean', @@ -584,17 +586,11 @@ def emit_type_content(indent, type_str): X(f'{indent}\t{sign}') X(f'{indent}') return - # Date / DateTime - if type_str == 'Date': + # Date / DateTime / Time — общая структура xs:dateTime + DateFractions (различаются лишь составом). + if type_str in ('Date', 'DateTime', 'Time'): X(f'{indent}xs:dateTime') X(f'{indent}') - X(f'{indent}\tDate') - X(f'{indent}') - return - if type_str == 'DateTime': - X(f'{indent}xs:dateTime') - X(f'{indent}') - X(f'{indent}\tDateTime') + X(f'{indent}\t{type_str}') X(f'{indent}') return # TypeSet — тип-множество: ОпределяемыйТип (DefinedType) ИЛИ Характеристика ПВХ (Characteristic). diff --git a/docs/meta-dsl-spec.md b/docs/meta-dsl-spec.md index 9238748e..70621e80 100644 --- a/docs/meta-dsl-spec.md +++ b/docs/meta-dsl-spec.md @@ -66,6 +66,7 @@ JSON DSL для описания объектов метаданных конф | `Boolean` | `xs:boolean` | | `Date` | `xs:dateTime` + DateFractions=Date | | `DateTime` | `xs:dateTime` + DateFractions=DateTime | +| `Time` | `xs:dateTime` + DateFractions=Time (только время) | | `ValueStorage` | `v8:ValueStorage` (ХранилищеЗначения) | | `UUID` | `v8:UUID` (УникальныйИдентификатор) | @@ -104,6 +105,7 @@ JSON DSL для описания объектов метаданных конф | `Булево` | `Boolean` | | `Дата` | `Date` | | `ДатаВремя` | `DateTime` | +| `Время` | `Time` | | `СправочникСсылка.Xxx` | `CatalogRef.Xxx` | | `ДокументСсылка.Xxx` | `DocumentRef.Xxx` | | `ПеречислениеСсылка.Xxx` | `EnumRef.Xxx` | diff --git a/tests/skills/cases/meta-compile/catalog-mixed-types.json b/tests/skills/cases/meta-compile/catalog-mixed-types.json index fa8b3d79..c8cd0af5 100644 --- a/tests/skills/cases/meta-compile/catalog-mixed-types.json +++ b/tests/skills/cases/meta-compile/catalog-mixed-types.json @@ -7,6 +7,8 @@ "attributes": [ "ИНН: String(12)", "ДатаРегистрации: Date", + "ВремяПриема: Time", + "МоментСоздания: DateTime", "Активен: Boolean", "СуммаДоговора: Number(15,2)", "Ответственный: CatalogRef.ФизическиеЛица", diff --git a/tests/skills/cases/meta-compile/snapshots/catalog-mixed-types/Catalogs/Контрагенты.xml b/tests/skills/cases/meta-compile/snapshots/catalog-mixed-types/Catalogs/Контрагенты.xml index b7114495..e2e35448 100644 --- a/tests/skills/cases/meta-compile/snapshots/catalog-mixed-types/Catalogs/Контрагенты.xml +++ b/tests/skills/cases/meta-compile/snapshots/catalog-mixed-types/Catalogs/Контрагенты.xml @@ -175,6 +175,92 @@ + + ВремяПриема + + + ru + Время приема + + + + + xs:dateTime + + Time + + + false + + + + false + + false + false + + + false + + DontCheck + Items + + + Auto + Auto + + + Auto + ForItem + DontIndex + Use + Use + + + + + МоментСоздания + + + ru + Момент создания + + + + + xs:dateTime + + DateTime + + + false + + + + false + + false + false + + + false + + DontCheck + Items + + + Auto + Auto + + + Auto + ForItem + DontIndex + Use + Use + + + Активен @@ -214,7 +300,7 @@ Use - + СуммаДоговора @@ -259,7 +345,7 @@ Use - + Ответственный @@ -299,7 +385,7 @@ Use - + Статус @@ -339,7 +425,7 @@ Use - + Вложение @@ -379,7 +465,7 @@ Use - + Идентификатор