Flee
This commit is contained in:
34
ExpressionElements/Literals/Integral/UInt64.cs
Normal file
34
ExpressionElements/Literals/Integral/UInt64.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Flee.ExpressionElements.Base.Literals;
|
||||
using Flee.InternalTypes;
|
||||
|
||||
|
||||
namespace Flee.ExpressionElements.Literals.Integral
|
||||
{
|
||||
internal class UInt64LiteralElement : IntegralLiteralElement
|
||||
{
|
||||
private readonly UInt64 _myValue;
|
||||
public UInt64LiteralElement(string image, System.Globalization.NumberStyles ns)
|
||||
{
|
||||
try
|
||||
{
|
||||
_myValue = UInt64.Parse(image, ns);
|
||||
}
|
||||
catch (OverflowException ex)
|
||||
{
|
||||
base.OnParseOverflow(image);
|
||||
}
|
||||
}
|
||||
|
||||
public UInt64LiteralElement(UInt64 value)
|
||||
{
|
||||
_myValue = value;
|
||||
}
|
||||
|
||||
public override void Emit(FleeILGenerator ilg, IServiceProvider services)
|
||||
{
|
||||
EmitLoad(Convert.ToInt64(_myValue), ilg);
|
||||
}
|
||||
|
||||
public override System.Type ResultType => typeof(UInt64);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user