Show/Hide Toolbars

XSharp documentation

The VO & Vulcan dialect is now supported in combination with the Vulcan runtime.
We have successfully compiled both the Vulcan SDK and applications that depend on this SDK.
Click here for the complete (but short) list of known issues

Changes in 0.2.11

Compiler

All dialects

Improved some error messages, such as for unterminated strings

Added support for the /s (Syntax Check only) command line option

Added support for the /parseonly command line option which is used by the intellisense parser

Added some compiler errors and warnings for invalid code

The preprocessor did not properly handle 4 letter abbreviations for #command and #translate. This has been fixed

Fixed some problems found with the preprocessor

We switched to a new Antlr parser runtime. This should result in slightly better performance.

Changed the way literal characters and strings are defined:

oIn the Vulcan dialect a literal string that is  enclosed with single quotes is a char literal. Double quotes are string literals

oIn the Core and VO dialect a literal string that is enclosed with single quotes is a string literal. Double quotes are also string literals.
To specify a char literal in Core and VO you need to prefix the literal with a 'c':

 

     LOCAL cChar as CHAR
     cChar := c'A'        

Changed the way literal characters and strings are defined:

sizeof() and _sizeof() no longer generate a warning that they require 'unsafe' code, when compiling for x86 or x64. When compiling for AnyCpu the warning is still produced.

VO/Vulcan Compatibility

Added /vo16 compiler option to automatically generate constructors with Clipper calling convention for classes without constructor

 

Harbour Compatibilty

Started work on the Harbour dialect. This is identical with the VO/Vulcan dialect. The only difference so far is that the IIF() expressions are optional

 

Visual Studio

New features / changed behavior:

Added Brace Matching

Added Peek definition (Alt-F12)

All keywords are not automatically part of the Completionlist

Fixed a member lookup problem with Functions and Procedures inside a Namespace

Increased background parser speed for large projects

Fixed type lookup for fields and properties from parent classes

Fixed problem where CSharp projects could not find the output of a XSharp project reference

The Intellisense parser now properly used all current projects compiler options.

Prevent crashes when the X# language buffer is fed with "garbage" such as C# code

Changes in 0.2.10

This build focuses on the last remaining issues in the VO and Vulcan compatibility and adds a lot of new features to the Visual Studio integration.

Compiler

VO/Vulcan Compatibility

We have completed support for the DEFINE keyword. The type clause is now optional. The compiler will figure out the type of the define when no type is specified.
The DEFINEs will be compiled to a Constant field of the Functions class, or a Readonly Static field, when the expression cannot be determined at compile time (such as for Literal dates or symbols).

We have extended the preprocessor . It now has support for #command, #translate, #xcommand and #xtranslate. Also "Pseudo function" defines are supported, such as :
 
       #define MAX(x,y) IIF((x) > (y), (x), (y))
 
This works just like a #xtranslate, with the exception that the define is case sensitive (unless you have enabled the "VO compatible preprocessor" option (/vo8).
The only thing that is not working in the preprocessor is the repeated result marker.

In VO/Vulcan mode the compiler now accepts "garbage" between keywords such as ENDIF and NEXT and the end of the statement, just like the VO compiler.
So you no longer have to remove "comment" tokens after a NEXT or ENDIF. This will compile without changes in the VO and Vulcan dialect:
 
       IF X == Y
           DoSomething()
       ENDIF X == Y
or
       FOR I := 1 to 10
               DoSomething()
       NEXT I
 
We do not recommend this coding style, but this kind of code is very common...

Fixed an issue with recognition of single quoted strings. These were always recognized as CHAR_CONST when the length of the string was 1. Now they are treated as STRING_CONST and the compiler backend has been adjusted to convert the STRING literals to CHAR literals when needed.

In VO and Vulcan dialect when the compiler option /vo1 is used then RETURN statements without value or with a return value of SELF are allowed for the Init() and Axit() methods. Other return values will trigger a compiler warning and will be ignored.

New features / changed behavior:

The compiler now produces an error when a source file ends with an unterminated multi line comment

Added ASTYPE expression, similar to the AS construct in other languages. This will assign a value of the correct type or NULL when the expression is not of the correct type:
       

       VAR someVariable := <AnExpression> ASTYPE <SomeType>
 

The Chr() and _Chr() functions are now converted to a string or character literal when the parameter is a compile time constant

Compilation speed for assemblies with larger numbers of functions, procedures, defines, globals or _dll functions has been improved.

_DLL FUNCTIONS now automatically are marked with CharSet.Auto

Fixed some inconsistencies between Colon (:) and Point (.) interoperability and the super keyword

Fixed several compiler issues reported by FOX subscribers and other users.

 

Visual Studio

New features / changed behavior:

Tested and works with the release version of Visual Studio 2017

We have added support for regions inside the VS editor. At this moment most "entities" are collapsible as well as statement blocks, regions and lists of usings, #includes and comments.

We have added support for member and type drop downs in the VS Editor

We have added support for Code completion in the VS editor

We have added support for Goto definition in the VS Editor

Errors detected by the intellisense scanner are now also included in the VS error list.

We have added help links to the errors in the VS error list. The help links will bring you to the appropriate page on the X# website. Not all the help pages are complete yet, but at least the infrastructure is working.

We have added support for snippets and included several code snippets in the installer

We have made several changes to the project properties dialogs

