diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 31a9a3a7c..4dc5ff200 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "2"; public const string Build = "0"; - public const string Revision = "1425"; + public const string Revision = "1431"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index e710d1298..6ee1b0c1a 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %COREVERSION%=0 -%REVISION%=1425 +%REVISION%=1431 %MINOR%=2 %MAJOR%=3 diff --git a/Localization/DefaultLang.resources b/Localization/DefaultLang.resources index b464250ac..afb0ea74b 100644 Binary files a/Localization/DefaultLang.resources and b/Localization/DefaultLang.resources differ diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 9db37745d..940b84ded 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.2.0.1425' +!define VERSION '3.2.0.1431' diff --git a/SyntaxTreeConverters/StandardSyntaxConverter.cs b/SyntaxTreeConverters/StandardSyntaxConverter.cs index 0e09efd0d..9950e5bd7 100644 --- a/SyntaxTreeConverters/StandardSyntaxConverter.cs +++ b/SyntaxTreeConverters/StandardSyntaxConverter.cs @@ -42,7 +42,7 @@ namespace PascalABCCompiler.SyntaxTreeConverters /*#if DEBUG try { - //root.visit(new SimplePrettyPrinterVisitor(@"d:\\zzz3.txt")); + //root.visit(new SimplePrettyPrinterVisitor(@"d:\\zzz4.txt")); } catch { diff --git a/SyntaxVisitors/YieldVisitors/ReplaceVariableNameVisitor.cs b/SyntaxVisitors/YieldVisitors/ReplaceVariableNameVisitor.cs index 742a34b7a..d84242262 100644 --- a/SyntaxVisitors/YieldVisitors/ReplaceVariableNameVisitor.cs +++ b/SyntaxVisitors/YieldVisitors/ReplaceVariableNameVisitor.cs @@ -31,7 +31,7 @@ namespace SyntaxVisitors var upperNode = UpperNode(); if ( - (object)upperNode != null && (object)(upperNode as dot_node) == null) + upperNode != null /*&& (upperNode as dot_node) == null*/) // Я не знаю, зачем вообще было второе условие. Видимо, это всё надо убрать { //Replace(id, _newName); // заменяются только строки, а сами идентификаторы как объекты не меняются! diff --git a/TestSuite/CompilationSamples/GraphABC.pas b/TestSuite/CompilationSamples/GraphABC.pas index bb8f95c25..ab8cdd0be 100644 --- a/TestSuite/CompilationSamples/GraphABC.pas +++ b/TestSuite/CompilationSamples/GraphABC.pas @@ -532,9 +532,6 @@ procedure SetWindowCaption(s: string); /// Устанавливает заголовок графического окна procedure SetWindowTitle(s: string); -procedure AddStatusBar; - - /// Устанавливает ширину и высоту клиентской части графического окна в пикселах procedure InitWindow(Left,Top,Width,Height: integer; BackColor: Color := clWhite); @@ -2447,10 +2444,9 @@ begin end; procedure ResizeHelper; -var t: SmoothingMode; begin Monitor.Enter(f); - t := gr.SmoothingMode; + var t := gr.SmoothingMode; var m := gr.Transform; gr := Graphics.FromHwnd(f.Handle); gr.Transform := m; @@ -3403,10 +3399,8 @@ begin end; procedure SetWindowPos(l,t: integer); -var p: Proc2Integer; begin - p := ChangeFormPos; - f.Invoke(p,l,t); + f.Invoke(ChangeFormPos,l,t); end; procedure ChangeFormClientSize(w,h: integer); // вспомогательная @@ -3416,11 +3410,8 @@ begin end; procedure SetWindowSize(w,h: integer); -var p: Proc2Integer; begin - p := ChangeFormClientSize; - f.Invoke(p,w,h); - //ResizeHelper; + f.Invoke(ChangeFormClientSize,w,h); end; function GraphBoxWidth: integer; diff --git a/TestSuite/CompilationSamples/yield_foreach_x.pas b/TestSuite/CompilationSamples/yield_foreach_x.pas new file mode 100644 index 000000000..bbf2bf7ad --- /dev/null +++ b/TestSuite/CompilationSamples/yield_foreach_x.pas @@ -0,0 +1,12 @@ +function GetWords(sq:sequence of string):sequence of string; +begin + foreach var x in sq do + begin + var a := x.toWords; //â ýòîé ñòðîêå îøèáêà, åñëè ðàñêîììåíòèðîâàòü yield + yield a[0]; + end; +end; +begin + var sq := Seq('1 2 3', 'a b c d'); + GetWords(sq).Print; +end. \ No newline at end of file diff --git a/TestSuite/CompilationSamples/yield_q_Deque.pas b/TestSuite/CompilationSamples/yield_q_Deque.pas new file mode 100644 index 000000000..70df396f5 --- /dev/null +++ b/TestSuite/CompilationSamples/yield_q_Deque.pas @@ -0,0 +1,10 @@ +function SeqGen: sequence of integer; +begin + var q := new Queue; + var d := q.Dequeue; + yield 1; +end; + + +begin +end. \ No newline at end of file diff --git a/TreeConverter/TreeConversion/syntax_tree_visitor.cs b/TreeConverter/TreeConversion/syntax_tree_visitor.cs index 54606fdcd..471773c30 100644 --- a/TreeConverter/TreeConversion/syntax_tree_visitor.cs +++ b/TreeConverter/TreeConversion/syntax_tree_visitor.cs @@ -15931,6 +15931,7 @@ namespace PascalABCCompiler.TreeConverter // SSM 26.06.16 - правка в связи с автовыведением типов в yieldах if (to.type is auto_type) { + try_convert_typed_expression_to_function_call(ref from); if (to is class_field_reference) { var cfr = to as class_field_reference; diff --git a/Yield/YieldConversionSyntax/YieldDesugarSyntaxTreeConverter.cs b/Yield/YieldConversionSyntax/YieldDesugarSyntaxTreeConverter.cs index 812721f99..0381b505d 100644 --- a/Yield/YieldConversionSyntax/YieldDesugarSyntaxTreeConverter.cs +++ b/Yield/YieldConversionSyntax/YieldDesugarSyntaxTreeConverter.cs @@ -24,7 +24,7 @@ namespace YieldDesugarSyntaxTreeConverter #if DEBUG try { - //root.visit(new SimplePrettyPrinterVisitor(@"d:\\zzz1.txt")); + //root.visit(new SimplePrettyPrinterVisitor(@"d:\\zzz3.txt")); } catch { diff --git a/bin/Lib/GraphABC.pas b/bin/Lib/GraphABC.pas index bb8f95c25..ab8cdd0be 100644 --- a/bin/Lib/GraphABC.pas +++ b/bin/Lib/GraphABC.pas @@ -532,9 +532,6 @@ procedure SetWindowCaption(s: string); /// Устанавливает заголовок графического окна procedure SetWindowTitle(s: string); -procedure AddStatusBar; - - /// Устанавливает ширину и высоту клиентской части графического окна в пикселах procedure InitWindow(Left,Top,Width,Height: integer; BackColor: Color := clWhite); @@ -2447,10 +2444,9 @@ begin end; procedure ResizeHelper; -var t: SmoothingMode; begin Monitor.Enter(f); - t := gr.SmoothingMode; + var t := gr.SmoothingMode; var m := gr.Transform; gr := Graphics.FromHwnd(f.Handle); gr.Transform := m; @@ -3403,10 +3399,8 @@ begin end; procedure SetWindowPos(l,t: integer); -var p: Proc2Integer; begin - p := ChangeFormPos; - f.Invoke(p,l,t); + f.Invoke(ChangeFormPos,l,t); end; procedure ChangeFormClientSize(w,h: integer); // вспомогательная @@ -3416,11 +3410,8 @@ begin end; procedure SetWindowSize(w,h: integer); -var p: Proc2Integer; begin - p := ChangeFormClientSize; - f.Invoke(p,w,h); - //ResizeHelper; + f.Invoke(ChangeFormClientSize,w,h); end; function GraphBoxWidth: integer; diff --git a/bin/Lib/PABCRtl.dll b/bin/Lib/PABCRtl.dll index ca65c79e7..8dad7922c 100644 Binary files a/bin/Lib/PABCRtl.dll and b/bin/Lib/PABCRtl.dll differ