Skip to content

Commit 7ea60d0

Browse files
committed
Correction on IMPLICIT and EXPLICIT operator syntax
1 parent a8242dd commit 7ea60d0

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

ILSpy.XSharpLanguage/XSharpOutputVisitor.prg

+12-16
Original file line numberDiff line numberDiff line change
@@ -1873,39 +1873,35 @@ BEGIN NAMESPACE ILSpy.XSharpLanguage
18731873
SELF:StartNode(operatorDeclaration)
18741874
SELF:WriteAttributes(operatorDeclaration:Attributes)
18751875
SELF:WriteModifiers(operatorDeclaration:ModifierTokens)
1876+
//
1877+
SELF:Space(TRUE)
1878+
SELF:WriteKeyword(OperatorDeclaration.OperatorKeywordRole)
1879+
SELF:Space(TRUE)
1880+
//
18761881
IF (operatorDeclaration:OperatorType == OperatorType.Explicit)
18771882
//
1878-
//SELF:WriteKeyword(OperatorDeclaration.ExplicitRole)
1883+
SELF:WriteKeyword(OperatorDeclaration.ExplicitRole)
18791884
ELSE
18801885
//
18811886
IF (operatorDeclaration:OperatorType == OperatorType.Implicit)
18821887
//
1883-
//SELF:WriteKeyword(OperatorDeclaration.ImplicitRole)
1888+
SELF:WriteKeyword(OperatorDeclaration.ImplicitRole)
18841889
ELSE
18851890
//
18861891
needReturnType := TRUE
1887-
18881892
ENDIF
18891893
ENDIF
1890-
SELF:Space(TRUE)
1891-
SELF:WriteKeyword(OperatorDeclaration.OperatorKeywordRole)
1892-
SELF:Space(TRUE)
1893-
IF ((operatorDeclaration:OperatorType == OperatorType.Explicit) .OR. (operatorDeclaration:OperatorType == OperatorType.Implicit))
1894-
//
1895-
operatorDeclaration:ReturnType:AcceptVisitor(SELF)
1896-
ELSE
1894+
IF needReturnType
18971895
//
18981896
SELF:WriteToken(OperatorDeclaration.GetToken(operatorDeclaration:OperatorType), OperatorDeclaration.GetRole(operatorDeclaration:OperatorType))
18991897
ENDIF
19001898
SELF:Space(SELF:policy:SpaceBeforeMethodDeclarationParentheses)
19011899
SELF:WriteCommaSeparatedListInParenthesis((System.Collections.Generic.IEnumerable<AstNode>)operatorDeclaration:Parameters , SELF:policy:SpaceWithinMethodDeclarationParentheses)
19021900
//
1903-
IF ( needReturnType )
1904-
SELF:Space(TRUE)
1905-
SELF:WriteKeyword( "AS" )
1906-
SELF:Space(TRUE)
1907-
operatorDeclaration:ReturnType:AcceptVisitor(SELF)
1908-
ENDIF
1901+
SELF:Space(TRUE)
1902+
SELF:WriteKeyword( "AS" )
1903+
SELF:Space(TRUE)
1904+
operatorDeclaration:ReturnType:AcceptVisitor(SELF)
19091905
//
19101906
SELF:WriteMethodBody(operatorDeclaration:Body, SELF:policy:MethodBraceStyle)
19111907
//

0 commit comments

Comments
 (0)