oThe pre and post build events are now on a separate page for the Project Properties. These are now also not defined per configuration but are shared between the various configurations.
If you want to copy output results to different folders for  different configurations you should use the $(Configuration) and $(Platform) variables

oWe have  moved the Platform and Prefer32Bits properties to the Build page to make them configuration dependent

oFixed a problem with casing of the AnyCPU platform which would result in duplicate items in the VS Platform combobox

oAdded support for ARM and Itanium platform types

oSome properties were saved in project file groups without a platform identifier. This has been fixed

oWe have added a project property to control how Managed file resources are included: Use Vulcan Compatible Managed Resources
When 'True' then resources files are included in the assembly without namespace prefix. When 'False' then the resource files are prefixed with the namespace of the app, just like in other .Net languages, such as C#

We have fixed some code generation problems

The parser that is used in the Windows Forms editor now also properly handles background images. Both images in the resx for the form and also background images in the shared project resources

We have added Nuget support for our project system.

We have made several changes to fix problems in project files

oThe project system now silently fixes problems with duplicate items

oFixed a problem with dependencies between xaml files and their dependent designer.prg files and other dependent files

oFixed a problem with dependent items in sub folders or in a folder tree that includes a dot in a folder name.

oFixed a problem in the WPF template

Fixed a refresh problem when deleting a references node

Added implementation of the OAProject.Imports property, which is used by JetBrains

 

XPorter

Fixed a problem converting WPF style projects

Changes in 0.2.9

Compiler

With this build you can compile the Vulcan SDK without changes, except for some obvious errors in the Vulcan SDK that Vulcan did not find!
We consider the Vulcan Compatibility of the compiler finished with the current state of the compiler. All Vulcan code should compile without proble now.

VO/Vulcan Compatibility

New features / changed behavior:

All Init procedures are now properly called at startup. So not only the init procedures in the VOSDK libraries but also init procedures in other libraries and the main exe

Changed the method and type resolution code:

oA method with a single object parameter is now preferred over a method with an Object[] parameter

oWhen both a function (static method) exists and an instance method we will now call the static method in code inside methods that does not have a SELF: or SUPER: prefix.

oIn situations where the @ operator is used to pass variables by reference.

oTo make it more compatible with Vulcan for overloads with different numeric types.

oTo prefer a method with specific parameters over a method with usual parameters

oTo avoid problems with Types and Namespaces with the same name.

oTo prefer a method with an OBJECT parameter over the one with OBJECT[] parameters when only 1 argument is passed

oWhen 2 identical functions or types are detected in referenced assemblies we now choose the one in the first referenced assembly like Vulcan does, and generate warning 9043

The sizeof operator now returns a DWORD to be compatible with VO and Vulcan.

Added support for EXIT PROCEDURES (PROCEDURE MyProcedure EXIT). These procedures will automatically be called during program shutdown, just before all the global variables are cleared.
The compiler now generates an $Exit function for each assembly in which the exit procedures will be called and the reference globals in an assembly will be cleared. In the main app a $AppExit() function is created that will call the $Exit functions in all references X# assemblies. When a Vulcan compiled assembly is referenced, then all the public reference globals will be cleared from the $AppExit() function.

Added support for PCALL and PCALLNATIVE

Added support for several Vulcan compatible compiler options:

o/vo1 Allow Init() and Axit() for constructor and destruction

o/vo6 Allow (global) function pointers. DotNet does not "know" these. They are compiled to IntPtr. The function information is preserved so you can use these pointer in a PCALL()

o/ppo. Save the preprocessed compiler output to a file

o/Showdefs Show a list of the defines and their values on the console

o/showincludes Show a list of the included header files on the console

o/verbose Shows includes, source file names, defines and more. on the console

oDEFAULT TO command

oACCEPT command

oWAIT command

Several code generation changes:

oChanged the code generation for DIM elements inside VOStruct arrays because the Vulcan compiler depends on a specific naming scheme and did not recognize our names.

oImproved the code generation inside methods with CLIPPER calling convention.

 

Bug fixes

Implicit namespaces are now only used when the /ins compiler option is enabled. In Vulcan dialect the namespace Vulcan is always included.

Fixed several problems with the @ operator and VOSTRUCT types

Fixed a problem with DIM arrays of VOSTRUCT types

Fixed a problem with LOGIC values inside VOSTRUCT and UNION types

Fixed several problems with the VOStyle _CAST and Conversion operators.

Fixed several numeric conversion problems

Fixed several problems when mixing NULL, NULL_PTR and NULL_PSZ

Fixed several problems with the _CAST operator

Fixed several problems with PSZ Comparisons. X# now works just like Vulcan and VO and produces the same (sometimes useless) results

Fixed a problem with USUAL array indexes for multi dimensional XBase Arrays

Fixed codeblock problems for codeblocks where the last expression was VOID

Changed code generation for NULL_SYMBOL

Preprocessor #defines were sometimes conflicting with class or namespace names. For example when /vo8 was selected the method System.Diagnostics.Debug.WriteLine() could not be called because the DEBUG define was removing the  classname. We have changed the preprocessor so it will no longer replace words immediately before or after a DOT or COLON operator.

Fixed a compiler crash when calling static methods in the System.Object class when Late Binding was enabled

Fixed String2Psz() problem inside PROPERTY GET and PROPERTY SET

