@@ -73,6 +73,8 @@ namespace CodeGen.Engine
7373 parameterLoopTokenExpanders.Add("PARAMETER_SIZE", expandParameterSize)
7474 parameterLoopTokenExpanders.Add("PARAMETER_PRECISION", expandParameterPrecision)
7575 parameterLoopTokenExpanders.Add("PARAMETER_ENUM", expandParameterEnum)
76+ parameterLoopTokenExpanders.Add("PARAMETER_MAXVALUE", expandParameterMaxValue)
77+ parameterLoopTokenExpanders.Add("PARAMETER_MINVALUE", expandParameterMinValue)
7678 parameterLoopTokenExpanders.Add("PARAMETER_STRUCTURE", expandParameterStructure)
7779 parameterLoopTokenExpanders.Add("PARAMETER_STRUCTURE_NOPLURAL", expandParameterStructure)
7880 parameterLoopTokenExpanders.Add("PARAMETER_STRUCTURE_PLURAL", expandParameterStructure)
@@ -631,7 +633,10 @@ namespace CodeGen.Engine
631633 if (template.Context.CurrentTask.Tweaks != ^null && template.Context.CurrentTask.Tweaks.Contains("PARAMDEFSTR"))
632634 begin
633635 strPrefix = "str"
634- strName = StringTools.PascalCase(param.StructureName.EndsWith("S") ? param.StructureName.Substring(0,param.StructureName.Length-1) : param.StructureName)
636+ if (template.Context.CurrentTask.NoCustomPluralization) then
637+ strName = StringTools.PascalCase(param.StructureName)
638+ else
639+ strName = StringTools.PascalCase(param.StructureName.EndsWith("S") ? param.StructureName.Substring(0,param.StructureName.Length-1) : param.StructureName)
635640 end
636641 mreturn String.Format("{0}{1}{2}",arraySpec,strPrefix,strName)
637642 end
@@ -700,7 +705,10 @@ namespace CodeGen.Engine
700705 if (template.Context.CurrentTask.Tweaks != ^null && template.Context.CurrentTask.Tweaks.Contains("PARAMDEFSTR"))
701706 begin
702707 strPrefix = "str"
703- strName = StringTools.PascalCase(param.StructureName.EndsWith("S") ? param.StructureName.Substring(0,param.StructureName.Length-1) : param.StructureName)
708+ if (template.Context.CurrentTask.NoCustomPluralization) then
709+ strName = StringTools.PascalCase(param.StructureName)
710+ else
711+ strName = StringTools.PascalCase(param.StructureName.EndsWith("S") ? param.StructureName.Substring(0,param.StructureName.Length-1) : param.StructureName)
704712 end
705713 mreturn String.Format("{0}{1}",strPrefix,strName)
706714 end
@@ -764,6 +772,88 @@ namespace CodeGen.Engine
764772 mreturn ExpandParameterLoopToken(tkn, template, loops, doExpand)
765773 endmethod
766774
775+ private static method expandParameterMaxValue, string
776+ tkn, @Token
777+ template, @FileNode
778+ loops, @IEnumerable<LoopNode>
779+ endparams
780+ proc
781+ lambda doExpand(catalog,iface,meth,param)
782+ begin
783+ data maxValue = String.Empty
784+ data nines, a28, "9999999999999999999999999999"
785+ using param.Type select
786+ (ParameterType.Decimal),
787+ begin
788+ maxValue = nines(1:param.Size)
789+ end
790+ (ParameterType.Integer),
791+ begin
792+ using param.Size select
793+ (1),
794+ maxValue = "127"
795+ (2),
796+ maxValue = "32767"
797+ (4),
798+ maxValue = "2147483647"
799+ (8),
800+ maxValue = "9223372036854775807"
801+ endusing
802+ end
803+ (ParameterType.ImpliedDecimal),
804+ begin
805+ maxValue = String.Format("{0}.{1}",nines(1:param.Size-param.Precision),nines(1:param.Precision))
806+ end
807+ (),
808+ nop
809+ endusing
810+
811+ mreturn maxValue
812+ end
813+ mreturn ExpandParameterLoopToken(tkn, template, loops, doExpand)
814+ endmethod
815+
816+ private static method expandParameterMinValue, string
817+ tkn, @Token
818+ template, @FileNode
819+ loops, @IEnumerable<LoopNode>
820+ endparams
821+ proc
822+ lambda doExpand(catalog,iface,meth,param)
823+ begin
824+ data minValue = String.Empty
825+ data nines, a28, "9999999999999999999999999999"
826+ using param.Type select
827+ (ParameterType.Decimal),
828+ begin
829+ minValue = String.Format("-{0}",nines(1:param.Size))
830+ end
831+ (ParameterType.Integer),
832+ begin
833+ using param.Size select
834+ (1),
835+ minValue = "-128"
836+ (2),
837+ minValue = "-32768"
838+ (4),
839+ minValue = "-2147483648"
840+ (8),
841+ minValue = "-9223372036854775808"
842+ endusing
843+ end
844+ (ParameterType.ImpliedDecimal),
845+ begin
846+ minValue = String.Format("-{0}.{1}",nines(1:param.Size-param.Precision),nines(1:param.Precision))
847+ end
848+ (),
849+ nop
850+ endusing
851+
852+ mreturn minValue
853+ end
854+ mreturn ExpandParameterLoopToken(tkn, template, loops, doExpand)
855+ endmethod
856+
767857 private static method expandParameterStructure, string
768858 tkn, @Token
769859 template, @FileNode
0 commit comments