refactor: Update Unity to 2022.3.62

This commit is contained in:
2025-06-21 01:22:02 +08:00
parent d71bf7d4a5
commit 283783954f
112 changed files with 778 additions and 907 deletions

View File

@@ -114,7 +114,7 @@ namespace Cryville.Common.Pdt {
}
}
public partial class PdtInterpreter {
static readonly Dictionary<char, int> OP_PRIORITY = new Dictionary<char, int> {
static readonly Dictionary<char, int> OP_PRIORITY = new() {
{ '@', 7 },
{ '*', 6 }, { '/', 6 }, { '%', 6 },
{ '+', 5 }, { '-', 5 },
@@ -125,7 +125,7 @@ namespace Cryville.Common.Pdt {
{ ',', 0 },
{ '$', -1 },
};
static readonly Dictionary<char, int> OP_TYPE = new Dictionary<char, int> {
static readonly Dictionary<char, int> OP_TYPE = new() {
{ '@', 0 },
{ '*', 0 }, { '/', 0 }, { '%', 0 },
{ '+', 0 }, { '-', 0 },
@@ -153,10 +153,10 @@ namespace Cryville.Common.Pdt {
private struct PdtExpToken {
public CharCategory Type { get; set; }
public string Value { get; set; }
public override string ToString() {
public override readonly string ToString() {
return string.Format("0x{0:x4}: {1}", Type, Value);
}
public static readonly PdtExpToken EmptyOperator = new PdtExpToken {
public static readonly PdtExpToken EmptyOperator = new() {
Type = CharCategory.Operator,
Value = "$",
};
@@ -249,13 +249,12 @@ namespace Cryville.Common.Pdt {
PdtExpToken? buf = null;
while (true) {
if (buf != null && t.Type != CharCategory.OpeningBracket) {
PdtExpression def;
if (defs.TryGetValue(buf.Value.Value, out def)) {
if (defs.TryGetValue(buf.Value.Value, out PdtExpression def)) {
foreach (var i in def.Instructions) ins.AddLast(i);
}
else {
var name = buf.Value.Value;
if (name[0] == '?') ins.AddLast(new PdtInstruction.PushVariable(name.Substring(1), true));
if (name[0] == '?') ins.AddLast(new PdtInstruction.PushVariable(name[1..], true));
else ins.AddLast(new PdtInstruction.PushVariable(name));
}
buf = null;