Skip to content

Commit 05043fa

Browse files
Merge branch 'feature/xSharpCompiler'
2 parents 64e733f + c70ae0e commit 05043fa

File tree

12 files changed

+169
-16
lines changed

12 files changed

+169
-16
lines changed

Tests/Applications/C875/Prg/C875.prg

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// 875. MemVars created inside macros do not continue to exist after macro execution
2+
// https://github.com/X-Sharp/XSharpPublic/issues/1182
3+
FUNCTION Start( ) AS VOID
4+
//PUBLIC somevar // works with that
5+
//Evaluate('__MemVarDecl("somevar", false)') // also with that
6+
? Evaluate("somevar := 123")
7+
? Evaluate("somevar") // XSharp.Error: Variable does not exist
8+
? somevar // XSharp.Error: Variable does not exist
9+

Tests/xSharp Tests.viproj

+114
Original file line numberDiff line numberDiff line change
@@ -116889,6 +116889,120 @@ AppConfig = Release,22222222-2222-2222-2222-222222222222
116889116889
ForceX86=0
116890116890
Optimize=0
116891116891
ENDApplication = R879 - Version attribute looses leading zero
116892+
116893+
ApplicationGroup = B9CFE839-D401-428D-94E9-E9D21E9F772D
116894+
; ************** APPLICATION C875 - MemVars created inside macros do not continue to exist after macro execution *************
116895+
Application = C875 - MemVars created inside macros do not continue to exist after macro execution
116896+
IDEVersion = 1.06
116897+
GalleryName =
116898+
GalleryPage =
116899+
GalleryDefaultName =
116900+
Target = 0
116901+
Platform = AnyCPU
116902+
Language = XSharp
116903+
Runtime = CLR4
116904+
Dialect = VO
116905+
Folder = %ProjectPath%\Applications\C875\
116906+
PrgSubFolder = \Prg
116907+
ResourcesSubFolder =
116908+
Description =
116909+
NameSpace =
116910+
Assembly = C875
116911+
Extension =
116912+
ApplicationIcon =
116913+
OutputFolder =
116914+
Frameworks = 1
116915+
GUID = D55CDEF3-833B-4F4F-B700-C1112F228638
116916+
IncludeInProjectBuild = 1
116917+
IncludeInProjectSearch = 1
116918+
IncludeInProjectExport = 1
116919+
IncludePath =
116920+
StdDefsFile =
116921+
AppToRun =
116922+
SignAssembly = 0
116923+
KeyFile =
116924+
116925+
[ExportOptions]
116926+
ExportResources = 0
116927+
ExportImages = 0
116928+
[C875 - MemVars created inside macros do not continue to exist after macro execution FileGroups]
116929+
[C875 - MemVars created inside macros do not continue to exist after macro execution Files]
116930+
File = %AppPath%\Prg\C875.prg
116931+
FileGUID = 276AAD0C-E555-42A8-9D67-35E5A25D7FCE
116932+
FileType = Code
116933+
CopyToBin = 0
116934+
[C875 - MemVars created inside macros do not continue to exist after macro execution References]
116935+
ReferenceGAC = CLR4,System,1,0,4.0.0.0
116936+
ReferenceGAC = CLR4,XSharp.Core,1,0,2.6.0.0
116937+
ReferenceGAC = CLR4,XSharp.RT,1,0,2.6.0.0
116938+
[C875 - MemVars created inside macros do not continue to exist after macro execution Resources]
116939+
[C875 - MemVars created inside macros do not continue to exist after macro execution Native Resources]
116940+
[C875 - MemVars created inside macros do not continue to exist after macro execution License files]
116941+
[C875 - MemVars created inside macros do not continue to exist after macro execution General Options]
116942+
Switches=
116943+
ZeroArrays=0
116944+
CaseSensitive=0
116945+
ImplicitNamespace=0
116946+
VO1=0
116947+
VO2=0
116948+
VO3=0
116949+
VO4=0
116950+
VO5=0
116951+
VO6=0
116952+
VO7=0
116953+
VO8=0
116954+
VO9=0
116955+
VO10=0
116956+
VO11=0
116957+
VO12=0
116958+
VO13=0
116959+
VO14=0
116960+
VO16=0
116961+
VO17=0
116962+
FOX1=0
116963+
FOX2=0
116964+
XPP1=0
116965+
LateBound=0
116966+
Unsafe=0
116967+
Undeclared=1
116968+
EnforceSelf=0
116969+
EnforceOverride=0
116970+
UseNativeVersion=0
116971+
MemVar=1
116972+
IgnoreStdDefs=0
116973+
Ovf=0
116974+
FOvf=0
116975+
ResponseOnly=0
116976+
[C875 - MemVars created inside macros do not continue to exist after macro execution Configurations]
116977+
AppConfig = Debug,11111111-1111-1111-1111-111111111111
116978+
Switches=
116979+
SwitchesCF=
116980+
CommandLine=
116981+
CommandLineCF=
116982+
Debug=1
116983+
DebugInit=1
116984+
DefineDebug=1
116985+
DefineTrace=0
116986+
SyntaxOnly=0
116987+
WarningsErrors=0
116988+
ForceConsole=0
116989+
ForceX86=0
116990+
Optimize=0
116991+
AppConfig = Release,22222222-2222-2222-2222-222222222222
116992+
Switches=
116993+
SwitchesCF=
116994+
CommandLine=
116995+
CommandLineCF=
116996+
Debug=0
116997+
DebugInit=0
116998+
DefineDebug=0
116999+
DefineTrace=0
117000+
SyntaxOnly=0
117001+
WarningsErrors=0
117002+
ForceConsole=0
117003+
ForceX86=0
117004+
Optimize=0
117005+
ENDApplication = C875 - MemVars created inside macros do not continue to exist after macro execution
116892117006
[EndApplications]
116893117007

