From 8b51d0555fb0e41a80b3882a9a799af9b569fc35 Mon Sep 17 00:00:00 2001 From: sun128764 Date: Sun, 8 Oct 2023 13:52:34 +0800 Subject: [PATCH] feat: add .net6 support --- AssParser.Lib/AssParser.Lib.csproj | 4 ++-- AssParser.Lib/AssParser.cs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/AssParser.Lib/AssParser.Lib.csproj b/AssParser.Lib/AssParser.Lib.csproj index 4a72105..c54429d 100644 --- a/AssParser.Lib/AssParser.Lib.csproj +++ b/AssParser.Lib/AssParser.Lib.csproj @@ -1,7 +1,7 @@ - + - net7.0 + net7.0;net6.0 enable enable README.md diff --git a/AssParser.Lib/AssParser.cs b/AssParser.Lib/AssParser.cs index ca7aa7f..91c6095 100644 --- a/AssParser.Lib/AssParser.cs +++ b/AssParser.Lib/AssParser.cs @@ -45,7 +45,8 @@ public static async Task ParseAssFile(StreamReader assStream) { continue; } - if (tag is not ['[', .., ']']) + //if (tag is not ['[', .., ']']) //.net 7+ only + if (!tag.StartsWith('[') || !tag.EndsWith(']')) { throw new AssParserException($"{tag} is not a valid section name", assStream, lineCount, AssParserErrorType.InvalidSection); }