public FunctionParameter[] ToFuncParams(PluginRoot Plugin, VarDeclConvMode Mode = VarDeclConvMode.Nothing) { var Ret = new FunctionParameter[Count]; for (var i = 0; i < Count; i++) { Plugin.Reset(); Ret[i] = this[i].ToFuncParam(Plugin, Mode); } return(Ret); }
FunctionParameter ReadParameterReference(Identifier Id, bool HasDefaultValue) { var Flags = (ParameterFlags)Reader.ReadByte(); var Name = new CodeString(ReadLEB128_String()); var Param = new FunctionParameter(Id.Container, Name, null); ReadReference(Param, ReferenceDestination.Children, 0); Param.ParamFlags = Flags; if (HasDefaultValue) { Param.ConstInitValue = ReadConst(); } return(Param); }
void ReferenceParameter(FunctionParameter Param) { Writer.Write((byte)Param.ParamFlags); if (!Param.Name.IsValid) { WriteLEB128(0); } else { WriteLEB128(Param.Name.ToString()); } Reference(Param.Children[0]); if (Param.ConstInitValue != null) { WriteConst(Param.ConstInitValue); } }