Remove boolean value type from ASS highlighting

This commit is contained in:
ema
2025-07-01 04:46:39 +08:00
parent 1f13aa6678
commit 12a6b35c6c
2 changed files with 0 additions and 14 deletions

View File

@@ -478,9 +478,6 @@ public class SubStationAlphaHighlightingDefinition : DarkHighlightingDefinition
if (double.TryParse(input, out _)) if (double.TryParse(input, out _))
return ValueType.Numeric; return ValueType.Numeric;
if (bool.TryParse(input, out _))
return ValueType.Boolean;
return ValueType.String; return ValueType.String;
} }
@@ -489,7 +486,6 @@ public class SubStationAlphaHighlightingDefinition : DarkHighlightingDefinition
return type switch return type switch
{ {
ValueType.Numeric => "#B5CEA8", ValueType.Numeric => "#B5CEA8",
ValueType.Boolean => "#719BD1",
ValueType.String or _ => "#CE9178", ValueType.String or _ => "#CE9178",
}; };
} }
@@ -520,8 +516,6 @@ public class SubStationAlphaHighlightingDefinition : DarkHighlightingDefinition
return []; return [];
var result = new List<InlineText>(); var result = new List<InlineText>();
// 定义正则表达式:匹配非分隔符的连续字符段
// 分隔符包括:空格 \ { } ( ) , (注意 \\ 需要双转义)
var matches = Regex.Matches(input, @"[^{}\(\)\\,\s]+"); var matches = Regex.Matches(input, @"[^{}\(\)\\,\s]+");
foreach (Match match in matches) foreach (Match match in matches)
{ {
@@ -558,7 +552,6 @@ public class SubStationAlphaHighlightingDefinition : DarkHighlightingDefinition
{ {
String, String,
Numeric, Numeric,
Boolean,
} }
public sealed class SessionStore : Dictionary<string, Session> public sealed class SessionStore : Dictionary<string, Session>

View File

@@ -478,9 +478,6 @@ public class SubStationAlphaHighlightingDefinition : LightHighlightingDefinition
if (double.TryParse(input, out _)) if (double.TryParse(input, out _))
return ValueType.Numeric; return ValueType.Numeric;
if (bool.TryParse(input, out _))
return ValueType.Boolean;
return ValueType.String; return ValueType.String;
} }
@@ -489,7 +486,6 @@ public class SubStationAlphaHighlightingDefinition : LightHighlightingDefinition
return type switch return type switch
{ {
ValueType.Numeric => "#098658", ValueType.Numeric => "#098658",
ValueType.Boolean => "#0000FF",
ValueType.String or _ => "#A31515", ValueType.String or _ => "#A31515",
}; };
} }
@@ -520,8 +516,6 @@ public class SubStationAlphaHighlightingDefinition : LightHighlightingDefinition
return []; return [];
var result = new List<InlineText>(); var result = new List<InlineText>();
// 定义正则表达式:匹配非分隔符的连续字符段
// 分隔符包括:空格 \ { } ( ) , (注意 \\ 需要双转义)
var matches = Regex.Matches(input, @"[^{}\(\)\\,\s]+"); var matches = Regex.Matches(input, @"[^{}\(\)\\,\s]+");
foreach (Match match in matches) foreach (Match match in matches)
{ {
@@ -558,7 +552,6 @@ public class SubStationAlphaHighlightingDefinition : LightHighlightingDefinition
{ {
String, String,
Numeric, Numeric,
Boolean,
} }
public sealed class SessionStore : Dictionary<string, Session> public sealed class SessionStore : Dictionary<string, Session>