Skip to content

Commit

Permalink
Merged with correction on InterpolatedText
Browse files Browse the repository at this point in the history
  • Loading branch information
fforay committed Apr 20, 2022
2 parents dfd2563 + dce9b05 commit f628660
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
16 changes: 12 additions & 4 deletions ILSpy.XSharpLanguage/XSharpHighlightingTokenWriter.prg
Original file line number Diff line number Diff line change
Expand Up @@ -568,16 +568,24 @@ BEGIN NAMESPACE ILSpy.XSharpLanguage
SELF:textOutput:BeginSpan(color)
ENDIF
// Indicate to XSharp to keep the String as it is
IF ( VALUE IS STRING )
SUPER:WriteInterpolatedText("e")
//SUPER:WritePrimitiveValue( "e", LiteralFormat.)
IF ( VALUE IS STRING VAR sValue)
IF StringNeedsEscape(sValue)
SUPER:WritePrimitiveValue( "e" )
ENDIF
ENDIF
SUPER:WritePrimitiveValue(VALUE )
IF (color != NULL)
//
SELF:textOutput:EndSpan()
ENDIF


PRIVATE METHOD StringNeedsEscape(sString AS STRING) AS LOGIC
FOREACH VAR c IN sString
IF c < 32 .OR. c > 127
RETURN TRUE
ENDIF
NEXT
RETURN FALSE

END CLASS
END NAMESPACE // ILSpy.XSharpLanguage
6 changes: 4 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ At that level, Create a ILSPY folder, and place there the ILSpy binaries.
After building, you will have a ILSpy.XSharpLanguage.Plugin.DLL in ILSpy.XSharpLanguage\bin\Debug or Release
Either run ILSpy in that folder, or copy/paste the file with the ILSpy binaries.

The first version was been built against V5.x
This version has been built against V6.x

This plugin is based on the source code found in ILSpy (https://github.com/icsharpcode/ILSpy) that provide CSharpLanguage.
It has been used as base, and some modifications haven been made to support some XSharp construction.
Expand All @@ -15,7 +15,9 @@ Lots of things are still to be done, but most is working.

### Features
- LOCAL variables are all defined on top of statement blocks.
- Option page : set casing for Keywords
- Option page :
- - set casing for Keywords
- - put parenthesis around IF condition

### Warnings
- Currently, Array access are all zero-based
Expand Down

0 comments on commit f628660

Please sign in to comment.