mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-04 01:00:52 +03:00
fix(skd-compile): accept bare decimal and decimal(N) with sensible defaults
Emit-SingleValueType / emit_single_value_type previously required full decimal(D,F) — anything else fell through to a fallback that produced invalid <v8:Type>decimal</v8:Type> (no xs: prefix, no qualifiers). New regex `^decimal(\((\d+)(,(\d+))?(,nonneg)?\))?$` accepts: - decimal → 10,2,Any (money default — most common 1C intent) - decimal(N) → N,0,Any (integer) - decimal(N,nonneg) → N,0,Nonnegative - decimal(N,M) → as before - decimal(N,M,nonneg) → as before Synonyms (число, число(N), etc.) inherit the same forms via Resolve-TypeStr. Shared Emit-ValueType is called from fields, parameters, and output parameters — one fix covers all three paths. 3 existing snapshots regenerated with proper xs:decimal + qualifiers, plus new decimal-qualifier-defaults test case covering all 5 forms × synonyms. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
449f814d16
commit
05374100c1
@@ -70,7 +70,12 @@
|
||||
<parameter>
|
||||
<name>ПараметрЧисло</name>
|
||||
<valueType>
|
||||
<v8:Type>decimal</v8:Type>
|
||||
<v8:Type>xs:decimal</v8:Type>
|
||||
<v8:NumberQualifiers>
|
||||
<v8:Digits>10</v8:Digits>
|
||||
<v8:FractionDigits>2</v8:FractionDigits>
|
||||
<v8:AllowedSign>Any</v8:AllowedSign>
|
||||
</v8:NumberQualifiers>
|
||||
</valueType>
|
||||
<value xsi:type="xs:decimal">0</value>
|
||||
</parameter>
|
||||
|
||||
Reference in New Issue
Block a user