diff --git a/CodeCompletion/Testing.cs b/CodeCompletion/Testing.cs index 7bc65e7cc..cb0209351 100644 --- a/CodeCompletion/Testing.cs +++ b/CodeCompletion/Testing.cs @@ -1148,6 +1148,8 @@ namespace CodeCompletion if (Text.Replace("\r\n","\n") != Text2.Replace("\r\n","\n")) { int line = 1; + Text = Text.Replace("\r\n", "\n"); + Text2 = Text2.Replace("\r\n", "\n"); for (int i = 0; i < Math.Min(Text.Length, Text2.Length); i++) { if (Text[i] != Text2[i]) 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 @@ namespace PascalABCCompiler } 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 @@ namespace PascalABCCompiler compilerOptions = new NETGenerator.CompilerOptions(); - // выяснение целевой платформы + // выяснение TargetFramework и целевой платформы SetOutputPlatformOption(compilerOptions); // остальные директивы diff --git a/bin/Lib/CRT.pas b/bin/Lib/CRT.pas index 2517d5556..e934f1d11 100644 --- a/bin/Lib/CRT.pas +++ b/bin/Lib/CRT.pas @@ -185,9 +185,9 @@ function ReadKey: char;// TODO продумать это var KeyInfo: ConsoleKeyInfo; begin - if NextKey <> Chr(0) then + if NextKey <> #0 then begin - ReadKey := nextkey; + ReadKey := NextKey; NextKey := #0; end else @@ -202,7 +202,7 @@ end; function KeyPressed: boolean; begin - KeyPressed := Console.KeyAvailable; + KeyPressed := (NextKey <> #0) or Console.KeyAvailable; end; function WindowWidth: integer; @@ -330,4 +330,4 @@ end; begin //zdes oshibka ISConsoleApplication u nas nikogda ne inicializiruetsja __InitModule; -end. \ No newline at end of file +end.