From 6e2de8da38e95198a1e9de6e7686e3fa644974ed Mon Sep 17 00:00:00 2001 From: miks1965 Date: Sat, 29 Apr 2017 00:28:56 +0300 Subject: [PATCH] bug fix #379 --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 2 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- .../StandardSyntaxConverter.cs | 2 +- .../CompilationSamples/yield_foreach_x.pas | 12 ++++++++++++ .../CompilationSamples/yield_q_Deque.pas | 10 ++++++++++ .../TreeConversion/syntax_tree_visitor.cs | 1 + bin/Lib/PABCRtl.dll | Bin 566272 -> 566272 bytes 8 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 TestSuite/CompilationSamples/yield_foreach_x.pas create mode 100644 TestSuite/CompilationSamples/yield_q_Deque.pas diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index e8963bc29..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 = "1429"; + 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 d23ad37e4..6ee1b0c1a 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %COREVERSION%=0 -%REVISION%=1429 +%REVISION%=1431 %MINOR%=2 %MAJOR%=3 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 7dbae6b63..940b84ded 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.2.0.1429' +!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/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 ccac04f6c..d29cae014 100644 --- a/TreeConverter/TreeConversion/syntax_tree_visitor.cs +++ b/TreeConverter/TreeConversion/syntax_tree_visitor.cs @@ -15930,6 +15930,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/bin/Lib/PABCRtl.dll b/bin/Lib/PABCRtl.dll index 0696f5b887bf48e86daeb84a5180b6b137075daa..8dad7922c529d25e9c38299afc074caa1edb42ba 100644 GIT binary patch delta 236 zcmV0$kr^`vuP9q$=A%L+i z3eANg8~%&bRWS?quw&LyL07pUQIzzgUvH}D=#TNDm3~bVR(nnswy?8a8?<6C1#G<#D m-3Ktj0x_hQ%AW`t5LiW`0XZI#M!ODK0eNurnYZ+x2n+;7foih= delta 236 zcmVuGsKaCb_0F2+?zd6ikc7&($y6Vs5S1;iUWDHF=-}+jb zE*n!=Nm@=6{2eN;V&e71XCq?kz7Q$egJdW00}bk=8~j(jZkBvc&l{#95eO6JtZ4TZ z3I~Da<71j;Tb#Xc8UcET?-2xt?-2!u?-2&K?-2)?%McgOMHrVF7D1dVT@hP*GBmfC m-3Ktj0z{ja%AW`t5X%%k1891RM~0Boubc%kn78zw2n+-b6=)X#