@@ -390,41 +390,41 @@ module QuickParse =
390390 EndColumn = index
391391 LastDotPos = lastDotPos
392392 }
393- else if IsWhitespace pos then
394- AtStartOfIdentifier( pos + 1 , current, throwAwayNext, lastDotPos)
395- else
396- let remainingLength = lineStr.Length - pos
393+ elif IsWhitespace pos then
394+ AtStartOfIdentifier( pos + 1 , current, throwAwayNext, lastDotPos)
395+ else
396+ let remainingLength = lineStr.Length - pos
397397
398- if IsTick pos && remainingLength > 1 && IsTick( pos + 1 ) then
399- InQuotedIdentifier( pos + 2 , pos + 2 , current, throwAwayNext, lastDotPos)
400- elif IsStartOfComment pos then
401- EatComment( 1 , pos + 1 , EatCommentCallContext.StartIdentifier( current, throwAwayNext), lastDotPos)
402- elif IsIdentifierStartCharacter pos then
403- InUnquotedIdentifier( pos, pos + 1 , current, throwAwayNext, lastDotPos)
404- elif // handles optional parameters
405- lineStr[ pos] = '?'
406- && ( pos + 1 < lineStr.Length)
407- && IsIdentifierPartCharacter( pos + 1 )
408- then
409- InUnquotedIdentifier( pos + 1 , pos + 2 , current, throwAwayNext, lastDotPos)
410- elif IsDot pos then
411- if pos = 0 then
412- // dot on first char of line, currently treat it like empty identifier to the left
413- AtStartOfIdentifier( pos + 1 , " " :: current, throwAwayNext, Some pos)
414- elif not ( pos > 0 && ( IsIdentifierPartCharacter( pos - 1 ) || IsWhitespace( pos - 1 ))) then
415- // it's not dots as part.of.a.long.ident, it's e.g. the range operator (..), or some other multi-char operator ending in dot
416- if lineStr[ pos - 1 ] = ')' then
417- // one very problematic case is someCall(args).Name
418- // without special logic, we will decide that ). is an operator and parse Name as the plid
419- // but in fact this is an expression tail, and we don't want a plid, rather we need to use expression typings at that location
420- // so be sure not to treat the name here as a plid
421- AtStartOfIdentifier( pos + 1 , [], true , None) // Throw away what we have, and the next apparent plid, and start over.
422- else
423- AtStartOfIdentifier( pos + 1 , [], false , None) // Throw away what we have and start over.
398+ if IsTick pos && remainingLength > 1 && IsTick( pos + 1 ) then
399+ InQuotedIdentifier( pos + 2 , pos + 2 , current, throwAwayNext, lastDotPos)
400+ elif IsStartOfComment pos then
401+ EatComment( 1 , pos + 1 , EatCommentCallContext.StartIdentifier( current, throwAwayNext), lastDotPos)
402+ elif IsIdentifierStartCharacter pos then
403+ InUnquotedIdentifier( pos, pos + 1 , current, throwAwayNext, lastDotPos)
404+ elif // handles optional parameters
405+ lineStr[ pos] = '?'
406+ && ( pos + 1 < lineStr.Length)
407+ && IsIdentifierPartCharacter( pos + 1 )
408+ then
409+ InUnquotedIdentifier( pos + 1 , pos + 2 , current, throwAwayNext, lastDotPos)
410+ elif IsDot pos then
411+ if pos = 0 then
412+ // dot on first char of line, currently treat it like empty identifier to the left
413+ AtStartOfIdentifier( pos + 1 , " " :: current, throwAwayNext, Some pos)
414+ elif not ( pos > 0 && ( IsIdentifierPartCharacter( pos - 1 ) || IsWhitespace( pos - 1 ))) then
415+ // it's not dots as part.of.a.long.ident, it's e.g. the range operator (..), or some other multi-char operator ending in dot
416+ if lineStr[ pos - 1 ] = ')' then
417+ // one very problematic case is someCall(args).Name
418+ // without special logic, we will decide that ). is an operator and parse Name as the plid
419+ // but in fact this is an expression tail, and we don't want a plid, rather we need to use expression typings at that location
420+ // so be sure not to treat the name here as a plid
421+ AtStartOfIdentifier( pos + 1 , [], true , None) // Throw away what we have, and the next apparent plid, and start over.
424422 else
425- AtStartOfIdentifier( pos + 1 , " " :: current , throwAwayNext , Some pos )
423+ AtStartOfIdentifier( pos + 1 , [], false , None ) // Throw away what we have and start over.
426424 else
427- AtStartOfIdentifier( pos + 1 , [], throwAwayNext, None)
425+ AtStartOfIdentifier( pos + 1 , " " :: current, throwAwayNext, Some pos)
426+ else
427+ AtStartOfIdentifier( pos + 1 , [], throwAwayNext, None)
428428
429429 let partialLongName = AtStartOfIdentifier( 0 , [], false , None)
430430
0 commit comments