IDE: Handle Caret (^) separately from symbols (CodeBeautifier): Issue #22514, patch from Anton.

git-svn-id: trunk@47037 -
This commit is contained in:
juha 2014-11-30 10:58:07 +00:00
parent 52e639a849
commit 3dd8de39eb
4 changed files with 8 additions and 3 deletions

View File

@ -78,7 +78,7 @@ type
TAtomType = (atNone, atKeyword, atIdentifier, atColon, atSemicolon, atComma,
atPoint, atAt, atNumber, atStringConstant, atNewLine,
atSpace, atCommentStart, atDirectiveStart, atCommentEnd,
atSymbol, atBracket);
atSymbol, atBracket, atCaret);
TAtomTypes = set of TAtomType;
TBeautifyCodeFlag = (
@ -312,7 +312,8 @@ const
'DirectiveStart',
'CommentEnd',
'Symbol',
'Bracket'
'Bracket',
'Caret'
);
WordPolicyNames: array[TWordPolicy] of shortstring = (
@ -1594,6 +1595,7 @@ begin
':': CurAtomType:=atColon;
';': CurAtomType:=atSemicolon;
'@': CurAtomType:=atAt;
'^': CurAtomType:=atCaret;
end;
end;
end;

View File

@ -272,6 +272,7 @@ begin
atSpace: Result:=lisCodeToolsOptsSpace;
atSymbol: Result:=lisCodeToolsOptsSymbol;
atBracket: Result:=lisCodeToolsOptsBracket;
atCaret: Result:=lisCodeToolsOptsCaret;
else
Result:='???';
end;

View File

@ -79,6 +79,7 @@ const
'const i=1+2+3;'#13 +
'begin'#13 +
' A:=@B.C;D:=3;E:=X[5];'#13 +
' PRec^.F:=PArr^[5];'#13 +
' {$I unit1.lrs}'#13 +
' {$R-}{$R+}'#13 +
' // ąčęęėįšųūž'#13+
@ -147,7 +148,7 @@ procedure TCodetoolsSpaceOptionsFrame.Setup(
const
DoInsertSpaceAtoms = [
atKeyword, atIdentifier, atColon, atSemicolon, atComma,
atPoint, atAt, atNumber, atStringConstant, atSymbol, atBracket];
atPoint, atAt, atNumber, atStringConstant, atSymbol, atBracket, atCaret];
begin
with DoInsertSpaceInFrontGroupBox do begin
Caption:=dlgInsSpaceFront;

View File

@ -3298,6 +3298,7 @@ resourcestring
lisCodeToolsOptsSpace = 'Space';
lisCodeToolsOptsSymbol = 'Symbol';
lisCodeToolsOptsBracket = 'Bracket';
lisCodeToolsOptsCaret = 'Caret (^)';
// codetools defines
lisCodeToolsDefsWriteError = 'Write error';