116894117008
[Configurations]

XSharp/docs/Topics/VersionHistory.xml

+14-3
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,33 @@
1313
</header>
1414
<para styleclass="Body Text">Note: When an item has a matching GitHub ticket then the ticket number is behind the item in parentheses prefixed with #. You can find these tickets by going to: <br/>https://github.com/X-Sharp/XSharpPublic/issues/<text style="font-weight:bold;">nnn</text> where <text style="font-weight:bold;">nnn</text> is the ticket number.<br/>If you find an issue in X# we recommend that you report it on GitHub. You will be notified of the progress on the work on your issue and the ticket number will be included in the documentation of new builds from now on (April 2021).</para>
1515
<para styleclass="Body Text"></para>
16+
<para styleclass="Heading1">Changes in 2.14.0.2</para>
17+
<para styleclass="Heading2">Visual Studio Integration</para>
18+
<para styleclass="Heading3">Bug fixes</para>
19+
<list id="127" type="ul" listtype="bullet" formatstring="&#183;" format-charset="SYMBOL_CHARSET" levelreset="true" legalstyle="false" startfrom="1" styleclass="Body Text" style="font-family:Symbol; font-size:11pt; color:#000000;">
20+
<li styleclass="Body Text">Fixed a problem with indenting after keywords such as IF, DO WHILE etc</li>
21+
<li styleclass="Body Text">Fixed a problem with selecting words at the end of a line when debugging</li>
22+
<li styleclass="Body Text">Fixed a problem where Format Document could lock up VS</li>
23+
<li styleclass="Body Text">Fixed a problem that accessors such as GET and SET were not indented inside the property block</li>
24+
<li styleclass="Body Text">Fixed a problem that Format Document was not working for some documents</li>
25+
<li styleclass="Body Text">Changed the priority of the background scanner that is responsible for keyword colorization and derived tasks inside VS.</li>
26+
</list>
1627
<para styleclass="Heading1">Changes in 2.14.0.1</para>
1728
<para styleclass="Heading2">Compiler</para>
1829
<para styleclass="Heading3">Bug fixes</para>
19-
<list id="254" type="ul" listtype="bullet" formatstring="&#183;" format-charset="SYMBOL_CHARSET" levelreset="true" legalstyle="false" startfrom="1" styleclass="Body Text" style="font-family:Symbol; font-size:11pt; color:#000000;">
30+
<list id="127" type="ul" listtype="bullet" formatstring="&#183;" format-charset="SYMBOL_CHARSET" levelreset="true" legalstyle="false" startfrom="1" styleclass="Body Text" style="font-family:Symbol; font-size:11pt; color:#000000;">
2031
<li styleclass="Body Text">Fixed a problem with date literals resulting in a message about an unknown alias &quot;gloal&quot; (#1178)</li>
2132
<li styleclass="Body Text">Fixed a problem that leading 0 characters in AssemblyFileVersion and AssemblyInformationalVersion were lost. If the attribute does not have the wildcard &apos;*&apos; then these leading zeros are preserved (#1179)</li>
2233
</list>
2334
<para styleclass="Heading2">Runtime</para>
2435
<para styleclass="Heading3">Bug fixes</para>
25-
<list id="254" type="ul" listtype="bullet" formatstring="&#183;" format-charset="SYMBOL_CHARSET" levelreset="true" legalstyle="false" startfrom="1" styleclass="Body Text" style="font-family:Symbol; font-size:11pt; color:#000000;">
36+
<list id="127" type="ul" listtype="bullet" formatstring="&#183;" format-charset="SYMBOL_CHARSET" levelreset="true" legalstyle="false" startfrom="1" styleclass="Body Text" style="font-family:Symbol; font-size:11pt; color:#000000;">
2637
<li styleclass="Body Text">The runtime DLLs for 2.14.0.0 were marked with the TargetFramework Attribute. This caused problems. The attribute is no longer set on the runtime DLLs (#1177)</li>
2738
</list>
2839
<para styleclass="Heading1">Changes in 2.14.0.0</para>
2940
<para styleclass="Heading2">Compiler</para>
3041
<para styleclass="Heading3">Bug fixes</para>
31-
<list id="254" type="ul" listtype="bullet" formatstring="&#183;" format-charset="SYMBOL_CHARSET" levelreset="true" legalstyle="false" startfrom="1" styleclass="Body Text" style="font-family:Symbol; font-size:11pt; color:#000000;">
42+
<list id="127" type="ul" listtype="bullet" formatstring="&#183;" format-charset="SYMBOL_CHARSET" levelreset="true" legalstyle="false" startfrom="1" styleclass="Body Text" style="font-family:Symbol; font-size:11pt; color:#000000;">
3243
<li styleclass="Body Text">Fixed a problem resolving methods when a type &#160;and a local have the same name (#922)</li>
3344
<li styleclass="Body Text">Improved XML doc messages for methods implicitly generated by the compiler (INITs, implicit constructors) (#1128)</li>
3445
<li styleclass="Body Text">Fixed an internal compiler error with DELEGATEs with default parameter values (#1129)</li>

XSharp/docs/XSHelp.hmxp

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<helpproject xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="helpproject.xsd" version="2.0" isskin="false" isrepository="false">
2+
<helpproject xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="helpproject.xsd" version="2.2" isskin="false" isrepository="false">
33
<config>
44
<namespaces/>
55
<export-task-groups>
@@ -19,7 +19,7 @@
1919
<task-config-value name="outputfile">..\artifacts\Help\HTML\index.html</task-config-value>
2020
<task-config-value name="skin">XSharp_WebHelp.hmskin</task-config-value>
2121
<task-config-value name="make3include">HTML</task-config-value>
22-
<task-config-value name="make3includeskin">OPT_PARENTHOME,OPT_TOPICFOOTER</task-config-value>
22+
<task-config-value name="make3includeskin">OPT_PARENTHOME,OPT_TOPICFOOTER,OPT_WEBFONTS</task-config-value>
2323
<task-config-value name="make3status">*</task-config-value>
2424
</task-config-group>
2525
</export-task>
@@ -49,7 +49,7 @@
4949
<helpwindows>
5050
<helpwindow name="Main" left="86" top="51" width="800" height="600">
5151
<caption translate="true">(X#) XSharp Runtime Documentation</caption>
52-
<window-options-chm navigation="true" navigationwidth="220" search="true" favorite="true" saveregistry="true" buttons="14462">
52+
<window-options-chm navigation="true" navigationwidth="220" index="true" search="true" favorite="true" saveregistry="true" buttons="14462">
5353
<user-button name="jump1">
5454
<caption translate="true">jump1</caption>
5555
</user-button>
@@ -153,6 +153,7 @@
153153
<tablestyleclass name="Default">
154154
<style-set media="screen">width:auto; cell-padding:5px; cell-spacing:0px; page-break-inside:auto; border-width:0px; border-spacing:0px; cell-border-width:0px; border-style:none; background-color:none; head-row-background-color:#c0c0c0; alt-row-background-color:#ccffff;</style-set>
155155
</tablestyleclass>
156+
<imagestyleclass name="Default"/>
156157
</styleclasses>
157158
<config-group name="project">
158159
<config-value name="title" translate="true">XSharp</config-value>
@@ -189,7 +190,7 @@
189190
<config-value name="make3status">*</config-value>
190191
<config-value name="tidyxml">1</config-value>
191192
<config-value name="contents">XSharp</config-value>
192-
<config-value name="make3includeskin">OPT_PARENTHOME,OPT_TOPICFOOTER</config-value>
193+
<config-value name="make3includeskin">OPT_PARENTHOME,OPT_TOPICFOOTER,OPT_WEBFONTS</config-value>
193194
<config-value name="make5include">PRINT</config-value>
194195
<config-value name="make5status">*</config-value>
195196
</config-group>
@@ -641,7 +642,7 @@
641642
<config-group name="user">
642643
<config-group name="robert">
643644
<config-group name="project">
644-
<config-value name="lastexport">0</config-value>
645+
<config-value name="lastexport">3</config-value>
645646
</config-group>
646647
<config-group name="report">
647648
<config-value name="type">6</config-value>

XSharp/docs/helpproject.xsl

+10
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,12 @@ Snippet: <b><xsl:value-of select="@src"/></b>
321321
&#160;&#160;&#160;&#160;&#160;
322322
</xsl:template>
323323

324+
<xsl:template match="linklist">
325+
<div style="width:100%;text-align:center;padding:4px;background-color:#E2E2E2;border:1px dashed #000000">
326+
Linklist: <b><xsl:value-of select="@type"/></b>
327+
</div>
328+
</xsl:template>
329+
324330
<xsl:template match="embedded-image">
325331
<span style="border:2px dashed #000000;padding:2px;font-weight:bold;color:#FFFFFF;background-color:#FF0000">Embedded image</span>
326332
</xsl:template>
@@ -329,6 +335,10 @@ Snippet: <b><xsl:value-of select="@src"/></b>
329335
<span style="border:2px dashed #000000;padding:2px;font-weight:bold;color:#FFFFFF;background-color:#FF0000">Embedded OLE control</span>
330336
</xsl:template>
331337

338+
<xsl:template match="equation">
339+
<span style="border:2px dashed #000000;padding:2px;font-weight:bold;color:#FFFFFF;background-color:#FF0000">Equation object</span>
340+
</xsl:template>
341+
332342
<xsl:template match="toggle">
333343
<xsl:variable name="caption">
334344
<xsl:copy-of select="./caption"/>

XSharp/eng/Versions.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See License.txt in the project root for license information.
1414
<MajorVersion>2</MajorVersion>
1515
<MinorVersion>14</MinorVersion>
1616
<PatchVersion>0</PatchVersion>
17-
<PreReleaseVersionLabel>0</PreReleaseVersionLabel>
17+
<PreReleaseVersionLabel>2</PreReleaseVersionLabel>
1818
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
1919
<!--
2020
By default the assembly version in official builds is "$(MajorVersion).$(MinorVersion).0.0".

XSharp/src/Common/BuildNumber.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
#ifdef RUNTIME
1414
#define VERSION_NUMBER "2.6.0.0"
1515
#else
16-
#define VERSION_NUMBER "2.14.0.1"
16+
#define VERSION_NUMBER "2.14.0.2"
1717
#endif
1818

1919
// This is the file version number, which is ignored by .NET but used by Windows installer to determine
2020
// whether one file is newer than another.
2121
// This typically would change if we're generating a patch, otherwise it should be the same as VERSION_NUMBER
22-
#define FILEVERSION_NUMBER "2.14.0.1"
22+
#define FILEVERSION_NUMBER "2.14.0.2"
2323
#define INFORMATIONAL_NUMBER "2.14 GA"
2424

2525
#ifdef __DEBUG__

XSharp/src/Common/Constants.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ internal class Constants
1616
#if RUNTIME
1717
internal const string Version = "2.6.0.0";
1818
#else
19-
internal const string Version = "2.14.0.1";
19+
internal const string Version = "2.14.0.2";
2020
#endif
21-
internal const string FileVersion = "2.14.0.1";
21+
internal const string FileVersion = "2.14.0.2";
2222
internal const string ProductVersion = "2.14 GA";
2323
internal const string PublicKey = "ed555a0467764586";
2424
internal const string Copyright = "Copyright © XSharp BV 2015-2022";

XSharp/src/Compiler/XSharpBuildTask/Xsc.cs

+4
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,10 @@ internal void AddVOCompatibilityCommands(XSharpCommandLineBuilder commandline)
746746

747747
if (NS) // Add Default Namespace
748748
{
749+
if (this.RootNameSpace.Contains(" "))
750+
{
751+
this.RootNameSpace = '"' + this.RootNameSpace + '"';
752+
}
749753
commandline.AppendSwitch("/ns:" + this.RootNameSpace);
750754
}
751755
commandline.AppendPlusOrMinusSwitch("/allowdot", _store, nameof(AllowDot));

XSharp/src/Compiler/XSharpCodeAnalysis/Binder/Binder_Symbols.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,17 @@ internal Symbol XSharpResolveEqualSymbols(Symbol first, Symbol second, Immutable
8484

8585
CSDiagnosticInfo GenerateWarning(Symbol s1, Symbol s2)
8686
{
87+
var asm1 = s1.ContainingAssembly?.Name ?? "Unknown";
88+
var asm2 = s2.ContainingAssembly?.Name ?? "Unknown";
8789
return new CSDiagnosticInfo(ErrorCode.WRN_XSharpAmbiguous, originalSymbols,
8890
new object[] {
8991
where,
9092
s1.Kind.ToString(),
9193
new FormattedSymbol(s1, SymbolDisplayFormat.CSharpErrorMessageFormat),
92-
s1.ContainingAssembly.Name,
94+
asm1,
9395
s2.Kind.ToString(),
9496
new FormattedSymbol(s2, SymbolDisplayFormat.CSharpErrorMessageFormat),
95-
s2.ContainingAssembly.Name
97+
asm2
9698
});
9799

98100
}

XSharp/src/Compiler/XSharpCodeAnalysis/CommandLine/XSharpCommandLineParser.cs

+2
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ internal bool ParseXSharpArgument(ref string name, ref string value, string arg,
143143
}
144144
else
145145
{
146+
if (value.StartsWith("\"") && value.EndsWith("\""))
147+
value = value.Substring(1, value.Length - 2).Replace(' ', '_');
146148
options.NameSpace = value;
147149
}
148150
break;

XSharp/src/Compiler/XSharpCodeAnalysis/Parser/XSharpTreeTransformationRT.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public override string GetGlobalClassName(XSharpTargetDLL targetDLL)
139139
{
140140
string filename = PathUtilities.GetFileName(name);
141141
filename = PathUtilities.RemoveExtension(filename);
142-
filename = filename.Replace('.', '_');
142+
filename = filename.Replace('.', '_').Replace(' ', '_');
143143
if (_options.CommandLineArguments?.CompilationOptions.OutputKind.IsApplication() == true)
144144
name = filename + XSharpSpecialNames.VOExeFunctionsClass;
145145
else

0 commit comments

Comments
 (0)