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);
|
||||
end
|
||||
if pos(vi,jsfh) then
|
||||
begin
|
||||
SetJsToken(tokens,ttk,idx-1);
|
||||
begin
|
||||
if ttk then
|
||||
SetJsToken(tokens,ttk,idx-1);
|
||||
end
|
||||
if vi="[" then
|
||||
begin
|
||||
@@ -592,8 +593,9 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
||||
ttk+=vi;
|
||||
end
|
||||
idx++;
|
||||
end
|
||||
SetJsToken(tokens,ttk,idx-1);
|
||||
end
|
||||
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,"\\");
|
||||
@@ -728,14 +733,16 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
||||
//return ParserTokenLines(s,idx+1,e,'"',tokens);
|
||||
end else
|
||||
if vi="{" then
|
||||
begin
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
begin
|
||||
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);
|
||||
@@ -770,8 +778,9 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
||||
end
|
||||
end else
|
||||
if vi="(" then
|
||||
begin
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
begin
|
||||
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();
|
||||
@@ -877,8 +889,9 @@ type TTslSynHighLighter = class(TSynHighLighter)
|
||||
ttk+=vi;
|
||||
end
|
||||
idx++;
|
||||
end
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
end
|
||||
if ttk then
|
||||
SetTToken(tokens,ttk,idx-1);
|
||||
end else
|
||||
if cst="'" or cst='"' then
|
||||
begin
|
||||
|
||||
Reference in New Issue
Block a user