mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-06 18:20:52 +03:00
fix(meta-compile,meta-edit): sync type handling and validation between scripts
meta-compile: bare Number→Number(10,0), ValueStorage→xs:base64Binary, lowercase ref synonyms (catalogref, documentref, enumref). meta-edit: bare String default 0→10, reserved attribute name warnings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
843916642c
commit
72a4015a8d
@@ -185,6 +185,10 @@ $script:typeSynonyms["бизнеспроцессссылка"] = "Bus
|
||||
$script:typeSynonyms["задачассылка"] = "TaskRef"
|
||||
$script:typeSynonyms["определяемыйтип"] = "DefinedType"
|
||||
$script:typeSynonyms["definedtype"] = "DefinedType"
|
||||
# English lowercase ref synonyms
|
||||
$script:typeSynonyms["catalogref"] = "CatalogRef"
|
||||
$script:typeSynonyms["documentref"] = "DocumentRef"
|
||||
$script:typeSynonyms["enumref"] = "EnumRef"
|
||||
|
||||
function Resolve-TypeStr {
|
||||
param([string]$typeStr)
|
||||
@@ -248,6 +252,17 @@ function Emit-TypeContent {
|
||||
return
|
||||
}
|
||||
|
||||
# Number without params → Number(10,0)
|
||||
if ($typeStr -eq "Number") {
|
||||
X "$indent<v8:Type>xs:decimal</v8:Type>"
|
||||
X "$indent<v8:NumberQualifiers>"
|
||||
X "$indent`t<v8:Digits>10</v8:Digits>"
|
||||
X "$indent`t<v8:FractionDigits>0</v8:FractionDigits>"
|
||||
X "$indent`t<v8:AllowedSign>Any</v8:AllowedSign>"
|
||||
X "$indent</v8:NumberQualifiers>"
|
||||
return
|
||||
}
|
||||
|
||||
# Number(D,F) or Number(D,F,nonneg)
|
||||
if ($typeStr -match '^Number\((\d+),(\d+)(,nonneg)?\)$') {
|
||||
$digits = $Matches[1]
|
||||
@@ -285,6 +300,12 @@ function Emit-TypeContent {
|
||||
return
|
||||
}
|
||||
|
||||
# ValueStorage
|
||||
if ($typeStr -eq "ValueStorage") {
|
||||
X "$indent<v8:Type>xs:base64Binary</v8:Type>"
|
||||
return
|
||||
}
|
||||
|
||||
# Reference types — use local xmlns declaration for 1C compatibility
|
||||
if ($typeStr -match '^(CatalogRef|DocumentRef|EnumRef|ChartOfAccountsRef|ChartOfCharacteristicTypesRef|ChartOfCalculationTypesRef|ExchangePlanRef|BusinessProcessRef|TaskRef)\.(.+)$') {
|
||||
X "$indent<v8:Type xmlns:d5p1=`"http://v8.1c.ru/8.1/data/enterprise/current-config`">d5p1:$typeStr</v8:Type>"
|
||||
|
||||
Reference in New Issue
Block a user