完全清除Resource依赖, 目前可以直接使用源码
This commit is contained in:
@@ -4,7 +4,6 @@ using System.Reflection.Emit;
|
||||
using System.Reflection;
|
||||
using Flee.InternalTypes;
|
||||
using Flee.PublicTypes;
|
||||
using Flee.Resources;
|
||||
using System;
|
||||
|
||||
namespace Flee.ExpressionElements.Base
|
||||
@@ -114,7 +113,7 @@ namespace Flee.ExpressionElements.Base
|
||||
|
||||
protected void ThrowOperandTypeMismatch(object operation, Type leftType, Type rightType)
|
||||
{
|
||||
base.ThrowCompileException(CompileErrorResourceKeys.OperationNotDefinedForTypes, CompileExceptionReason.TypeMismatch, operation, leftType.Name, rightType.Name);
|
||||
base.ThrowCompileException("OperationNotDefinedForTypes", CompileExceptionReason.TypeMismatch, operation, leftType.Name, rightType.Name);
|
||||
}
|
||||
|
||||
protected abstract Type GetResultType(Type leftType, Type rightType);
|
||||
|
@@ -2,7 +2,6 @@
|
||||
using System.Diagnostics;
|
||||
using Flee.InternalTypes;
|
||||
using Flee.PublicTypes;
|
||||
using Flee.Resources;
|
||||
|
||||
namespace Flee.ExpressionElements.Base
|
||||
{
|
||||
@@ -30,15 +29,16 @@ namespace Flee.ExpressionElements.Base
|
||||
|
||||
protected void ThrowCompileException(string messageKey, CompileExceptionReason reason, params object[] arguments)
|
||||
{
|
||||
string messageTemplate = FleeResourceManager.Instance.GetCompileErrorString(messageKey);
|
||||
string message = string.Format(messageTemplate, arguments);
|
||||
//string messageTemplate = FleeResourceManager.Instance.GetCompileErrorString(messageKey);
|
||||
//string message = string.Format(messageTemplate, arguments);
|
||||
string message = $"[{messageKey}]{string.Join(',', arguments)}";
|
||||
message = string.Concat(this.Name, ": ", message);
|
||||
throw new ExpressionCompileException(message, reason);
|
||||
}
|
||||
|
||||
protected void ThrowAmbiguousCallException(Type leftType, Type rightType, object operation)
|
||||
{
|
||||
this.ThrowCompileException(CompileErrorResourceKeys.AmbiguousOverloadedOperator, CompileExceptionReason.AmbiguousMatch, leftType.Name, rightType.Name, operation);
|
||||
this.ThrowCompileException("AmbiguousOverloadedOperator", CompileExceptionReason.AmbiguousMatch, leftType.Name, rightType.Name, operation);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Flee.ExpressionElements.Base
|
||||
get
|
||||
{
|
||||
string key = this.GetType().Name;
|
||||
string value = FleeResourceManager.Instance.GetElementNameString(key);
|
||||
string value = $"{key}";
|
||||
Debug.Assert(value != null, $"Element name for '{key}' not in resource file");
|
||||
return value;
|
||||
}
|
||||
|
@@ -3,7 +3,6 @@ using System.Diagnostics;
|
||||
using System.Reflection.Emit;
|
||||
using Flee.InternalTypes;
|
||||
using Flee.PublicTypes;
|
||||
using Flee.Resources;
|
||||
|
||||
|
||||
namespace Flee.ExpressionElements.Base.Literals
|
||||
@@ -12,7 +11,7 @@ namespace Flee.ExpressionElements.Base.Literals
|
||||
{
|
||||
protected void OnParseOverflow(string image)
|
||||
{
|
||||
base.ThrowCompileException(CompileErrorResourceKeys.ValueNotRepresentableInType, CompileExceptionReason.ConstantOverflow, image, this.ResultType.Name);
|
||||
base.ThrowCompileException("ValueNotRepresentableInType", CompileExceptionReason.ConstantOverflow, image, this.ResultType.Name);
|
||||
}
|
||||
|
||||
public static void EmitLoad(Int32 value, FleeILGenerator ilg)
|
||||
|
@@ -5,7 +5,6 @@ using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using Flee.InternalTypes;
|
||||
using Flee.PublicTypes;
|
||||
using Flee.Resources;
|
||||
|
||||
namespace Flee.ExpressionElements.Base
|
||||
{
|
||||
@@ -62,11 +61,11 @@ namespace Flee.ExpressionElements.Base
|
||||
|
||||
if (this.IsStatic == true && this.SupportsStatic == false && IsExtensionMethod == false)
|
||||
{
|
||||
base.ThrowCompileException(CompileErrorResourceKeys.StaticMemberCannotBeAccessedWithInstanceReference, CompileExceptionReason.TypeMismatch, MyName);
|
||||
base.ThrowCompileException("StaticMemberCannotBeAccessedWithInstanceReference", CompileExceptionReason.TypeMismatch, MyName);
|
||||
}
|
||||
else if (this.IsStatic == false && this.SupportsInstance == false)
|
||||
{
|
||||
base.ThrowCompileException(CompileErrorResourceKeys.ReferenceToNonSharedMemberRequiresObjectReference, CompileExceptionReason.TypeMismatch, MyName);
|
||||
base.ThrowCompileException("ReferenceToNonSharedMemberRequiresObjectReference", CompileExceptionReason.TypeMismatch, MyName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using Flee.PublicTypes;
|
||||
using Flee.Resources;
|
||||
|
||||
namespace Flee.ExpressionElements.Base
|
||||
{
|
||||
@@ -17,7 +16,7 @@ namespace Flee.ExpressionElements.Base
|
||||
|
||||
if (_myResultType == null)
|
||||
{
|
||||
base.ThrowCompileException(CompileErrorResourceKeys.OperationNotDefinedForType, CompileExceptionReason.TypeMismatch, MyChild.ResultType.Name);
|
||||
base.ThrowCompileException("OperationNotDefinedForType", CompileExceptionReason.TypeMismatch, MyChild.ResultType.Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user