This project is read-only.
1

Resolved

Bug: BasicCodeAnalysis.Syntax.SyntaxFacts.GetLiteralExpression

description

I found a bug in GetLiteralExpression
        Public Shared Function GetLiteralExpression(token As SyntaxKind) As SyntaxKind
            Select Case token

                Case SyntaxKind.IntegerLiteralToken, SyntaxKind.DecimalLiteralToken, SyntaxKind.FloatingLiteralToken
                    Return SyntaxKind.NumericLiteralExpression

                Case SyntaxKind.CharacterLiteralToken
                    Return SyntaxKind.CharacterLiteralExpression

                Case SyntaxKind.DateLiteralToken
                    Return SyntaxKind.DateLiteralExpression

                Case SyntaxKind.StringLiteralToken
                    Return SyntaxKind.StringLiteralExpression

                Case SyntaxKind.TrueKeyword
                    Return SyntaxKind.TrueLiteralExpression

                Case SyntaxKind.FalseKeyword
                    Return SyntaxKind.FalseLiteralExpression

                Case SyntaxKind.NothingKeyword
                    Return SyntaxKind.NothingLiteralExpression

                Case SyntaxKind.NothingKeyword  ' <--- Bug
                    Return SyntaxKind.XmlText

                Case Else
                    Return SyntaxKind.None
            End Select

            ' ??? XmlTextLiteralToken|XmlEntityLiteralToken

        End Function
the second Case SyntaxKind.NothingKeyword is redundant because of the previous case statement.

Suspect it should be something to do with XMLNodes but I don't what.

comments

angocke wrote May 8, 2014 at 11:12 PM

Fixed in changeset ed58958a6cd77cdec5febed47b0ecafbf3b7270d