And many more changes.

 

All dialects

New features / changed behavior:

Several code generation changes:

oThe code generation for ACCESS and ASSIGN has changed. There are no longer separate methods in the class, but the content of these methods is now inlined in the generated Get and Set methods for the generated property.

oOptimized the code generation for IIF statements.

oThe debugger/step information has been improved. The debugger should now also stop on IF statements, FOR statements, CASE statements etc.

Indexed access to properties defined with the SELF keyword can now also use the "Index" property name

Functions and Procedures inside classes are not allowed (for now)

RETURN <LiteralValue> inside an ASSIGN method will no longer allocate a variable and produce an warning

Several keywords are now also allowed as Identifier (and will no longer have to be prefixed with @@ ):
Delegate, Enum, Event, Field, Func, Instance, Interface, Operator, Proc, Property, Structure, Union, VOStruct and many more
As a result the following is now valid code (but not recommended):
 
FUNCTION Start AS VOID

 LOCAL INTERFACE AS STRING

 LOCAL OPERATOR AS LONG

 ? INTERFACE, OPERATOR

 RETURN

You can see that the Visual Studio language support also recognizes that INTERFACE and OPERATOR are not used as keywords in this context

Bug fixes

Fixed a problem with the REPEAT UNTIL statement

Fixed a crash for code with a DO CASE without a matching END CASE

Fixed several issues for the code generation for _DLL FUNCTIONs and _DLL PROCEDUREs

Fixed a problem (in the Roslyn code) with embedding Native Resources in the Assembly.

Fixed a problem with the _OR() and _AND() operators with more than 2 arguments.

Added support for Pointer dereferencing using the VO/Vulcan Syntax : DWORD(p) => p[1]

Fixed several problems with the @ operator

When two partial classes had the same name and a different casing the compiler would not properly merge the class definitions.

Fixed a crash when a #define in code was the same as a define passed on the commandline

Indexed pointer access was not respecting the /AZ compiler option (and always assumed 0 based arrays). This has been fixed

Fixed a problem with the caching of preprocessed files, especially files that contain #ifdef constructs.

Fixed a problem which could occur when 2 partial classes had the same name but a different case

Fixed a compiler crash when a referenced assembly had duplicate namespaces that were only different in Case

Fixed problems with Functions that have a [DllImport] attribute.

Error messages for ACCESS/ASSIGN methods would sometimes point to a strange location in the source file. This has been fixed.

Fixed a problem with Init Procedures that had a STATIC modifier

Fixed a problem in the preprocessor when detecting the codepage for a header file. This could cause problems reading header files with special characters (such as the copyright sign ©)

And many more changes.

 

Visual Studio Integration

Added support for all compiler options in the UI and the build system

Fixed problems with dependent file items in subfolders

The Optimize compiler option was not working

The 'Clean' build option now also cleans the error list

Under certain conditions the error list would remain empty even though there were messages in the output pane. This has been fixed.

The <Documentationfile> property inside the xsproj file would cause a rebuild from the project even when the source was not changed

Earlier versions of XPorter could create xsproj files that would not build properly. The project system now fixes this automatically

Fixed a problem with the build system and certain kind of embedded managed resources

 

Documentation

We have added many descriptions to the commandline options

We have added a list of the most common compiler errors and warnings.

Changes in 0.2.8

Compiler

VO/Vulcan Compatibility

Default Parameters are now handled like VO and Vulcan do. This means that you can also have date constants, symbolic constants etc as default parameter

String Single Equals rules are now 100% identical with Visual Objects. We found one case where Vulcan does not return the same result as Visual Objects. We have chosen to be compatible with VO.

When compiling in VO/Vulcan mode then the init procedures in the VO SDK libraries are automatically called. You do not have to call these in your code anymore
Also Init procedures in the main assembly are called at startup.

The /vo7 compiler option (Implicit casts and conversions) has been implemented. This also includes support to use the @ sign for REF parameters

You can now use the DOT operator to access members in VOSTRUCT variables

We have fixed several USUAL - Other type conversion problems that required casts in previous builds

The compiler now correctly parses VO code that contains DECLARE METHOD, DECLARE ACCESS and DECLARE ASSIGN statements and ignores these

The compiler now parses "VO Style" compiler pragma's (~"keyword" as white-space and ignores these.

Fixed a problem where arrays declared with the "LOCAL aSomething[10] AS ARRAY" syntax would not be initialized with the proper number of elements

Fixed a problem when calling Clipper Calling Convention constructors with a single USUAL parameter

Attributes on _DLL entities would not be properly compiled. These are recognized for now but ignored.

Fixed several numeric conversion problems

New features

We have added support for Collection Initializers and Object Initializers

Anonymous type members no longer have to be named. If you select a property as an anonymous type member then the same property name will be used for the anonymous type as well.

Missing closing keywords (such as NEXT, ENDIF, ENDCASE and ENDDO) now produce better error messages

IIF() Expressions are now also allowed as Expression statement. The generated code will be the same as if an IF statement was used

 FUNCTION IsEven(nValue as LONG) AS LOGIC

 LOCAL lEven as LOGIC

 IIF( nValue %2 == 0, lEven := TRUE, lEven := FALSE)

 RETURN lEven

We really do not encourage to hide assignments like this, but in case you have used this coding style,it works now <g>.

