Support for handling null when creating evalvalues
This commit is contained in:
		| @@ -10,6 +10,8 @@ namespace PorygonSharp.EvalValues | ||||
|     { | ||||
|         public static EvalValue CreateValue(object o) | ||||
|         { | ||||
|             if (o == null) | ||||
|                 return new EvalValue(CreateNilEvalValue()); | ||||
|             var type     = o.GetType(); | ||||
|             if (type.IsEnum && !type.IsGenericParameter) | ||||
|             { | ||||
| @@ -64,6 +66,8 @@ namespace PorygonSharp.EvalValues | ||||
|             return new EvalValue(ptr); | ||||
|         } | ||||
|          | ||||
|         [DllImport("libPorygonLang", EntryPoint = "CreateNilEvalValue",CallingConvention = CallingConvention.Cdecl)] | ||||
|         internal static extern IntPtr CreateNilEvalValue(); | ||||
|         [DllImport("libPorygonLang", EntryPoint = "CreateIntegerEvalValue",CallingConvention = CallingConvention.Cdecl)] | ||||
|         internal static extern IntPtr CreateIntegerEvalValue(long l); | ||||
|         [DllImport("libPorygonLang", EntryPoint = "CreateFloatEvalValue",CallingConvention = CallingConvention.Cdecl)] | ||||
|   | ||||
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user