コンパイルSynEditソースの変更
4132 ワード
UTF 8符号化の問題でSynEditソースコードが文字化けして表示されてコンパイルできないため、以下のコードで修正してください.
1. SynEdit.pas
2.SynEditHighlighter.pas
3.SynEditSearch.pas
4.SynHighlighterJava.pas
1. SynEdit.pas
function TCustomSynEdit.IsWordBreakChar(AChar: WideChar): Boolean;
begin
if Assigned(Highlighter) then
Result := Highlighter.IsWordBreakChar(AChar)
else
case AChar of
#0..#32, '.', ',', ';', ':', '"', '''', #$00B4, '`', #$00B0, '^', '!', '?', '&',
'$', '@', #$00A7, '%', '#', '~', '[', ']', '(', ')', '{', '}', '<', '>',
'-', '=', '+', '*', '/', '\', '|':
Result := True;
else
Result := False;
end;
2.SynEditHighlighter.pas
function TSynCustomHighlighter.IsWordBreakChar(AChar: WideChar): Boolean;
begin
case AChar of
#0..#32, '.', ',', ';', ':', '"', '''', #$00B4, '`', #$00B0, '^', '!', '?', '&',
'$', '@', #$00A7, '%', '#', '~', '[', ']', '(', ')', '{', '}', '<', '>',
'-', '=', '+', '*', '/', '\', '|':
Result := True;
else
Result := False;
end;
end;
3.SynEditSearch.pas
function IsWordBreakChar(C: WideChar): Boolean;
begin
case C of
#0..#32, '.', ',', ';', ':', '"', '''', #$00B4, '`',#$00B0, '^', '!', '?', '&',
'$', '@', #$00A7, '%', '#', '~', '[', ']', '(', ')', '{', '}', '<', '>',
'-', '=', '+', '*', '/', '\', '|':
Result := True;
else
Result := False;
end;
end;
4.SynHighlighterJava.pas
procedure TSynJavaSyn.Next;
begin
fTokenPos := Run;
case fRange of
rsComment: CommentProc;
rsDocument: CommentProc;
else
begin
fRange := rsUnknown;
case fLine[Run] of
'&': AndSymbolProc;
#39: AsciiCharProc;
'@': AtSymbolProc;
'}': BraceCloseProc;
'{': BraceOpenProc;
#13: CRProc;
':': ColonProc;
',': CommaProc;
'=': EqualProc;
'>': GreaterProc;
'A'..'Z', 'a'..'z', '_', '$', #$00C0..#$00D6,#$00D8..#$00F6, #$00F8..#$00FF: IdentProc;
#10: LFProc;
'<': LowerProc;
'-': MinusProc;
'*': MultiplyProc;
'!': NotSymbolProc;
#0: NullProc;
'0'..'9': NumberProc;
'|': OrSymbolProc;
'+': PlusProc;
'.': PointProc;
'#': PoundProc;
'?': QuestionProc;
'%': RemainderSymbolProc;
')': RoundCloseProc;
'(': RoundOpenProc;
';': SemiColonProc;
'/': SlashProc;
#1..#9, #11, #12, #14..#32: SpaceProc;
']': SquareCloseProc;
'[': SquareOpenProc;
#34: StringProc;
'~': TildeProc;
'^': XOrSymbolProc;
else UnknownProc;
end;
end;
end;
function TSynJavaSyn.IsIdentChar(AChar: WideChar): Boolean;
begin
case AChar of
'_', '$', '0'..'9', 'a'..'z', 'A'..'Z', #$00C0..#$00D6, #$00D8..#$00F6,#$00F8..#$00FF:
Result := True;
else
Result := False;
end;
end;