AS VOID is now allowed as (the only) type specification for PROCEDUREs

We have added a .config file to the exe for the shared compiler that should make it faster

The XSharpStdDefs.xh file in the XSharp is now automatically included when compiling. This file declares the CRLF constant for now.

Include files are now cached by the compiler. This should increase the compilation speed for projects that depend on large included files, such as the Win32APILibrary header file from Vulcan

When a function is found in an external assembly and a function with the same name and arguments is found in the current assembly, then the function in the current assembly is used by the compiler

Compiler error messages for missing closing symbols should have been improved

Compiler error messages for unexpected tokens have been improved

Bug fixes

Several command-line options with a minus sign were not properly handled by the compiler

Fixed several crashes related to assigning NULL_OBJECT or NULL to late bound properties have been fixed

Partial class no longer are required to specify the parent type on every source code location. When specified, the parent type must be the same of course. Parent interfaces implemented by a class can also be spread over multiple locations

We have fixed a crash that could happen with errors/warnings in large include files

Abstract methods no longer get a Virtual Modifier with /vo3

Fixed a problem with virtual methods in child classes that would hide parent class methods

Automatic return value generation was also generating return values for ASSIGN methods. This has been fixed.

We fixed a problem with the Join Clauses for LINQ Expressions that would cause a compiler exception

The /vo10 (compatible iif) compiler option no longer adds casts in the Core dialect. It only does that for the VO/Vulcan dialect

Visual Studio Integration

We have changed the way the error list and output window are updated. In previous version some lines could be missing on the output window, and the error code column was empty. This should work as expected now.

We have merged some code from some other MPF based project systems, such as WIX (called Votive), NodeJS and Python (PTVS) to help extend our project system. As a result:

oOur project system now has support for Linked files

oOur project system now has support for 'Show All Files' and you can now Include and Exclude files. This setting is persisted in a .user file, so you can exclude this from SCC if you want.

oWe have made some changes to support better 'Drag and Drop'

We have fixed several issues with regard to dependent items

When you include a file that contains a form or user control, this is now recognized and the appropriate subtype is set in the project file, so you can open the windows forms editor

We are now supporting source code generation for code behind files for .Settings and .Resx files

The combobox in the Managed Resource editor and Managed Settings tool to choose between internal code and public code is now enabled. Selecting a different value in the combobox will change the tool in the files properties.

The last response file for the compiler and native resource compiler are now saved in the users Temp folder to aid in debugging problems.

The response file now has each compiler option to a new line to make it easier to read and debug when this is necessary.

The code generation now preserves comments between entities (methods)

We fixed several minor issues in the templates

When the # of errors and warnings is larger than the built-in limit of 500, then a message will be shown that the error list was truncated

At the end of the build process a line will be written to the output window with the total # of warnings and errors found

The colors in the Source Code Editor are now shared with the source code editors for standard languages such as C# and VB

When you have an inactive code section in your source code, embedded in an #ifdef that evaluates to FALSE then that section will be visibly colored gray and there will be no keyword highlighting. The source code parser for the editor picks up the include files and respects the path settings. Defines in the application properties dialog and the active configuration are not respected yet. That will follow in the next build.

 

Changes in 0.2.7.1

Compiler

The compiler was not accepting wildcard strings for the AssemblyFileVersion Attribute and the AssemblyInformationVersion attribute. This has been fixed

The #Pragma commands #Pragma Warnings(Push) and #Pragma Warnings(Pop) were not recognized. This has been fixed.

The compiler was not recognizing expressions like global::System.String.Compare(..). This has been fixed

Visual Studio Integration

Dependent items in subfolders of a project were not recognized properly and could produce an error when opening a project

Fixed a problem in the VulcanApp Template

The Windows Forms Editor would not open forms in a file without begin namespace .. end namespace. This has been fixed

Source code comments between 'entities' in a source file is now properly saved and restored when the source is regenerated by the form editor

Unnecessary blank lines in the generate source code are being suppressed

The XPorter tool is now part of the Installation

Comments after a line continuation character were not properly colored

Changed the XSharp VS Editor Color scheme to make certain items easier to read

New managed resource files would not be marked with the proper item type. As a result the resources would not be available at runtime. This has been fixed.

Added 'Copy to Output Directory' property to the properties window

Setup

The installer, exe files and documentation are now signed with a certificate

Changes in 0.2.7

Compiler

New features:

Added support for the VOSTRUCT and UNION types

Added support for Types as Numeric values, such as in the construct
       IF UsualType(uValue) == LONG

Added a FIXED statement and FIXED modifier for variables

Added support for Interpolated Strings

Empty switch labels inside SWITCH statements are now allowed. They can share the implementation with the next label.
Error 9024 (EXIT inside SWITCH statement not allowed) has been added and will be thrown if you try to exit out of a loop around the switch statement.
This is not allowed.

Added support for several /vo compiler options:
- vo8 (Compatible preprocessor behavior). This makes the preprocessor defines case insensitive. Also a define with the value FALSE or 0 is seen as 'undefined'
- vo9 (Allow missing return statements) compiler option. Missing return values are also allowed when /vo9 is used.
Warnings 9025 (Missing RETURN statement) and 9026 (Missing RETURN value) have been added.
- vo12 (Clipper Integer divisions)

