From 46c439e99eef093d6eccdf6232e23ba9d78cf08a Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Sat, 24 Apr 2021 08:52:13 +0300 Subject: [PATCH] fix #2366 --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 4 ++-- Parsers/PascalABCParserNewSaushkin/ABCPascal.cs | 6 +++--- Parsers/PascalABCParserNewSaushkin/ABCPascalParserTools.cs | 1 + Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs | 6 +++--- Parsers/PascalABCParserNewSaushkin/PABC.ymc | 2 ++ Release/pabcversion.txt | 2 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- SyntaxTree/tree/TreeHelper.cs | 1 + TestSuite/S_literal.pas | 4 ++++ TreeConverter/TreeConversion/syntax_tree_visitor.cs | 2 +- 11 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 TestSuite/S_literal.pas diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 419bdb63f..43a6ece10 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 = "8"; public const string Build = "0"; - public const string Revision = "2891"; + public const string Revision = "2892"; 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 417e8130a..b71da9438 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=8 -%REVISION%=2891 %COREVERSION%=0 +%REVISION%=2892 +%MINOR%=8 %MAJOR%=3 diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs index d6df5a83f..c5a3d28ec 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs @@ -1,9 +1,9 @@ // // This CSharp output file generated by Gardens Point LEX // Version: 1.1.3.301 -// Machine: DESKTOP-2BJCJ7I -// DateTime: 05.04.2021 12:23:25 -// UserName: ibond +// Machine: DESKTOP-G8V08V4 +// DateTime: 24.04.2021 8:44:33 +// UserName: ????????? // GPLEX input file // GPLEX frame file // diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalParserTools.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalParserTools.cs index 2607e920c..a5db12393 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalParserTools.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalParserTools.cs @@ -446,6 +446,7 @@ namespace PascalABCSavParser literal lt; text = ReplaceSpecialSymbols(text.Substring(2, text.Length - 3)); lt = new string_const(text); + (lt as string_const).IsInterpolated = true; lt.source_context = sc; return lt; } diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index 37ea31efe..58a6cd5cc 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -1,9 +1,9 @@ // (see accompanying GPPGcopyright.rtf) // GPPG version 1.3.6 -// Machine: DESKTOP-2BJCJ7I -// DateTime: 05.04.2021 12:23:26 -// UserName: ibond +// Machine: DESKTOP-G8V08V4 +// DateTime: 24.04.2021 8:44:33 +// UserName: ????????? // Input file // options: no-lines gplex diff --git a/Parsers/PascalABCParserNewSaushkin/PABC.ymc b/Parsers/PascalABCParserNewSaushkin/PABC.ymc index 984b4b0c2..dba837415 100644 --- a/Parsers/PascalABCParserNewSaushkin/PABC.ymc +++ b/Parsers/PascalABCParserNewSaushkin/PABC.ymc @@ -327,6 +327,8 @@ script= + + diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index f9a6d894f..54ce4a427 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.8.0.2891 +3.8.0.2892 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 977c89c5b..664c0ebd0 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.8.0.2891' +!define VERSION '3.8.0.2892' diff --git a/SyntaxTree/tree/TreeHelper.cs b/SyntaxTree/tree/TreeHelper.cs index d9dccce5b..9e3cc6fcf 100644 --- a/SyntaxTree/tree/TreeHelper.cs +++ b/SyntaxTree/tree/TreeHelper.cs @@ -627,6 +627,7 @@ namespace PascalABCCompiler.SyntaxTree { return "'" + Value + "'"; } + public bool IsInterpolated = false; } public partial class expression_list diff --git a/TestSuite/S_literal.pas b/TestSuite/S_literal.pas new file mode 100644 index 000000000..6fb5e2fe5 --- /dev/null +++ b/TestSuite/S_literal.pas @@ -0,0 +1,4 @@ +begin + var a := $'d'; + Assert(a.GetType = typeof(string)); +end. \ No newline at end of file diff --git a/TreeConverter/TreeConversion/syntax_tree_visitor.cs b/TreeConverter/TreeConversion/syntax_tree_visitor.cs index 91078ac15..fa3bdf074 100644 --- a/TreeConverter/TreeConversion/syntax_tree_visitor.cs +++ b/TreeConverter/TreeConversion/syntax_tree_visitor.cs @@ -16409,7 +16409,7 @@ namespace PascalABCCompiler.TreeConverter public override void visit(SyntaxTree.string_const _string_const) { expression_node en = null; - if (_string_const.Value.Length != 1) + if (_string_const.Value.Length != 1 || _string_const.IsInterpolated) { en = new string_const_node(_string_const.Value, get_location(_string_const)); if (SemanticRules.GenerateNativeCode && SemanticRules.StringType != null)