codetools: identifier completion: no semicolon outside of statements

git-svn-id: trunk@16669 -
This commit is contained in:
mattias 2008-09-22 09:37:45 +00:00
parent a58a097488
commit d7a960e8ba

View File

@ -1537,26 +1537,28 @@ begin
MoveCursorToCleanPos(IdentEndPos);
ReadNextAtom;
CurrentIdentifierList.StartAtomBehind:=CurPos;
// check if a semicolon is needed at the end
if (CurrentIdentifierList.StartBracketLvl>0)
or (CurPos.Flag in [cafSemicolon, cafEqual, cafColon, cafComma,
cafPoint, cafRoundBracketOpen, cafRoundBracketClose,
cafEdgedBracketOpen, cafEdgedBracketClose])
or ((CurPos.Flag=cafWord)
and (UpAtomIs('ELSE')
or UpAtomIs('THEN')
or UpAtomIs('DO')
or UpAtomIs('TO')
or UpAtomIs('OF')))
then begin
// do not add semicolon
CurrentIdentifierList.ContextFlags:=
CurrentIdentifierList.ContextFlags+[ilcfNoEndSemicolon];
end;
// check if in statement
if (ilcfStartInStatement in CurrentIdentifierList.ContextFlags) then
begin
// check if a semicolon is needed at the end
if (CurrentIdentifierList.StartBracketLvl>0)
or (CurPos.Flag in [cafSemicolon, cafEqual, cafColon, cafComma,
cafPoint, cafRoundBracketOpen, cafRoundBracketClose,
cafEdgedBracketOpen, cafEdgedBracketClose])
or ((CurPos.Flag=cafWord)
and (UpAtomIs('ELSE')
or UpAtomIs('THEN')
or UpAtomIs('DO')
or UpAtomIs('TO')
or UpAtomIs('OF')))
then begin
// do not add semicolon
CurrentIdentifierList.ContextFlags:=
CurrentIdentifierList.ContextFlags+[ilcfNoEndSemicolon];
end
else if (not (ilcfStartIsLValue in CurrentIdentifierList.ContextFlags))
if (not (ilcfNoEndSemicolon in CurrentIdentifierList.ContextFlags))
and (not (ilcfStartIsLValue in CurrentIdentifierList.ContextFlags))
then begin
// check if a semicolon is needed at the end
if (CurPos.Flag in [cafEnd,cafBegin])