feat(meta-compile): тип реквизита Time (только время) (v1.33)

Реквизит типа Время (DateFractions=Time) компилятор писал <v8:Type>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) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-07-05 12:23:40 +03:00
parent 027e6a4a89
commit 8ea310f72e
5 changed files with 107 additions and 26 deletions
@@ -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 "$indent<v8:Type>xs:dateTime</v8:Type>"
X "$indent<v8:DateQualifiers>"
X "$indent`t<v8:DateFractions>Date</v8:DateFractions>"
X "$indent</v8:DateQualifiers>"
return
}
if ($typeStr -eq "DateTime") {
X "$indent<v8:Type>xs:dateTime</v8:Type>"
X "$indent<v8:DateQualifiers>"
X "$indent`t<v8:DateFractions>DateTime</v8:DateFractions>"
X "$indent`t<v8:DateFractions>$typeStr</v8:DateFractions>"
X "$indent</v8:DateQualifiers>"
return
}
@@ -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<v8:AllowedSign>{sign}</v8:AllowedSign>')
X(f'{indent}</v8:NumberQualifiers>')
return
# Date / DateTime
if type_str == 'Date':
# Date / DateTime / Time — общая структура xs:dateTime + DateFractions (различаются лишь составом).
if type_str in ('Date', 'DateTime', 'Time'):
X(f'{indent}<v8:Type>xs:dateTime</v8:Type>')
X(f'{indent}<v8:DateQualifiers>')
X(f'{indent}\t<v8:DateFractions>Date</v8:DateFractions>')
X(f'{indent}</v8:DateQualifiers>')
return
if type_str == 'DateTime':
X(f'{indent}<v8:Type>xs:dateTime</v8:Type>')
X(f'{indent}<v8:DateQualifiers>')
X(f'{indent}\t<v8:DateFractions>DateTime</v8:DateFractions>')
X(f'{indent}\t<v8:DateFractions>{type_str}</v8:DateFractions>')
X(f'{indent}</v8:DateQualifiers>')
return
# TypeSet — тип-множество: ОпределяемыйТип (DefinedType) ИЛИ Характеристика ПВХ (Characteristic).
+2
View File
@@ -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` |
@@ -7,6 +7,8 @@
"attributes": [
"ИНН: String(12)",
"ДатаРегистрации: Date",
"ВремяПриема: Time",
"МоментСоздания: DateTime",
"Активен: Boolean",
"СуммаДоговора: Number(15,2)",
"Ответственный: CatalogRef.ФизическиеЛица",
@@ -175,6 +175,92 @@
</Properties>
</Attribute>
<Attribute uuid="UUID-014">
<Properties>
<Name>ВремяПриема</Name>
<Synonym>
<v8:item>
<v8:lang>ru</v8:lang>
<v8:content>Время приема</v8:content>
</v8:item>
</Synonym>
<Comment/>
<Type>
<v8:Type>xs:dateTime</v8:Type>
<v8:DateQualifiers>
<v8:DateFractions>Time</v8:DateFractions>
</v8:DateQualifiers>
</Type>
<PasswordMode>false</PasswordMode>
<Format/>
<EditFormat/>
<ToolTip/>
<MarkNegatives>false</MarkNegatives>
<Mask/>
<MultiLine>false</MultiLine>
<ExtendedEdit>false</ExtendedEdit>
<MinValue xsi:nil="true"/>
<MaxValue xsi:nil="true"/>
<FillFromFillingValue>false</FillFromFillingValue>
<FillValue xsi:nil="true"/>
<FillChecking>DontCheck</FillChecking>
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
<ChoiceParameterLinks/>
<ChoiceParameters/>
<QuickChoice>Auto</QuickChoice>
<CreateOnInput>Auto</CreateOnInput>
<ChoiceForm/>
<LinkByType/>
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
<Use>ForItem</Use>
<Indexing>DontIndex</Indexing>
<FullTextSearch>Use</FullTextSearch>
<DataHistory>Use</DataHistory>
</Properties>
</Attribute>
<Attribute uuid="UUID-015">
<Properties>
<Name>МоментСоздания</Name>
<Synonym>
<v8:item>
<v8:lang>ru</v8:lang>
<v8:content>Момент создания</v8:content>
</v8:item>
</Synonym>
<Comment/>
<Type>
<v8:Type>xs:dateTime</v8:Type>
<v8:DateQualifiers>
<v8:DateFractions>DateTime</v8:DateFractions>
</v8:DateQualifiers>
</Type>
<PasswordMode>false</PasswordMode>
<Format/>
<EditFormat/>
<ToolTip/>
<MarkNegatives>false</MarkNegatives>
<Mask/>
<MultiLine>false</MultiLine>
<ExtendedEdit>false</ExtendedEdit>
<MinValue xsi:nil="true"/>
<MaxValue xsi:nil="true"/>
<FillFromFillingValue>false</FillFromFillingValue>
<FillValue xsi:nil="true"/>
<FillChecking>DontCheck</FillChecking>
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
<ChoiceParameterLinks/>
<ChoiceParameters/>
<QuickChoice>Auto</QuickChoice>
<CreateOnInput>Auto</CreateOnInput>
<ChoiceForm/>
<LinkByType/>
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
<Use>ForItem</Use>
<Indexing>DontIndex</Indexing>
<FullTextSearch>Use</FullTextSearch>
<DataHistory>Use</DataHistory>
</Properties>
</Attribute>
<Attribute uuid="UUID-016">
<Properties>
<Name>Активен</Name>
<Synonym>
@@ -214,7 +300,7 @@
<DataHistory>Use</DataHistory>
</Properties>
</Attribute>
<Attribute uuid="UUID-015">
<Attribute uuid="UUID-017">
<Properties>
<Name>СуммаДоговора</Name>
<Synonym>
@@ -259,7 +345,7 @@
<DataHistory>Use</DataHistory>
</Properties>
</Attribute>
<Attribute uuid="UUID-016">
<Attribute uuid="UUID-018">
<Properties>
<Name>Ответственный</Name>
<Synonym>
@@ -299,7 +385,7 @@
<DataHistory>Use</DataHistory>
</Properties>
</Attribute>
<Attribute uuid="UUID-017">
<Attribute uuid="UUID-019">
<Properties>
<Name>Статус</Name>
<Synonym>
@@ -339,7 +425,7 @@
<DataHistory>Use</DataHistory>
</Properties>
</Attribute>
<Attribute uuid="UUID-018">
<Attribute uuid="UUID-020">
<Properties>
<Name>Вложение</Name>
<Synonym>
@@ -379,7 +465,7 @@
<DataHistory>Use</DataHistory>
</Properties>
</Attribute>
<Attribute uuid="UUID-019">
<Attribute uuid="UUID-021">
<Properties>
<Name>Идентификатор</Name>
<Synonym>