From 19eaaf205596fd453ace45a52d821b6a0e606a39 Mon Sep 17 00:00:00 2001 From: Andrea Galbiati Date: Wed, 1 Nov 2023 20:54:42 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"Allow=20ValueTableLineParser=20to=20h?= =?UTF-8?q?andle=20the=20case=20of=20(number=20"=20")=20without=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DbcParserLib/Parsers/ValueTableLineParser.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/DbcParserLib/Parsers/ValueTableLineParser.cs b/DbcParserLib/Parsers/ValueTableLineParser.cs index 3859d41..594640f 100644 --- a/DbcParserLib/Parsers/ValueTableLineParser.cs +++ b/DbcParserLib/Parsers/ValueTableLineParser.cs @@ -8,8 +8,6 @@ internal class ValueTableLineParser : ILineParser private const string ValueTableLineStarter = "VAL_ "; private const string ValueTableLinkParsingRegex = @"VAL_\s+(\d+)\s+([a-zA-Z_][\w]*)\s+([a-zA-Z_][\w]*)\s*;"; private const string ValueTableParsingRegex = @"VAL_\s+(?:(?:(\d+)\s+([a-zA-Z_][\w]*))|([a-zA-Z_][\w]*))\s+((?:(?:-?\d+)\s+(?:""[^""]*"")\s+)*)\s*;"; - private const string ValueTableNewLineRegex = @"(""[^""]*""\s+)"; - private const string ValueTableNewLineRegexReplace = "$1\n"; private readonly IParseFailureObserver m_observer; @@ -35,7 +33,7 @@ public bool TryParse(string line, IDbcBuilder builder, INextLineProvider nextLin match = Regex.Match(cleanLine, ValueTableParsingRegex); if (match.Success) { - var valueTable = Regex.Replace(match.Groups[4].Value.TrimStart(), ValueTableNewLineRegex, ValueTableNewLineRegexReplace); + var valueTable = match.Groups[4].Value.TrimStart().Replace("\" ", "\"" + Environment.NewLine); var valueTableDictionary = valueTable.ToDictionary(); if (match.Groups[3].Value != "") builder.LinkTableValuesToEnvironmentVariable(match.Groups[3].Value, valueTableDictionary);