sdk/dotnet/src/Microsoft.Datasync.Client/Query/OData/ODataExpressionLexer.cs
/// <summary>
/// Given the start of a number, progress until the end of the number.
/// </summary>
/// <returns>The type of number literal found.</returns>
Given the start of a number, progress until the end of the number.
Given the start of a number progress until the end of the number .
private QueryTokenKind CompleteNumberLiteral()
        {
            QueryTokenKind tokenKind = QueryTokenKind.IntegerLiteral;
            SkipDigits();
            if (CurrentChar == '.')
            {
                tokenKind = QueryTokenKind.RealLiteral;
                NextChar();
                if (!char.IsDigit(CurrentChar))
                {
                    throw new ODataException("Failed to parse number in OData expression - digit expected.", Text, TextPosition);
                }
                SkipDigits();
            }
            if (CurrentChar == 'E' || CurrentChar == 'e')
            {
                tokenKind = QueryTokenKind.RealLiteral;
                NextChar();
                if (CurrentChar == '+' || CurrentChar == '-')
                {
                    NextChar();
                }
                if (!char.IsDigit(CurrentChar))
                {
                    throw new ODataException("Failed to parse number in OData expression - digit expected.", Text, TextPosition);
                }
                SkipDigits();
            }
            if (CurrentChar == 'F' || CurrentChar == 'f' || CurrentChar == 'M' || CurrentChar == 'm' || CurrentChar == 'D' || CurrentChar == 'd')
            {
                tokenKind = QueryTokenKind.RealLiteral;
                NextChar();
            }
            return tokenKind;
        }
private QueryTokenKind CompleteNumberLiteral ( ) { QueryTokenKind tokenKind = QueryTokenKind . IntegerLiteral ; SkipDigits ( ) ; if ( CurrentChar == ' ' ) { tokenKind = QueryTokenKind . RealLiteral ; NextChar ( ) ; if ( ! char . IsDigit ( CurrentChar ) ) { throw new ODataException ( " " , Text , TextPosition ) ; } SkipDigits ( ) ; } if ( CurrentChar == ' ' || CurrentChar == ' ' ) { tokenKind = QueryTokenKind . RealLiteral ; NextChar ( ) ; if ( CurrentChar == ' ' || CurrentChar == ' ' ) { NextChar ( ) ; } if ( ! char . IsDigit ( CurrentChar ) ) { throw new ODataException ( " " , Text , TextPosition ) ; } SkipDigits ( ) ; } if ( CurrentChar == ' ' || CurrentChar == ' ' || CurrentChar == ' ' || CurrentChar == ' ' || CurrentChar == ' ' || CurrentChar == ' ' ) { tokenKind = QueryTokenKind . RealLiteral ; NextChar ( ) ; } return tokenKind ; }
Given the start of a number, progress until the end of the number.
Given the start of a number progress until the end of the number .
// Look for the integer part. // Look for a decimal point. // Look for exponent. // Check for a number type specifier.
The type of number literal found.
The type of number literal found .