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
co-authored by Claude Opus 4.8
parent 027e6a4a89
commit 8ea310f72e
5 changed files with 107 additions and 26 deletions
@@ -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).