Skip to content

Commit bf5f573

Browse files
committed
Update Matrix Logic
现在,(如果我没写错的话)一个版本崩溃不会炸掉所有版本了。 此外,根据反馈,恢复了chinjufu里的大括号;不过打包文件里的括号可能留不下来了。
1 parent 197ddf7 commit bf5f573

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.github/workflows/packer.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ jobs:
9595
name: Pack Resources and Upload Artifacts/Releases
9696
needs: [ build-packer, initialize-release ] # 显然,需要存在打包程序,才能打包。
9797
strategy:
98+
fail-fast: false # 把正常的文件先打包了,避免一处错误阻塞整个仓库。
9899
matrix:
99100
# 版本列表。将对这里的每个版本判断,按需打包。
100101
# 如需添加新版本,在这里添加即可。

.github/workflows/pr-packer.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
name: Pack Resources and Upload Artifacts
4747
needs: build # 显然,需要存在缓存/已经构造,才能打包。
4848
strategy:
49+
fail-fast: false # 某版本失败其实不影响其他版本。
4950
matrix:
5051
# 支持版本列表。将对这里的每个版本判断,按需打包。
5152
# 如需添加新版本,在这里添加即可。

src/Packer/Models/Providers/TermMappingProvider.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ internal static Dictionary<string, string> DeserializeFromLang(string content)
236236

237237
foreach (var line in content.AsSpan().EnumerateLines())
238238
{
239-
if (isLineContinuation) // 行尾转义符,用于换行
239+
if (isLineContinuation) // 行尾转义符,用于换行;在PARSE_ESCAPE下使用
240240
{
241241
if (line.EndsWith("\\"))
242242
{
@@ -251,6 +251,7 @@ internal static Dictionary<string, string> DeserializeFromLang(string content)
251251
continue;
252252
}
253253

254+
// PARSE_ESCAPES支持
254255
if (!isParseEscape && line.Equals("#PARSE_ESCAPES", StringComparison.Ordinal))
255256
{
256257
isParseEscape = true;
@@ -265,7 +266,7 @@ internal static Dictionary<string, string> DeserializeFromLang(string content)
265266
continue;
266267
}
267268

268-
if (line.StartsWith("//") | line.StartsWith("#") | line.StartsWith("<"))
269+
if (line.StartsWith("//") || line.StartsWith("#") || line.StartsWith("<"))
269270
continue;
270271

271272
if (line.StartsWith("/*"))
@@ -277,6 +278,11 @@ internal static Dictionary<string, string> DeserializeFromLang(string content)
277278
if (line.IsEmpty || line.IsWhiteSpace()) // 空行需去
278279
continue;
279280

281+
// 1.12/assets/chinjufumod
282+
// https://github.com/CFPAOrg/Minecraft-Mod-Language-Package/pull/3875#issuecomment-1826453830
283+
if (line.Equals("{", StringComparison.Ordinal) || line.Equals("}", StringComparison.Ordinal))
284+
continue;
285+
280286
// 基础条目
281287
var splitPosition = line.IndexOf('=');
282288

0 commit comments

Comments
 (0)