From 8b971136dc687b5363f1b0272aa988484a2f7758 Mon Sep 17 00:00:00 2001 From: samuraiGH Date: Mon, 29 Jan 2024 20:53:20 +0300 Subject: [PATCH] repair TargetFramework directive --- Compiler/Compiler.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Compiler/Compiler.cs b/Compiler/Compiler.cs index 6430aaced..3b033793c 100644 --- a/Compiler/Compiler.cs +++ b/Compiler/Compiler.cs @@ -2005,14 +2005,14 @@ private void SetOutputPlatformOption(NETGenerator.CompilerOptions compilerOption } if (CompilerOptions.Only32Bit) compilerOptions.platformtarget = NETGenerator.CompilerOptions.PlatformTarget.x86; - - // целевой framework - if (this.compilerDirectives.TryGetValue(TreeConverter.compiler_string_consts.compiler_directive_targetframework, out compilerDirectivesList)) + } + if (compilerDirectives.TryGetValue(TreeConverter.compiler_string_consts.compiler_directive_targetframework, out compilerDirectivesList)) + { + compilerOptions.TargetFramework = compilerDirectivesList[0].directive; + if (!(new string[] { "net40", "net403", "net45", "net451", "net452", "net46", "net461", "net462", "net47", "net471", "net472", "net48", "net481" }) + .Contains(compilerOptions.TargetFramework)) { - compilerOptions.TargetFramework = compilerDirectivesList[0].directive; - if (!(new string[] { "net40", "net403", "net45", "net451", "net452", "net46", "net461", "net462", "net47", "net471", "net472", "net48", "net481" }) - .Contains(compilerOptions.TargetFramework)) - ErrorsList.Add(new UnsupportedTargetFramework(compilerOptions.TargetFramework, compilerDirectivesList[0].location)); + ErrorsList.Add(new UnsupportedTargetFramework(compilerOptions.TargetFramework, compilerDirectivesList[0].location)); } } } @@ -2329,7 +2329,7 @@ private void PrebuildMainSemanticTreeActions(out NETGenerator.CompilerOptions co compilerOptions = new NETGenerator.CompilerOptions(); - // выяснение целевой платформы + // выяснение TargetFramework и целевой платформы SetOutputPlatformOption(compilerOptions); // остальные директивы