The preprocessor now automatically defines the macros __VO1__ until __VO15__ with a value of TRUE or FALSE depending on the setting of the compiler option

The FOX version of the compiler is now distributed in Release mode and much faster. A debug version of the compiler is also installed in case it is needed to aid in finding compiler problems.

Changed behavior

The compiler generated Globals class for the Core dialect is now called Functions and no longer Xs$Globals.

Overriding functions in VulcanRTFuncs can now be done without specifying the namespace:
When the compiler finds two candidate functions and one of them is inside VulcanRTFuncs then the function that is not in VulcanRTFuncs is chosen.

Warning 9001 (unsafe modifier implied) is now suppressed for the VO/Vulcan dialect. You MUST pass the /unsafe compiler option if you are compiling unsafe code though!

Improved the error messages for the Release mode of the compiler

Bug fixes

RETURN and THROW statements inside a Switch statement would generate an 'unreachable code' warning. This has been fixed

Fixed several problems with mixing signed and unsigned Array Indexes

Fixed several problems with the FOR .. NEXT statement. The "To" expression will now be evaluated for every iteration of the loop, just like in VO and Vulcan.

Fixed several compiler crashes

Fixed a problem with implicit code generation for constructors

Fixed a visibility problem with static variables inside static functions

 

Visual Studio Integration

Fixed a problem that the wrong Language Service was selected when XSharp and Vulcan.NET were used in the same Visual Studio and when files were opened from the output window or the Find Results window

Fixed some problems with 'abnormal' line endings in generated code

Fixed a problem in the Class Library template

Fixed a problem with non standard command lines to Start the debugger

 

Changes in 0.2.6

Compiler

Added alternative syntax for event definition. See EVENT keyword in the documentation

Added Code Block Support

Implemented /vo13 (VO compatible string comparisons)

Added support for /vo4 (VO compatible implicit numeric conversions)

Aliased expressions are now fully supported

Fixed a problem with the &= operator

Fixed several crashes for incorrect source code.

Fixed several problems related to implicit conversions from/to usual, float and date

Indexed properties (such as String:Chars) can now be used by name

Indexed properties can now have overloads with different parameter types

Added support for indexed ACCESS and ASSIGN

Fixed a problem when calling Clipper Calling Convention functions and/or methods with a single parameter

Fixed a crash with defines in the preprocessor

_CODEBLOCK is now an alias for the CODEBLOCK type

Fixed a crash for properties defined with parentheses or square brackets, but without actual parameters

 

Visual Studio Integration

Completed support for .designer.prg for Windows.Forms

Fixed an issue in the CodeDom generator for generating wrappers for Services

The XSharp Language service will no longer be used for Vulcan PRG files in a Side by Side installation

Editor performance for large source files has been improved.

All generated files are now stored in UTF, to make sure that special characters are stored correctly. If you are seeing warnings about code page conversions when generating code, then save files as UTF by choosing "File - Advanced Save Options", and select a Unicode file format, from the Visual Studio Menu.

 

Changes in 0.2.51

Visual Studio Integration & Build System

The Native Resource compiler now "finds" header files, such as "VOWin32APILibrary.vh" in the Vulcan.NET include folder. Also the output of the resource compiler is now less verbose when running in "normal" message mode. When running in "detailed" or "diagnostics" mode the output now also includes the verbose output of the resource compiler.

Compiler

Fixed a problem that would make PDB files unusable

The error "Duplicate define with different value" (9012)  has been changed to warning, because our preprocessor does a textual comparison and does not "see" that "10" and "(10)" are equal as well as "0xA" and "0xa". It is your responsibility of course to make sure that the values are indeed the same.

Exponential REAL constants were only working with a lower case 'e'. This is now case insensitive

