Skip to content

Commit f628660

Browse files
committed
Merged with correction on InterpolatedText
2 parents dfd2563 + dce9b05 commit f628660

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

ILSpy.XSharpLanguage/XSharpHighlightingTokenWriter.prg

+12-4
Original file line numberDiff line numberDiff line change
@@ -568,16 +568,24 @@ BEGIN NAMESPACE ILSpy.XSharpLanguage
568568
SELF:textOutput:BeginSpan(color)
569569
ENDIF
570570
// Indicate to XSharp to keep the String as it is
571-
IF ( VALUE IS STRING )
572-
SUPER:WriteInterpolatedText("e")
573-
//SUPER:WritePrimitiveValue( "e", LiteralFormat.)
571+
IF ( VALUE IS STRING VAR sValue)
572+
IF StringNeedsEscape(sValue)
573+
SUPER:WritePrimitiveValue( "e" )
574+
ENDIF
574575
ENDIF
575576
SUPER:WritePrimitiveValue(VALUE )
576577
IF (color != NULL)
577578
//
578579
SELF:textOutput:EndSpan()
579580
ENDIF
580-
581+
582+
PRIVATE METHOD StringNeedsEscape(sString AS STRING) AS LOGIC
583+
FOREACH VAR c IN sString
584+
IF c < 32 .OR. c > 127
585+
RETURN TRUE
586+
ENDIF
587+
NEXT
588+
RETURN FALSE
581589

582590
END CLASS
583591
END NAMESPACE // ILSpy.XSharpLanguage

Readme.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ At that level, Create a ILSPY folder, and place there the ILSpy binaries.
44
After building, you will have a ILSpy.XSharpLanguage.Plugin.DLL in ILSpy.XSharpLanguage\bin\Debug or Release
55
Either run ILSpy in that folder, or copy/paste the file with the ILSpy binaries.
66

7-
The first version was been built against V5.x
7+
This version has been built against V6.x
88

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

1616
### Features
1717
- LOCAL variables are all defined on top of statement blocks.
18-
- Option page : set casing for Keywords
18+
- Option page :
19+
- - set casing for Keywords
20+
- - put parenthesis around IF condition
1921

2022
### Warnings
2123
- Currently, Array access are all zero-based

0 commit comments

Comments
 (0)