mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-17 08:15:16 +03:00
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:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user