Made several changes to the _DLL FUNCTION and _DLL PROCEDURE rules for the parser. Now we correctly recognize the "DLL Hints " (#123) and also allow extensions in these definitions. Ordinals are parsed correctly as well, but produce an error (9018) because the .Net runtime does not support these anymore. Also the Calling convention is now mandatory and the generated IL code includes SetLastError = true and ExactSpelling = true.

Fixed a problem with the ~ operator. VO and Vulcan (and therefore X#) use this operator as unary operator and as binary operator.
The unary operator does a bitwise negation (Ones complement), and the binary operator does an XOR.
This is different than C# where the ~ operator is Bitwise Negation and the ^ operator is an XOR (and our Roslyn backend uses the C# syntax of course).

Changes in 0.2.5

Visual Studio Integration

Fixed a problem where the output file name would contain a pipe symbol when building for WPF

Fixed a problem with the Item type for WPF forms, pages and user controls

The installer now has an option to not take away the association for PRG, VH and PPO items from an installed Vulcan project system.

Added support for several new item types in the projects

Added support for nested items

Added several item templates for WPF, RC, ResX, Settings, Bitmap, Cursor etc.

Build System

Added support for the new /vo15 command line switch.

Added support for compiling native resources.

Compiler

A reference to VulcanRT and VulcanRTFuncs is now mandatory when compiling in VO/Vulcan dialect

Added support for indexed access for VO/Vulcan Arrays

Added support for VO/Vulcan style Constructor chaining (where SUPER() or SELF() call is not the first call inside the constructor body)

Added support for the &() macro operator in the VO/Vulcan dialect

Added support for the FIELD statement in the VO/Vulcan dialect

oThe statement is recognized by the compiler

oFields listed in the FIELD statement now take precedence over local variables or instance variables with the same name

Added support for the ALIAS operator (->) in the VO/Vulcan dialect, with the exception of the aliased expressions (AREA->(<Expression>))

Added support for Late bound code (in the VO/Vulcan dialect)

oLate bound method calls

oLate bound property get

oLate bound property set

oLate bound delegate invocation

Added a new /vo15 command line option (Allow untyped Locals and return types):
By default in the VO/Vulcan dialect missing types are allowed and replaced with the USUAL type.
When you specify /vo15- then untyped locals and return types are not allowed and you must specify them.
Of course you can also specify them as USUAL

The ? and ?? statement are now directly mapped to the appropriate VO/Vulcan runtime function when compiling for the VO/Vulcan dialect

We now also support the VulcanClassLibrary attribute and VulcanCompilerVersion attribute for the VO & Vulcan dialect.
With this support the Vulcan macro compiler and Vulcan Runtime should be able to find our functions and classes

The generated static class name is now more in par with the class name that Vulcan generates in the VO & Vulcan dialect.

Added several implicit conversion operations for the USUAL type.

When accessing certain features in the VO & Vulcan dialect (such as the USUAL type) the compiler now checks to see if VulcanRTFuncs.DLL and/or VulcanRT.DLL are included.
When not then a meaningful error message is shown.

Added support for the intrinsic function _GetInst()

Fixed a problem with case sensitive namespace comparisons

Fixed a problem with operator methods

Added preprocessor macros __DIALECT__, __DIALECT_CORE__, __DIALECT_VO__ and __DIALECT_VULCAN__

The _Chr() pseudo function will now be mapped to the Chr() function

Added support for missing arguments in arguments lists (VO & Vulcan dialect only)

Fixed a crash when calculating the position of tokens in header files

The installer now offers to copy the Vulcan Header files to the XSharp Include folder

Added support for skipping arguments in (VO) literal array constructors

Documentation

Added the XSharp documentation to the Visual Studio Help collection

Added reference documentation for the Vulcan Runtime

Changes in 0.2.4

Visual Studio Integration

Double clicking errors in the error browser now correctly opens the source file and positions the cursor

Fixed several problems in the project and item templates

The installer now also detects Visual Studio 15 Preview and installs our project system in this environment.

Build System

Fixed a problem with the /unsafe compiler option

Fixed a problem with the /doc compiler option

Treat warnings as error was always enabled. This has been fixed.

Compiler

Added support for Lambda expressions with an expression list

LOCAL dfunc AS System.Func<Double,Double>

dfunc := {|x| x := x + 10, x^2}

? dfunc(2)

Added support for Lambda expressions with a statement list

 LOCAL dfunc AS System.Func<Double,Double>

 dfunc :=        {|x|

                         ? 'square of', x

                         RETURN x^2

                 }

Added support for the NAMEOF intrinsic function

FUNCTION Test(cFirstName AS STRING) AS VOID

 FUNCTION Test(cFirstName AS STRINGAS VOID

 IF String.IsNullOrEmpty(cFirstName)

         THROW ArgumentException{"Empty argument", nameof(cFirstName)}

 ENDIF

Added support for creating methods and functions with Clipper calling convention (VO and Vulcan dialect only)

Using Statement now can contain a Variable declaration:

Instead of:

    VAR ms := System.IO.MemoryStream{}

    BEGIN USING ms

         // do the work

 

END USING

You can now write

 BEGIN USING VAR ms := System.IO.MemoryStream{}

         // do the work

END USING

Added support for /vo10 (Compatible IIF behavior). In the VO and Vulcan dialect the expressions are cast to USUAL. In the core dialect the expressions are cast to OBJECT.

New language features for the VO and Vulcan dialect

Calling the SELF() or SUPER() constructor is now allowed anywhere inside a constructor (VO and Vulcan dialect only). The Core dialect still requires constructor chaining as the first expression inside the constructor body

Added support for the PCOUNT, _GETFPARAM and _GETMPARAM intrinsic functions

Added support for String2Psz() and Cast2Psz()

Added support for BEGIN SEQUENCE … END

Added support for BREAK

Fixed several problems:

Nested array initializers

Crash for BREAK statements

Assertion error for generic arguments

Assertion on const implicit reference

Allow ClipperCallingConvention Attribute on Constructors, even when it is marked as ‘for methods only’

Fixed a problem with Global Const declarations

__ENTITY__ preprocessor macro inside indexed properties

 

Changes in 0.2.3

Visual Studio Integration

We have changed to use the MPF style of Visual Studio Integration.

We have added support for the Windows Forms Editor

We have added support for the WPF Editor

We have added support for the Codedom Provider, which means a parser and code generator that are used by the two editors above

The project property pages have been elaborated. Many more features are available now.

We have added several templates

Build System

Added support for several new commandline options, such as /dialect

The commandline options were not reset properly when running the shared compiler. This has been fixed.

The build system will limit the # of errors passed to Visual Studio to max. 500 per project. The commandline compiler will still show all errors.

Compiler

We have started work on the Bring Your Own Runtime support for Vulcan. See separate heading below.

The __SIG__ and __ENTITY__ macros are now also supported, as well as the __WINDIR__, __SYSDIR__ and __WINDRIVE__ macros

The debugger instructions have been improved. You should have a much better debugging experience with this build

Several errors that indicated that there are visibility differences between types and method arguments, return types or property types have been changed into warnings. Of course you should consider to fix these problems in your code.

The #Error and #warning preprocessor command no longer require the argument to be a string

The SLen() function call is now inlined by the compiler (just like in Vulcan)

The AltD() function will insert a call to "System.Diagnostics.Debugger.Break" within a IF System.Diagnostics.Debugger.IsAttached check

Several compiler crashes have been fixed

Added support for the PARAMS keyword for method and function parameters.

Fixed a problem for the DYNAMIC type.

BYOR

XBase type names are resolved properly (ARRAY, DATE, SYMBOL, USUAL etc)

Literal values are now resolved properly (ARRAY, DATE, SYMBOL)

NULL_ literals are resolved properly (NULL_STRING follows the /vo2 compiler option, NULL_DATE, NULL_SYMBOL)

The /vo14 compiler option (Float literals) has been implemented

The compiler automatically inserts a "Using Vulcan" and "using static VulcanRtFuncs.Functions" in each program

You MUST add a reference to the VulcanRTFuncs and VulcanRT assembly to your project. This may be a Vulcan 3 and also a Vulcan 4 version of the Runtime. Maybe Vulcan 2 works as well, we have not tested it.

Calling methods with Clipper calling convention works as expected.

Methods/Functions without return type are seen as methods that return a USUAL

If a method/function contains typed and typed parameters then the untyped parameters are seen as USUAL parameters

Methods with only untyped parameters (Clipper calling convention) are not supported yet

The ? command will call AsString() on the arguments

Changes in 0.2.2

Visual Studio Integration

Added more project properties. One new property is the "Use Shared Compiler" option. This will  improve compilation speed, but may have a side effect that some compiler (parser) errors are not shown in details.
If you experience this, then please disable this option.

Added more properties to the Build System. All C# properties should now also be supported for X#, even though some of them are not visible in the property dialogs inside VS.

Added a CreateManifest task to the Build System so you will not get an error anymore for projects that contain managed resources

The performance of the editor should be better with this release.

Marking and unmarking text blocks as comment would not always be reflected in the editor colors. This has been fixed.

 

Compiler

We have added a first version of the preprocessor. This preprocessor supports the #define command, #ifdef, #ifndef, #else, #endif, #include, #error and #warning. #command and #translate (to add user defined commands) are not supported yet.

Missing types (in parameter lists, field definitions etc) were sometimes producing unclear error messages. We have changed the compiler to produce a "Missing Type" error message.

We rolled the underlying Roslyn code forward to VS 2015 Update 1. Not that you see much of this from the outside <g>, but several fixes and enhancements have made their way into the compiler.

Added a YIELD EXIT statement (You can also use YIELD BREAK).

Added an (optional) OVERRIDE keyword which can be used as modifier on virtual methods which are overridden in a subclass.

Added a NOP keyword which you can use in code which is intentionally empty (for example the otherwise branch of a case statement. The compiler will no longer warn about an empty block when you insert a NOP keyword there.

The On and Off keywords could cause problems, because they were not positional (these are part of the pragma statement). This has been fixed.

_AND() and _OR() expressions with one argument now throw a compiler error.

The compiler now recognizes the /VO14 (store literals as float) compiler switch (it has not been implemented yet).

Added a ** operator as alias for the ^ (Exponent) operator.

Added an "unsupported" error when using the Minus operator on strings.

Fixed a "Stack overflow" error in the compiler that could occur for very long expressions.

The right shift operator no longer conflicts with two Greater Than operators, which allows you to declare or create generics without having to put a space between them.
(var x := List<Tuple<int,int>>{}

 

Changes in 0.2.1

Visual Studio Integration

Added and improved several project properties

Fix a problem with the "Additional Compiler Options"

Improved coloring in the editor for Keywords, Comments etc. You can set the colors from the Tools/Options dialog under General/Fonts & Colors. Look for the entries with the name "XSharp Keyword" etc.

Added Windows Forms Template

Compiler

Several errors have been demoted to warnings to be more compatible with VO/Vulcan

Added support for Comment lines that start with an asterisk

Added support for the DEFINE statement. For now the DEFINE statement MUST have a type
DEFINE WM_USER := 0x0400 AS DWORD

Fixed problem with Single Line Properties with GET and SET reversed

Several fixes for Virtual and Non virtual methods in combination with the /VO3 compatibility option

Changes in 0.1.7

The "ns" (add default namespace to classes without namespace) has been implemented

The "vo3" compiler option (to make all methods virtual ) has been implemented

Fixed an issue where the send operator on an expression between parentheses was not compiling properly

Relational operators for strings (>, >=, <, <=) are now supported. They are implemented using the String.Compare() method.

Fixed a problem with local variables declared on the start line from FOR .. NEXT statements

Added first version of the documentation in CHM & PDF format

Added several properties to the Visual Studio Project properties dialog to allow setting the new compiler options

Fixed a problem in the Targets files used by MsBuild because some standard macros such as $(TargetPath) were not working properly

XIDE 0.1.7 is included. This version of XIDE is completely compiled with XSharp !

The name of some of the MsBuild support files have changed. This may lead to problems loading a VS project if you have used the VS support from the previous build. If that is the case then please edit the xsproj file inside Visual Studio and replace all references of "XSharpProject" with "XSharp" . Then safe the xsproj file and try to reload the project again

The WHILE.. ENDDO (a DO WHILE without the leading DO) is now recognized properly

Changes in 0.1.6

This version now comes with an installer

This version includes a first version of the Visual Studio Integration. You can edit, build, run and debug inside Visual Studio. There is no "intellisense" available.

The compiler now uses 1-based arrays and the “az” compiler option has been implemented to switch the compiler to use 0-based arrays.

The "vo2" compiler option (to initialize string variables with String.Empty) has been implemented

Please note that there is no option in the VS project properties dialog yet for the az and vo2 compiler options.  You can use the "additional compiler options" option to specify these compiler options.

The text "this" and "base" in error messages has been changed to "SELF" and "SUPER"

Error of type “visibility” (for example public properties that expose private or internal types) have been changed to warnings

Fixed a problem with TRY … ENDTRY statements without CATCH clause

The compiler now has a better resolution for functions that reside in other (X#) assemblies

Fixed a problem which could lead to an "ambiguous operator" message when mixing different numeric types.

Changes in 0.1.5

When an error occurs in the parsing stage, X# no longer enters the following stages of the compiler to prevent crashes. In addition to the errors from the parser also an error 9002 is displayed.

Parser errors now also include the source file name in the error message and have the same format as other error messages. Please note that we are not finished yet with handling these error messages. There will be improvements in the format of these error messages in the upcoming builds.

The compiler will display a “feature not available” (8022) error when a program uses one of the Xbase types (ARRAY, DATE, FLOAT, PSZ, SYMBOL, USUAL).

Fixed an error with VOSTRUCT and UNION types

Fixed a problem with the exclamation mark (!) NOT operator

Changes in 0.1.4

Several changes to allow calculations with integers and enums

Several changes to allow VO compatible _OR, _AND, _NOT an _XOR operations

Fix interface/abstract VO properties

Insert an implicit “USING System” only if not explicitly declared

Error 542 turned to warning (members cannot have the same name as their enclosing type)

Changes in the .XOR. expression definition

Fix double quote in CHAR_CONST lexer rule

Allow namespace declaration in class/struct/etc. name (CLASS Foo.Bar)

Fix access/assign crash where identifier name was a (positional) keword: ACCESS Value

Preprocessor keywords were not recognized after spaces, but only at the start of the line. This has been fixed.

Prevent property GET SET from being parsed as expression body

Fix default visibility for interface event

Unsafe errors become warnings with /unsafe option, PTR is void*

Fix dim array field declaration

Initial support of VO cast and VO Conversion rules (TYPE(_CAST, Expression) and TYPE(Expression)).  _CAST is always unchecked (LONG(_CAST, dwValue)) and convert follows the checked/unchecked rules (LONG(dwValue))

Fixed problem with codeblock with empty parameter list

Fixed problems with GlobalAttributes.

An AUTO property without GET SET now automatically adds a GET and SET block

Allow implicit constant double-to-single conversion

Changes in 0.1.3

Change inconsistent field accessibility error to warning and other similar errors

Added commandline support for Vulcan arguments. These arguments no longer result in an error message, but are not really implemented, unless an equivalent argument exists for the Roslyn (C#) compiler. For example: /ovf and /fovf are both mapped to /checked, /wx is mapped to /warnaserror. /w should not be used because that has a different meaning /warning level). /nowarn:nnnn should be used in stead

Fixed problem where the PUBLIC modifier was assigned to Interface Members or Destructors

Prevent expression statements from starting with CONSTRUCTOR() or DESTRUCTOR()

Added support for ? statement without parameters

The default return type for assigns is now VOID when not specified

Added support for “old Style” delegate instantiation

Added support for Enum addition

Added an implicit empty catch block for TRY .. END TRY without catch and finally

Added support for the DESCENDING keyword in LINQ statements

Added support for VIRTUAL and OVERRIDE for Properties and Events

Prevent implied override insertion for abstract interface members

Fixed a problem where System.Void could not be resolved

Fixed problem with Property Generation for ACCESS/ASSIGN

Fixed problem with Abstract method handling

Changes in 0.1.2.1

Added default expression

Fixed problem with events

Fixed some small lexer problems

Fixed problem with _DLL FUNCTION and _DLL PROCEDURE

Changes in 0.1.2

Fixed problem with handling escape sequences in extended strings

Fixed issue in FOR.. NEXT statements

Fixed a problem with SWITCH statements

Fixed a problem with the sizeof() operator

Fixed a problem in the REPEAT .. UNTIL statement

Fixed a problem in TRY .. CATCH .. FINALLY .. END TRY statements.

Fixed issue in Conditional Access Expression ( Expr  ? Expr)

Allow bound member access of name with type args

Fixed problem in LOCAL statement with multiple locals

Fixed a problem when compiling with debug info for methods without a body

Optimized the Lexer. This should increase the compile speed a lot

Fixed a problem in the code that reports that a feature is not supported yet

Fixed a problem when defining Generic types with a STRUCTURE constraint

Compilere macros (__ENTITY__, __LINE__ etc) were causing a crash. For now the compiler inserts a literal string with the name of the macro.

Build 0.1.1 did not contain XSC.RSP

Fixed a problem where identifiers were not recognized when they were matching a (new) keyword