Update utslsynmemo.tsf
优化
This commit is contained in:
+26
-13
@@ -481,7 +481,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
||||
end
|
||||
if pos(vi,jsfh) then
|
||||
begin
|
||||
SetJsToken(tokens,ttk,idx-1);
|
||||
if ttk then
|
||||
SetJsToken(tokens,ttk,idx-1);
|
||||
end
|
||||
if vi="[" then
|
||||
begin
|
||||
@@ -593,7 +594,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
||||
end
|
||||
idx++;
|
||||
end
|
||||
SetJsToken(tokens,ttk,idx-1);
|
||||
if ttk then
|
||||
SetJsToken(tokens,ttk,idx-1);
|
||||
end else
|
||||
if cst="'" or cst='"' then
|
||||
begin
|
||||
@@ -668,7 +670,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
||||
end else
|
||||
if FSynBranch="tsl" and vi="?" then
|
||||
begin
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if ttk then
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if idx<e and s[idx+1]=">" then
|
||||
begin
|
||||
SetTToken(tokens,"?>",idx+1);
|
||||
@@ -685,7 +688,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
||||
end else
|
||||
if vi ="'" then
|
||||
begin
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if ttk then
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
SetTToken(tokens,"'",idx,"'");
|
||||
if idx=e then return "'";
|
||||
r := FindRightChar("'",s,idx+1,e,"\\");
|
||||
@@ -707,7 +711,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
||||
end else
|
||||
if vi = '"' then
|
||||
begin
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if ttk then
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
SetTToken(tokens,'"',idx,'"');
|
||||
if idx=e then return '"';
|
||||
r := FindRightChar('"',s,idx+1,e,"\\");
|
||||
@@ -729,13 +734,15 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
||||
end else
|
||||
if vi="{" then
|
||||
begin
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if ttk then
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
SetTToken(tokens,'{',idx,'{');
|
||||
return ParserTokenLines(s,idx+1,e,'{',tokens);
|
||||
end else
|
||||
if vi="/" then
|
||||
begin
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if ttk then
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if idx=e then
|
||||
begin
|
||||
SetTToken(tokens,vi,idx);
|
||||
@@ -753,7 +760,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
||||
end else
|
||||
if vi="#" then
|
||||
begin
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if ttk then
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if idx=e then
|
||||
begin
|
||||
SetTToken(tokens,vi,idx);
|
||||
@@ -771,7 +779,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
||||
end else
|
||||
if vi="(" then
|
||||
begin
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if ttk then
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if idx=e then
|
||||
begin
|
||||
FCBBState.GetLeft();
|
||||
@@ -792,7 +801,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
||||
end else
|
||||
if vi="%" then
|
||||
begin
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if ttk then
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
idx++;
|
||||
if idx<=e then
|
||||
begin
|
||||
@@ -832,7 +842,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
||||
end else
|
||||
if vi="<" then
|
||||
begin
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if ttk then
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if (idx+6<=e) and s[idx+1]="?" and lowercase(s[idx+2:idx+6])="tslx>" then
|
||||
begin
|
||||
d := SetTToken(tokens,s[idx:idx+6],idx+6);
|
||||
@@ -852,7 +863,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
||||
end else
|
||||
if pos(vi,"`~@#$^&*)+-;,.?:[]|\\=><%/") then
|
||||
begin
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if ttk then
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if vi=")" then
|
||||
begin
|
||||
FCBBState.GetRight();
|
||||
@@ -878,7 +890,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
||||
end
|
||||
idx++;
|
||||
end
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
if ttk then
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
end else
|
||||
if cst="'" or cst='"' then
|
||||
begin
|
||||
|
||||
Reference in New Issue
Block a user