Последний штрих на сегодня.
Определяем, что такого элемента ещё нет:
Определяем, что такого элемента ещё нет:
elem_iterator ConstantsEx
Cached:
(
Self .Constants
RULES
( Self .IsTypedef )
begin
VAR l_OtherEnum
Self .MainAncestor >>> l_OtherEnum
RULES
( l_OtherEnum .IsEnum )
RULES
( Self .Name l_OtherEnum .Name == )
RULES
( l_OtherEnum .Attributes .CountIt > 0 )
begin
VAR l_ConstantsName
[ Self .Name '_' l_OtherEnum .Name '_' 'Constants' ] strings:Cat >>> l_ConstantsName
RULES
(
Self .Parent call.me
.filter> ( .Name l_ConstantsName == )
.CountIt 0 ==
)
begin
.join>
[
l_ConstantsName MakeConstants: (
IN aConstants
aConstants -> %SUM := ( [ 'Алиасы для значений ' l_OtherEnum .Parent .Name '.' l_OtherEnum .Name ] strings:Cat )
aConstants -> Visibility := PublicAccess
VAR l_ElementPrefix
l_OtherEnum .GetUP 'extprop:pas:ElementPrefix' >>> l_ElementPrefix
aConstants -> Attributes := [
l_OtherEnum .Attributes .for> (
IN anItem
VAR l_Name
[ l_ElementPrefix anItem .Name ] strings:Cat >>> l_Name
l_Name
[ l_OtherEnum .EffectiveUnitName '.' l_Name ] strings:Cat
MakeConstant: (
IN aConstant
RULES
( anItem .Documentation IsNil ! )
( aConstant -> %SUM := ( anItem .Documentation ) )
; // RULES
) // MakeConstant:
) // l_OtherEnum .Attributes .for>
] // aConstants -> Attributes
) // MakeConstants:
] // .join>
end
; // RULES
end // ( l_OtherEnum .Attributes .CountIt > 0 )
; // RULES
; // RULES
; // RULES
end // ( Self .IsTypedef )
; // RULES
)
>>> Result
; // ConstantsEx
Комментариев нет:
Отправить комментарий