Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Arc-huangjingtong committed Nov 21, 2023
1 parent 24d090f commit a0cee11
Show file tree
Hide file tree
Showing 15 changed files with 171 additions and 148 deletions.
2 changes: 1 addition & 1 deletion Arc.UniInk.Test/UniInk_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void Test08_OutKeyword(string script)
[TestCase("var w = 4-2; w++; ++w; w;")]
[TestCase("int w = 4-2; w +=3; return w;")]
[TestCase("var w = 4-2;")]
[TestCase("var w = 4-2; return (float)w;")]
// [TestCase("var w = 4-2; return (float)w;")]
[TestCase("4/2;")]
[TestCase("Test();")]
[TestCase("var ccc= new(HelperClass); return ccc.Id;")]
Expand Down
Binary file modified Arc.UniInk.Test/bin/Debug/Arc.UniInk.Test.dll
Binary file not shown.
Binary file modified Arc.UniInk.Test/bin/Debug/Arc.UniInk.Test.pdb
Binary file not shown.
Binary file modified Arc.UniInk.Test/bin/Debug/Arc.UniInk.dll
Binary file not shown.
Binary file modified Arc.UniInk.Test/bin/Debug/Arc.UniInk.pdb
Binary file not shown.
Binary file not shown.
Binary file modified Arc.UniInk.Test/obj/Debug/Arc.UniInk.Test.dll
Binary file not shown.
Binary file modified Arc.UniInk.Test/obj/Debug/Arc.UniInk.Test.pdb
Binary file not shown.
8 changes: 2 additions & 6 deletions Arc.UniInk/Arc.UniInk.sln.DotSettings.user
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@
<Assembly Path="D:\Project\UniInk\Arc.UniInk\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll" />
&lt;/AssemblyExplorer&gt;</s:String>

<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=9af9e47b_002D845e_002D42b2_002Db2ca_002D36b4229100c8/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="解决方案中的所有测试" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=9af9e47b_002D845e_002D42b2_002Db2ca_002D36b4229100c8/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="解决方案中的所有测试" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;Solution /&gt;&#xD;
&lt;/SessionState&gt;</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=b3f3cba1_002D3c8f_002D4a19_002Db38e_002D651a731b6e1a/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="UniInk_NunitTest" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;TestAncestor&gt;&#xD;
&lt;TestId&gt;NUnit3x::D4E69C6F-59C7-4687-B3E4-646E26C9A7FE::.NETFramework,Version=v4.7.1::Arc.UniInk.NunitTest.UniInk_NunitTest&lt;/TestId&gt;&#xD;
&lt;/TestAncestor&gt;&#xD;
&lt;/SessionState&gt;</s:String>




Expand Down
244 changes: 105 additions & 139 deletions Arc.UniInk/Arc.UniInk/UniInk.cs

Large diffs are not rendered by default.

65 changes: 63 additions & 2 deletions Arc.UniInk/Arc.UniInk/UniInk_Speed.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,68 @@
namespace Arc.UniInk
/************************************************************************************************************************
* 📰 Title : UniInk_Speed (https://github.com/Arc-huangjingtong/UniInk-CSharpInterpreter4Unity) *
* 🔖 Version : 1.0.0 *
* 👩‍💻 Author : Arc (https://github.com/Arc-huangjingtong) *
* 🔑 Licence : MIT (https://github.com/Arc-huangjingtong/UniInk-CSharpInterpreter4Unity/blob/main/LICENSE) *
* 🤝 Support : [.NET Framework 4+] [C# 8.0+] [IL2CPP Support] *
* 📝 Desc : [High performance] [zero box & unbox] [zero reflection runtime] [Easy-use] *
/************************************************************************************************************************/

namespace Arc.UniInk
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;

public class UniInk_Speed
{

/// <summary> Constructor </summary>
/// <param name="context" > Set context use as "This" or use internal member variables directly </param>
/// <param name="variables"> Set variables can replace a key string with value object </param>
public UniInk_Speed(object context = null, Dictionary<string, object> variables = null) { }


protected readonly Regex regex_Operator;


public class InkOperator
{
public static readonly InkOperator Plus = new(); //+
public static readonly InkOperator Minus = new(); //-
public static readonly InkOperator Multiply = new();//*
public static readonly InkOperator Divide = new();// /
public static readonly InkOperator Modulo = new();// %
public static readonly InkOperator Lower = new();// <
public static readonly InkOperator Greater = new();// >
public static readonly InkOperator Equal = new();// ==
public static readonly InkOperator LowerOrEqual = new();// <=
public static readonly InkOperator GreaterOrEqual = new();// >=
public static readonly InkOperator NotEqual = new();// !=
public static readonly InkOperator LogicalNegation = new();// !
public static readonly InkOperator ConditionalAnd = new();// &&
public static readonly InkOperator ConditionalOr = new();// ||


protected static ushort indexer;
protected ushort OperatorValue { get; }

protected InkOperator()
{
indexer++;
OperatorValue = indexer;
}

public bool Equals(InkOperator otherOperator)
{
return otherOperator != null && OperatorValue == otherOperator.OperatorValue;
}

public override int GetHashCode()
{
return OperatorValue.GetHashCode();
}
}
}
}
Binary file modified Arc.UniInk/Arc.UniInk/bin/Debug/Arc.UniInk.dll
Binary file not shown.
Binary file modified Arc.UniInk/Arc.UniInk/bin/Debug/Arc.UniInk.pdb
Binary file not shown.
Binary file modified Arc.UniInk/Arc.UniInk/obj/Debug/Arc.UniInk.dll
Binary file not shown.
Binary file modified Arc.UniInk/Arc.UniInk/obj/Debug/Arc.UniInk.pdb
Binary file not shown.

0 comments on commit a0cee11

Please sign in to comment.