parent
4a7e770bf9
commit
c8d44c6756
|
|
@ -1873,6 +1873,7 @@ type TEditer=class(TCustomcontrol) //
|
||||||
FSynClasses["json"]:= array(class(TJsonSynHighLighter),class(TSynCompletion),";json;");
|
FSynClasses["json"]:= array(class(TJsonSynHighLighter),class(TSynCompletion),";json;");
|
||||||
FSynClasses["js"]:= array(class(TJsSynHighLighter),class(tjssyncompletion),";js;");
|
FSynClasses["js"]:= array(class(TJsSynHighLighter),class(tjssyncompletion),";js;");
|
||||||
FSynClasses["css"]:= array(class(TcssSynHighLighter),class(tcsssyncompletion),";css;");
|
FSynClasses["css"]:= array(class(TcssSynHighLighter),class(tcsssyncompletion),";css;");
|
||||||
|
FSynClasses["xml"]:= array(class(TxmlSynHighLighter),class(tcsssyncompletion),";xml;");
|
||||||
FSynClasses["ini"]:= array(class(TINISynHigLighter),class(TSynCompletion),";ini;");
|
FSynClasses["ini"]:= array(class(TINISynHigLighter),class(TSynCompletion),";ini;");
|
||||||
FSynClasses["bat"]:= array(class(TBatSynHigLighter),class(TSynCompletion),";bat;cmd;");
|
FSynClasses["bat"]:= array(class(TBatSynHigLighter),class(TSynCompletion),";bat;cmd;");
|
||||||
FSynClasses["tfm"]:= array(class(ttfmhighlighter),class(TSynCompletion),";tfm;");
|
FSynClasses["tfm"]:= array(class(ttfmhighlighter),class(TSynCompletion),";tfm;");
|
||||||
|
|
|
||||||
|
|
@ -1388,6 +1388,45 @@ type TJsonSynHighLighter = class(tcustomsynhighlighter)
|
||||||
ExecuteCommand("pairs",array(("{","}"),("[","]")));
|
ExecuteCommand("pairs",array(("{","}"),("[","]")));
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
type TxmlSynHighLighter = class(tcustomsynhighlighter)
|
||||||
|
function create(AOwner);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
ExecuteCommand("strings",array(('"'),("'")));
|
||||||
|
ExecuteCommand("keywords",array());
|
||||||
|
ExecuteCommand("rowannotes",array());
|
||||||
|
ExecuteCommand("blockannotes",array(("<!--","-->")));
|
||||||
|
ExecuteCommand("syms",array("<",">","=","?","</"));
|
||||||
|
ExecuteCommand("pairs",array(("<",">"),("</",">")));
|
||||||
|
end
|
||||||
|
function SetTToken(tokens,ttk,idx,ext);override;
|
||||||
|
begin
|
||||||
|
st := ExecuteCommand("getcurrentpairstate",">");
|
||||||
|
st1 := st.state;
|
||||||
|
d := inherited;
|
||||||
|
if not d then return ;
|
||||||
|
if st1=1 and st.state=1 then
|
||||||
|
begin
|
||||||
|
st.subitemadd();
|
||||||
|
case d.FFColor of
|
||||||
|
stringcolor,symcolor:
|
||||||
|
begin
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
if st.subitemcount()>1 then
|
||||||
|
begin
|
||||||
|
d.FFColor := 0x0000ff;
|
||||||
|
end else
|
||||||
|
d.FFColor := 0xff0000;
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return d;
|
||||||
|
//echo "\r\n>>>",st1,"====",st2;
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
type TJsSynHighLighter = class(tcustomsynhighlighter)
|
type TJsSynHighLighter = class(tcustomsynhighlighter)
|
||||||
function create(AOwner);
|
function create(AOwner);
|
||||||
|
|
|
||||||
|
|
@ -3149,19 +3149,19 @@ type tcustomsynhighlighter = class(TSynHighLighter)
|
||||||
fregs := array();
|
fregs := array();
|
||||||
setkeyword(array("null","true","false","goto","break","for","to","while","do"));
|
setkeyword(array("null","true","false","goto","break","for","to","while","do"));
|
||||||
setblockannote(array(
|
setblockannote(array(
|
||||||
("/*","*/"),
|
("/*","*/"),
|
||||||
));
|
));
|
||||||
setrowannote(array("//"));
|
setrowannote(array("//"));
|
||||||
setsyms(array("+","-","*","/",";","(",")","{","}",":"));
|
setsyms(array("+","-","*","/",";","(",")","{","}",":"));
|
||||||
setstring(array(
|
setstring(array(
|
||||||
("'","\\"),
|
("'","\\"),
|
||||||
('"',"\\"),
|
('"',"\\"),
|
||||||
));
|
));
|
||||||
setpairs(array(
|
setpairs(array(
|
||||||
("(",")"),
|
("(",")"),
|
||||||
("[","]"),
|
("[","]"),
|
||||||
("{","}"),
|
("{","}"),
|
||||||
));
|
));
|
||||||
setsysfun(array());
|
setsysfun(array());
|
||||||
clean();
|
clean();
|
||||||
end
|
end
|
||||||
|
|
@ -3205,6 +3205,14 @@ type tcustomsynhighlighter = class(TSynHighLighter)
|
||||||
begin
|
begin
|
||||||
return setregs(pm);
|
return setregs(pm);
|
||||||
end
|
end
|
||||||
|
"getcurrentpairstate":
|
||||||
|
begin
|
||||||
|
if fcbgestate then
|
||||||
|
begin
|
||||||
|
return fcbgestate[pm];
|
||||||
|
end
|
||||||
|
return nil;
|
||||||
|
end
|
||||||
end ;
|
end ;
|
||||||
return inherited;
|
return inherited;
|
||||||
end
|
end
|
||||||
|
|
@ -3439,8 +3447,7 @@ type tcustomsynhighlighter = class(TSynHighLighter)
|
||||||
if b>e then return cst;
|
if b>e then return cst;
|
||||||
if ifarray(cst) and (cst[0]="str" or cst[0]="annote") then
|
if ifarray(cst) and (cst[0]="str" or cst[0]="annote") then
|
||||||
begin
|
begin
|
||||||
cst1 := cst[1];
|
|
||||||
cstL := length(cst1);
|
|
||||||
r := FindRightChar(cst[2],s,b,e,cst[3]);
|
r := FindRightChar(cst[2],s,b,e,cst[3]);
|
||||||
if r=0 then //ûÕÒµ½
|
if r=0 then //ûÕÒµ½
|
||||||
begin
|
begin
|
||||||
|
|
@ -3453,6 +3460,15 @@ type tcustomsynhighlighter = class(TSynHighLighter)
|
||||||
begin
|
begin
|
||||||
Setttoken(tokens,s[b:r-1],r-1,cst);
|
Setttoken(tokens,s[b:r-1],r-1,cst);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if cst[0]="annote" then
|
||||||
|
begin
|
||||||
|
cstL := fblockstiresc[cst[1]];
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
cst1 := cst[1];
|
||||||
|
cstL := length(cst1);
|
||||||
|
end
|
||||||
Setttoken(tokens,s[r:(r-1+cstL)],(r-1+cstL),cst);
|
Setttoken(tokens,s[r:(r-1+cstL)],(r-1+cstL),cst);
|
||||||
if r<e then
|
if r<e then
|
||||||
begin
|
begin
|
||||||
|
|
@ -3498,6 +3514,7 @@ type tcustomsynhighlighter = class(TSynHighLighter)
|
||||||
begin
|
begin
|
||||||
fblockstiresa := array();
|
fblockstiresa := array();
|
||||||
fblockstiresb := array();
|
fblockstiresb := array();
|
||||||
|
fblockstiresc := array();
|
||||||
for i,v in d do
|
for i,v in d do
|
||||||
begin
|
begin
|
||||||
if not ifarray(d) then continue ;
|
if not ifarray(d) then continue ;
|
||||||
|
|
@ -3511,6 +3528,7 @@ type tcustomsynhighlighter = class(TSynHighLighter)
|
||||||
st := new TTire();
|
st := new TTire();
|
||||||
st.add(v1);
|
st.add(v1);
|
||||||
fblockstiresb[v0] := st;
|
fblockstiresb[v0] := st;
|
||||||
|
fblockstiresc[v0] := length(v1);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -3680,6 +3698,7 @@ type tcustomsynhighlighter = class(TSynHighLighter)
|
||||||
frowstires;
|
frowstires;
|
||||||
fblockstiresa;
|
fblockstiresa;
|
||||||
fblockstiresb;
|
fblockstiresb;
|
||||||
|
fblockstiresc;
|
||||||
fregs;
|
fregs;
|
||||||
/////
|
/////
|
||||||
fkeywordcolor;
|
fkeywordcolor;
|
||||||
|
|
|
||||||
|
|
@ -1827,6 +1827,15 @@ type tpairstate =class //
|
||||||
FIndexs := array(0);
|
FIndexs := array(0);
|
||||||
FIndex := 0;
|
FIndex := 0;
|
||||||
FCstate := false;
|
FCstate := false;
|
||||||
|
FSubcount := array(0);
|
||||||
|
end
|
||||||
|
function subitemadd();
|
||||||
|
begin
|
||||||
|
FSubcount[FIndex]++;
|
||||||
|
end
|
||||||
|
function subitemcount();
|
||||||
|
begin
|
||||||
|
return FSubcount[FIndex];
|
||||||
end
|
end
|
||||||
function GetLeft();
|
function GetLeft();
|
||||||
begin
|
begin
|
||||||
|
|
@ -1838,8 +1847,8 @@ type tpairstate =class //
|
||||||
FIndexs[FIndex]:=0;
|
FIndexs[FIndex]:=0;
|
||||||
end else //上一个非左括号
|
end else //上一个非左括号
|
||||||
begin
|
begin
|
||||||
|
|
||||||
FIndexs[FIndex]++;
|
FIndexs[FIndex]++;
|
||||||
|
FSubcount[FIndex]:=0;
|
||||||
end
|
end
|
||||||
FState := true;
|
FState := true;
|
||||||
end
|
end
|
||||||
|
|
@ -1886,6 +1895,7 @@ type tpairstate =class //
|
||||||
r.FCJ := FCJ;
|
r.FCJ := FCJ;
|
||||||
r.FIndexs := FIndexs;
|
r.FIndexs := FIndexs;
|
||||||
r.FIndex := FIndex;
|
r.FIndex := FIndex;
|
||||||
|
r.FSubcount := FSubcount;
|
||||||
return r;
|
return r;
|
||||||
end
|
end
|
||||||
protected
|
protected
|
||||||
|
|
@ -1893,6 +1903,7 @@ type tpairstate =class //
|
||||||
FState;
|
FState;
|
||||||
FCJ;
|
FCJ;
|
||||||
FIndexs;
|
FIndexs;
|
||||||
|
FSubcount;
|
||||||
FIndex;
|
FIndex;
|
||||||
FType;
|
FType;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue