Update utslsynmemo.tsf
优化
This commit is contained in:
+31
-18
@@ -480,8 +480,9 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
|||||||
return ParserTslxTokenLines(s,idx+4,e,"<!--",tokens);
|
return ParserTslxTokenLines(s,idx+4,e,"<!--",tokens);
|
||||||
end
|
end
|
||||||
if pos(vi,jsfh) then
|
if pos(vi,jsfh) then
|
||||||
begin
|
begin
|
||||||
SetJsToken(tokens,ttk,idx-1);
|
if ttk then
|
||||||
|
SetJsToken(tokens,ttk,idx-1);
|
||||||
end
|
end
|
||||||
if vi="[" then
|
if vi="[" then
|
||||||
begin
|
begin
|
||||||
@@ -592,8 +593,9 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
|||||||
ttk+=vi;
|
ttk+=vi;
|
||||||
end
|
end
|
||||||
idx++;
|
idx++;
|
||||||
end
|
end
|
||||||
SetJsToken(tokens,ttk,idx-1);
|
if ttk then
|
||||||
|
SetJsToken(tokens,ttk,idx-1);
|
||||||
end else
|
end else
|
||||||
if cst="'" or cst='"' then
|
if cst="'" or cst='"' then
|
||||||
begin
|
begin
|
||||||
@@ -668,7 +670,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
|||||||
end else
|
end else
|
||||||
if FSynBranch="tsl" and vi="?" then
|
if FSynBranch="tsl" and vi="?" then
|
||||||
begin
|
begin
|
||||||
SetTToken(tokens,ttk,idx-1);
|
if ttk then
|
||||||
|
SetTToken(tokens,ttk,idx-1);
|
||||||
if idx<e and s[idx+1]=">" then
|
if idx<e and s[idx+1]=">" then
|
||||||
begin
|
begin
|
||||||
SetTToken(tokens,"?>",idx+1);
|
SetTToken(tokens,"?>",idx+1);
|
||||||
@@ -685,7 +688,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
|||||||
end else
|
end else
|
||||||
if vi ="'" then
|
if vi ="'" then
|
||||||
begin
|
begin
|
||||||
SetTToken(tokens,ttk,idx-1);
|
if ttk then
|
||||||
|
SetTToken(tokens,ttk,idx-1);
|
||||||
SetTToken(tokens,"'",idx,"'");
|
SetTToken(tokens,"'",idx,"'");
|
||||||
if idx=e then return "'";
|
if idx=e then return "'";
|
||||||
r := FindRightChar("'",s,idx+1,e,"\\");
|
r := FindRightChar("'",s,idx+1,e,"\\");
|
||||||
@@ -707,7 +711,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
|||||||
end else
|
end else
|
||||||
if vi = '"' then
|
if vi = '"' then
|
||||||
begin
|
begin
|
||||||
SetTToken(tokens,ttk,idx-1);
|
if ttk then
|
||||||
|
SetTToken(tokens,ttk,idx-1);
|
||||||
SetTToken(tokens,'"',idx,'"');
|
SetTToken(tokens,'"',idx,'"');
|
||||||
if idx=e then return '"';
|
if idx=e then return '"';
|
||||||
r := FindRightChar('"',s,idx+1,e,"\\");
|
r := FindRightChar('"',s,idx+1,e,"\\");
|
||||||
@@ -728,14 +733,16 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
|||||||
//return ParserTokenLines(s,idx+1,e,'"',tokens);
|
//return ParserTokenLines(s,idx+1,e,'"',tokens);
|
||||||
end else
|
end else
|
||||||
if vi="{" then
|
if vi="{" then
|
||||||
begin
|
begin
|
||||||
SetTToken(tokens,ttk,idx-1);
|
if ttk then
|
||||||
|
SetTToken(tokens,ttk,idx-1);
|
||||||
SetTToken(tokens,'{',idx,'{');
|
SetTToken(tokens,'{',idx,'{');
|
||||||
return ParserTokenLines(s,idx+1,e,'{',tokens);
|
return ParserTokenLines(s,idx+1,e,'{',tokens);
|
||||||
end else
|
end else
|
||||||
if vi="/" then
|
if vi="/" then
|
||||||
begin
|
begin
|
||||||
SetTToken(tokens,ttk,idx-1);
|
if ttk then
|
||||||
|
SetTToken(tokens,ttk,idx-1);
|
||||||
if idx=e then
|
if idx=e then
|
||||||
begin
|
begin
|
||||||
SetTToken(tokens,vi,idx);
|
SetTToken(tokens,vi,idx);
|
||||||
@@ -753,7 +760,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
|||||||
end else
|
end else
|
||||||
if vi="#" then
|
if vi="#" then
|
||||||
begin
|
begin
|
||||||
SetTToken(tokens,ttk,idx-1);
|
if ttk then
|
||||||
|
SetTToken(tokens,ttk,idx-1);
|
||||||
if idx=e then
|
if idx=e then
|
||||||
begin
|
begin
|
||||||
SetTToken(tokens,vi,idx);
|
SetTToken(tokens,vi,idx);
|
||||||
@@ -770,8 +778,9 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
|||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
if vi="(" then
|
if vi="(" then
|
||||||
begin
|
begin
|
||||||
SetTToken(tokens,ttk,idx-1);
|
if ttk then
|
||||||
|
SetTToken(tokens,ttk,idx-1);
|
||||||
if idx=e then
|
if idx=e then
|
||||||
begin
|
begin
|
||||||
FCBBState.GetLeft();
|
FCBBState.GetLeft();
|
||||||
@@ -792,7 +801,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
|||||||
end else
|
end else
|
||||||
if vi="%" then
|
if vi="%" then
|
||||||
begin
|
begin
|
||||||
SetTToken(tokens,ttk,idx-1);
|
if ttk then
|
||||||
|
SetTToken(tokens,ttk,idx-1);
|
||||||
idx++;
|
idx++;
|
||||||
if idx<=e then
|
if idx<=e then
|
||||||
begin
|
begin
|
||||||
@@ -832,7 +842,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
|||||||
end else
|
end else
|
||||||
if vi="<" then
|
if vi="<" then
|
||||||
begin
|
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
|
if (idx+6<=e) and s[idx+1]="?" and lowercase(s[idx+2:idx+6])="tslx>" then
|
||||||
begin
|
begin
|
||||||
d := SetTToken(tokens,s[idx:idx+6],idx+6);
|
d := SetTToken(tokens,s[idx:idx+6],idx+6);
|
||||||
@@ -852,7 +863,8 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
|||||||
end else
|
end else
|
||||||
if pos(vi,"`~@#$^&*)+-;,.?:[]|\\=><%/") then
|
if pos(vi,"`~@#$^&*)+-;,.?:[]|\\=><%/") then
|
||||||
begin
|
begin
|
||||||
SetTToken(tokens,ttk,idx-1);
|
if ttk then
|
||||||
|
SetTToken(tokens,ttk,idx-1);
|
||||||
if vi=")" then
|
if vi=")" then
|
||||||
begin
|
begin
|
||||||
FCBBState.GetRight();
|
FCBBState.GetRight();
|
||||||
@@ -877,8 +889,9 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
|||||||
ttk+=vi;
|
ttk+=vi;
|
||||||
end
|
end
|
||||||
idx++;
|
idx++;
|
||||||
end
|
end
|
||||||
SetTToken(tokens,ttk,idx-1);
|
if ttk then
|
||||||
|
SetTToken(tokens,ttk,idx-1);
|
||||||
end else
|
end else
|
||||||
if cst="'" or cst='"' then
|
if cst="'" or cst='"' then
|
||||||
begin
|
begin
|
||||||
|
|||||||
Reference in New Issue
Block a user