mirror of https://gitlab.com/basile.b/dexed.git
added syntactic errors to symbol list
+ option to auto expand warn/err list
This commit is contained in:
parent
11326abf36
commit
2a6b8f757d
|
@ -11,10 +11,12 @@ void main(string[] args)
|
||||||
if (!fname.exists) return;
|
if (!fname.exists) return;
|
||||||
|
|
||||||
// load and parse the file
|
// load and parse the file
|
||||||
auto config = LexerConfig(fname, StringBehavior.source, WhitespaceBehavior.include);
|
auto config = LexerConfig(fname, StringBehavior.source, WhitespaceBehavior.skip);
|
||||||
auto source = cast(ubyte[]) read(fname, size_t.max);
|
auto source = cast(ubyte[]) read(fname, size_t.max);
|
||||||
auto scache = StringCache(StringCache.defaultBucketCount);
|
auto scache = StringCache(StringCache.defaultBucketCount);
|
||||||
auto ast = parseModule(getTokensForParser(source, config, &scache), fname);
|
|
||||||
|
|
||||||
|
auto ast = parseModule(getTokensForParser(source, config, &scache), fname, null, &(SymbolListBuilder.astError));
|
||||||
|
|
||||||
// visit each root member
|
// visit each root member
|
||||||
auto slb = construct!SymbolListBuilder;
|
auto slb = construct!SymbolListBuilder;
|
||||||
|
@ -87,17 +89,19 @@ if (is(T == class) || (isPointer!T && is(PointerTarget!T == struct)))
|
||||||
// Serializable Symbol --------------------------------------------------------+
|
// Serializable Symbol --------------------------------------------------------+
|
||||||
enum SymbolType
|
enum SymbolType
|
||||||
{
|
{
|
||||||
_alias, // X
|
_alias,
|
||||||
_class, // X
|
_class,
|
||||||
_enum, // X
|
_enum,
|
||||||
_function, // X
|
_function,
|
||||||
_interface, // X
|
_interface,
|
||||||
_import, // X
|
_import,
|
||||||
_mixin, // X (template decl)
|
_mixin, // (template decl)
|
||||||
_struct, // X
|
_struct,
|
||||||
_template, // X
|
_template,
|
||||||
_union, // X
|
_union,
|
||||||
_variable // X
|
_variable,
|
||||||
|
_error,
|
||||||
|
_warning
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Symbol
|
struct Symbol
|
||||||
|
@ -137,6 +141,7 @@ class SymbolListBuilder : ASTVisitor
|
||||||
{
|
{
|
||||||
Symbol * root;
|
Symbol * root;
|
||||||
Symbol * parent;
|
Symbol * parent;
|
||||||
|
static Symbol * [] illFormed;
|
||||||
size_t count;
|
size_t count;
|
||||||
|
|
||||||
alias visit = ASTVisitor.visit;
|
alias visit = ASTVisitor.visit;
|
||||||
|
@ -144,6 +149,8 @@ class SymbolListBuilder : ASTVisitor
|
||||||
this()
|
this()
|
||||||
{
|
{
|
||||||
root = construct!Symbol;
|
root = construct!Symbol;
|
||||||
|
if(illFormed.length)
|
||||||
|
root.subs ~= illFormed;
|
||||||
resetRoot;
|
resetRoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,6 +159,16 @@ class SymbolListBuilder : ASTVisitor
|
||||||
root.destruct;
|
root.destruct;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void astError(string fname, size_t line, size_t col, string msg, bool isErr)
|
||||||
|
{
|
||||||
|
Symbol * newSym = construct!Symbol;
|
||||||
|
newSym.col = col;
|
||||||
|
newSym.line = line;
|
||||||
|
newSym.name = msg;
|
||||||
|
isErr ? newSym.type = SymbolType._error : newSym.type = SymbolType._warning;
|
||||||
|
illFormed ~= newSym;
|
||||||
|
}
|
||||||
|
|
||||||
final void resetRoot(){parent = root;}
|
final void resetRoot(){parent = root;}
|
||||||
|
|
||||||
final string serialize()
|
final string serialize()
|
||||||
|
|
|
@ -36,7 +36,7 @@ inherited CESymbolListWidget: TCESymbolListWidget
|
||||||
OnKeyPress = TreeKeyPress
|
OnKeyPress = TreeKeyPress
|
||||||
Options = [tvoAutoItemHeight, tvoKeepCollapsedNodes, tvoReadOnly, tvoRightClickSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
|
Options = [tvoAutoItemHeight, tvoKeepCollapsedNodes, tvoReadOnly, tvoRightClickSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
|
||||||
Items.Data = {
|
Items.Data = {
|
||||||
F9FFFFFF02000B000000000000000000000000000000FFFFFFFF000000000000
|
F9FFFFFF02000D000000000000000000000000000000FFFFFFFF000000000000
|
||||||
00000005000000416C696173010000000100000001000000FFFFFFFF00000000
|
00000005000000416C696173010000000100000001000000FFFFFFFF00000000
|
||||||
000000000005000000436C617373020000000200000002000000FFFFFFFF0000
|
000000000005000000436C617373020000000200000002000000FFFFFFFF0000
|
||||||
0000000000000004000000456E756D030000000300000003000000FFFFFFFF00
|
0000000000000004000000456E756D030000000300000003000000FFFFFFFF00
|
||||||
|
@ -48,7 +48,9 @@ inherited CESymbolListWidget: TCESymbolListWidget
|
||||||
6374080000000800000008000000FFFFFFFF0000000000000000000800000054
|
6374080000000800000008000000FFFFFFFF0000000000000000000800000054
|
||||||
656D706C617465000000000000000000000000FFFFFFFF000000000000000000
|
656D706C617465000000000000000000000000FFFFFFFF000000000000000000
|
||||||
05000000556E696F6E010000000100000001000000FFFFFFFF00000000000000
|
05000000556E696F6E010000000100000001000000FFFFFFFF00000000000000
|
||||||
0000080000005661726961626C65
|
0000080000005661726961626C65090000000900000009000000FFFFFFFF0000
|
||||||
|
00000000000000080000005761726E696E67730A0000000A0000000A000000FF
|
||||||
|
FFFFFF000000000000000000060000004572726F7273
|
||||||
}
|
}
|
||||||
TreeLineColor = 14671839
|
TreeLineColor = 14671839
|
||||||
TreeLinePenStyle = psSolid
|
TreeLinePenStyle = psSolid
|
||||||
|
@ -106,7 +108,7 @@ inherited CESymbolListWidget: TCESymbolListWidget
|
||||||
left = 152
|
left = 152
|
||||||
top = 48
|
top = 48
|
||||||
Bitmap = {
|
Bitmap = {
|
||||||
4C69090000001000000010000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
4C690B0000001000000010000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
|
@ -394,6 +396,70 @@ inherited CESymbolListWidget: TCESymbolListWidget
|
||||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
|
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
|
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
|
FF00FFFFFF00FFFFFF00FFFFFF003B85CC003B85CC003B85CC003B85CC003B85
|
||||||
|
CC003B85CC003983CA213384CDFF3384CDFF3983CA213B85CC003B85CC003B85
|
||||||
|
CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85
|
||||||
|
CC003983CB00337EC7CF84C3F1FF84C3F1FF337EC7CF3983CB003B85CC003B85
|
||||||
|
CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003A84
|
||||||
|
CB003580CA6D5398D7FFC1F0FFFFC1F0FFFF5398D7FF3580CA6D3A84CB003B85
|
||||||
|
CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003882
|
||||||
|
CA0A3A83CBFFB2E5FFFF9EC8DEFF9EC8DEFFB2E5FFFF3A83CBFF3882CA0A3B85
|
||||||
|
CC003B85CC003B85CC003B85CC003B85CC003B85CC003B85CC003983CB00337E
|
||||||
|
C8CF86BEEAFFA4ECFFFF6C5D53FF6C5D53FFA4ECFFFF86BEEAFF337EC8CF3983
|
||||||
|
CB003B85CC003B85CC003B85CC003B85CC003B85CC003A84CC003580C9585797
|
||||||
|
D5FFC6F3FFFF3ACAFFFF6C5B54FF6C5B54FF3ACAFFFFC6F3FFFF5797D5FF3580
|
||||||
|
C9583A84CC003B85CC003B85CC003B85CC003B85CC003882CA003C82C9FFC1E8
|
||||||
|
FDFF50CCFFFF27C5FFFF69554CFF69554CFF27C5FFFF50CCFFFFC1E8FDFF3C82
|
||||||
|
C9FF3882CA003B85CC003B85CC003B85CC003983CB00337EC8BB90BFE6FF6FD7
|
||||||
|
FFFF32C3FFFF34CBFFFF644B3FFF644B3FFF34CBFFFF32C3FFFF6FD7FFFF90BF
|
||||||
|
E6FF337EC8BB3983CB003B85CC003A84CC003680C9445B97D4FF9EE8FFFF38C7
|
||||||
|
FFFF3DC8FFFF3DCFFFFF4BBCE9FF4BBCE9FF3DCFFFFF3DC8FFFF38C7FFFF9EE8
|
||||||
|
FFFF5B97D4FF3680C9443A84CC003982CB003F82C9FFA3E0FAFF40CFFFFF44CE
|
||||||
|
FFFF46CFFFFF44D6FFFF775C50FF775C50FF44D6FFFF46CFFFFF44CEFFFF40CF
|
||||||
|
FFFFA3E0FAFF3F82C9FF3982CB003880C9947AB8E4FF52DBFFFF4BD5FFFF4DD5
|
||||||
|
FFFF4DD6FFFF4BDCFFFF67493FFF67493FFF4BDCFFFF4DD6FFFF4DD5FFFF4BD5
|
||||||
|
FFFF52DBFFFF7AB8E4FF3880C9943B86CDFF55E3FFFF55E3FFFF56E1FFFF56E1
|
||||||
|
FFFF56E2FFFF56E5FFFF55E9FFFF55E9FFFF56E5FFFF56E2FFFF56E1FFFF56E1
|
||||||
|
FFFF55E3FFFF55E3FFFF3B86CDFF3A82CAFF397FC8FF387DC7FF387CC7FF397C
|
||||||
|
C7FF397CC7FF387DC7FF387EC9FF387EC9FF387DC7FF397CC7FF397CC7FF387C
|
||||||
|
C7FF387DC7FF397FC8FF3A82CAFF000000330000003300000033000000330000
|
||||||
|
0033000000330000003300000033000000330000003300000033000000330000
|
||||||
|
0033000000330000003300000033FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
|
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
|
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
|
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
|
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF006A85
|
||||||
|
FC236984FA7D6782F9DB6580F7F3637EF5F3617CF3DB5F7AF17D5D77EF23FFFF
|
||||||
|
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF006984FA536882
|
||||||
|
F9E66E83EEFF92A6F4FFA0B4F8FFA0B4F8FF91A6F3FF687DE9FF5973EBE65671
|
||||||
|
E953FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF006883F9536681F8F48497
|
||||||
|
F1FFA9BDFBFF8AA3F8FF6B89F6FF6B89F6FF89A2F8FFA8BCFAFF7F92ECFF526C
|
||||||
|
E4F44F69E253FFFFFF00FFFFFF00FFFFFF006781F822657FF6E58397F0FFA9BD
|
||||||
|
FBFF6382F5FF6382F5FFFFFFFFFFFFFFFFFF617EF3FF607CF3FFA6B9F9FF7B8D
|
||||||
|
EAFF4A64DEE54862DB22FFFFFF00FFFFFF00637EF57E6C81ECFFA9BDFBFF6382
|
||||||
|
F5FF6281F5FF6280F4FFFFFFFFFFFFFFFFFF5F7AF1FF5F78F0FF5D76EFFFA5B5
|
||||||
|
F8FF5D70DDFF435DD77EFFFFFF00FFFFFF005F7AF1DB91A6F3FF88A1F8FF6280
|
||||||
|
F4FF617EF3FF607CF3FFFFFFFFFFFFFFFFFF5D76EFFF5C73EEFF5B70ECFF8293
|
||||||
|
F1FF8998ECFF3E58D2DBFFFFFF00FFFFFF005B76EDF6A1B6F8FF6784F4FF607C
|
||||||
|
F3FF5F7AF1FF5F78F0FFFFFFFFFFFFFFFFFF5B70ECFF5A6EEBFF596CEAFF5F6F
|
||||||
|
E9FF9BA8F1FF3A53CEF6FFFFFF00FFFFFF005771E9F6A0B3F7FF6580F2FF5F78
|
||||||
|
F0FF5D76EFFF5C73EEFFD3D9FAFFFFFFFFFF596CEAFF5869E8FF5767E7FF5D6C
|
||||||
|
E7FF99A5F1FF354FCAF6FFFFFF00FFFFFF00526DE5DB8E9FF0FF8499F4FF5C73
|
||||||
|
EEFF5B70ECFF5A6EEBFF909DF1FFA6AFF3FF5767E7FF5665E6FF5562E5FF7D89
|
||||||
|
EBFF8591E7FF314AC6DBFFFFFF00FFFFFF004E68E17E6073E0FFA4B3F7FF5A6E
|
||||||
|
EBFF596CEAFF5869E8FFFFFFFFFFFFFFFFFF5562E5FF5461E3FF535FE2FF9FA9
|
||||||
|
F2FF5061D1FF2D46C27EFFFFFF00FFFFFF004963DC224660DAE57888E6FFA3B0
|
||||||
|
F5FF5767E7FF5665E6FF8992EDFF8892ECFF535FE2FF525DE1FF9FA9F2FF6F7D
|
||||||
|
DDFF2B44C0E52942BE22FFFFFF00FFFFFF00FFFFFF00425CD5533F59D3F47584
|
||||||
|
E3FFA1ACF4FF7F8BECFF5C67E4FF5B66E3FF7D87EAFF9FA8F1FF6F7CDDFF2943
|
||||||
|
BFF42741BD53FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF003A54CF533852
|
||||||
|
CCE65264D4FF8490E7FF95A0EEFF959FEDFF838EE5FF4C5DCEFF2841BDE6263F
|
||||||
|
BB53FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00334D
|
||||||
|
C823314BC67D2F48C4DB2C46C2F32A44C0F32842BEDB2640BC7D243EBA23FFFF
|
||||||
|
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
|
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||||
FF00FFFFFF00FFFFFF00FFFFFF00
|
FF00FFFFFF00FFFFFF00FFFFFF00
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,7 +23,9 @@ type
|
||||||
_struct,
|
_struct,
|
||||||
_template,
|
_template,
|
||||||
_union,
|
_union,
|
||||||
_variable
|
_variable,
|
||||||
|
_error,
|
||||||
|
_warning
|
||||||
);
|
);
|
||||||
|
|
||||||
TSymbolCollection = class;
|
TSymbolCollection = class;
|
||||||
|
@ -78,6 +80,7 @@ type
|
||||||
fShowChildCategories: boolean;
|
fShowChildCategories: boolean;
|
||||||
fAutoRefreshDelay: Integer;
|
fAutoRefreshDelay: Integer;
|
||||||
fSmartFilter: boolean;
|
fSmartFilter: boolean;
|
||||||
|
fAutoExpandErrors: boolean;
|
||||||
published
|
published
|
||||||
property autoRefresh: boolean read fAutoRefresh write fAutoRefresh;
|
property autoRefresh: boolean read fAutoRefresh write fAutoRefresh;
|
||||||
property refreshOnChange: boolean read fRefreshOnChange write fRefreshOnChange;
|
property refreshOnChange: boolean read fRefreshOnChange write fRefreshOnChange;
|
||||||
|
@ -85,6 +88,7 @@ type
|
||||||
property showChildCategories: boolean read fShowChildCategories write fShowChildCategories;
|
property showChildCategories: boolean read fShowChildCategories write fShowChildCategories;
|
||||||
property autoRefreshDelay: Integer read fAutoRefreshDelay write fAutoRefreshDelay;
|
property autoRefreshDelay: Integer read fAutoRefreshDelay write fAutoRefreshDelay;
|
||||||
property smartFilter: boolean read fSmartFilter write fSmartFilter;
|
property smartFilter: boolean read fSmartFilter write fSmartFilter;
|
||||||
|
property autoExpandErrors: boolean read fAutoExpandErrors write fAutoExpandErrors;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
procedure Assign(Source: TPersistent); override;
|
procedure Assign(Source: TPersistent); override;
|
||||||
|
@ -122,9 +126,11 @@ type
|
||||||
fRefreshOnFocus: boolean;
|
fRefreshOnFocus: boolean;
|
||||||
fShowChildCategories: boolean;
|
fShowChildCategories: boolean;
|
||||||
fSmartFilter: boolean;
|
fSmartFilter: boolean;
|
||||||
|
fAutoExpandErrors: boolean;
|
||||||
fToolOutput: TMemoryStream;
|
fToolOutput: TMemoryStream;
|
||||||
ndAlias, ndClass, ndEnum, ndFunc, ndUni: TTreeNode;
|
ndAlias, ndClass, ndEnum, ndFunc, ndUni: TTreeNode;
|
||||||
ndImp, ndIntf, ndMix, ndStruct, ndTmp, ndVar: TTreeNode;
|
ndImp, ndIntf, ndMix, ndStruct, ndTmp: TTreeNode;
|
||||||
|
ndVar, ndWarn, ndErr: TTreeNode;
|
||||||
procedure TreeDblClick(Sender: TObject);
|
procedure TreeDblClick(Sender: TObject);
|
||||||
procedure actRefreshExecute(Sender: TObject);
|
procedure actRefreshExecute(Sender: TObject);
|
||||||
procedure actAutoRefreshExecute(Sender: TObject);
|
procedure actAutoRefreshExecute(Sender: TObject);
|
||||||
|
@ -218,11 +224,19 @@ end;
|
||||||
procedure TSymbolList.LoadFromTool(str: TStream);
|
procedure TSymbolList.LoadFromTool(str: TStream);
|
||||||
var
|
var
|
||||||
bin: TMemoryStream;
|
bin: TMemoryStream;
|
||||||
|
dat: integer;
|
||||||
begin
|
begin
|
||||||
bin := TMemoryStream.Create;
|
bin := TMemoryStream.Create;
|
||||||
try
|
try
|
||||||
str.Position:=0;
|
str.Position:=0;
|
||||||
ObjectTextToBinary(str, bin);
|
try
|
||||||
|
ObjectTextToBinary(str, bin);
|
||||||
|
except
|
||||||
|
// if output is not fully read then
|
||||||
|
// the tool process never terminates.
|
||||||
|
while str.Read(dat, SizeOf(dat)) <> 0 do;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
bin.Position:=0;
|
bin.Position:=0;
|
||||||
bin.ReadComponent(self);
|
bin.ReadComponent(self);
|
||||||
finally
|
finally
|
||||||
|
@ -237,6 +251,7 @@ begin
|
||||||
inherited;
|
inherited;
|
||||||
fRefreshOnFocus := true;
|
fRefreshOnFocus := true;
|
||||||
fShowChildCategories := true;
|
fShowChildCategories := true;
|
||||||
|
fAutoExpandErrors := true;
|
||||||
fSmartFilter := true;
|
fSmartFilter := true;
|
||||||
fAutoRefreshDelay := 1500;
|
fAutoRefreshDelay := 1500;
|
||||||
end;
|
end;
|
||||||
|
@ -255,6 +270,7 @@ begin
|
||||||
fAutoRefresh := widg.fAutoRefresh;
|
fAutoRefresh := widg.fAutoRefresh;
|
||||||
fShowChildCategories := widg.fShowChildCategories;
|
fShowChildCategories := widg.fShowChildCategories;
|
||||||
fSmartFilter := widg.fSmartFilter;
|
fSmartFilter := widg.fSmartFilter;
|
||||||
|
fAutoExpandErrors := widg.fAutoExpandErrors;
|
||||||
end
|
end
|
||||||
else inherited;
|
else inherited;
|
||||||
end;
|
end;
|
||||||
|
@ -273,6 +289,7 @@ begin
|
||||||
widg.fAutoRefresh := fAutoRefresh;
|
widg.fAutoRefresh := fAutoRefresh;
|
||||||
widg.fShowChildCategories := fShowChildCategories;
|
widg.fShowChildCategories := fShowChildCategories;
|
||||||
widg.fSmartFilter := fSmartFilter;
|
widg.fSmartFilter := fSmartFilter;
|
||||||
|
widg.fAutoExpandErrors := fAutoExpandErrors;
|
||||||
//
|
//
|
||||||
widg.fActAutoRefresh.Checked := fAutoRefresh;
|
widg.fActAutoRefresh.Checked := fAutoRefresh;
|
||||||
widg.fActRefreshOnChange.Checked:= fRefreshOnChange;
|
widg.fActRefreshOnChange.Checked:= fRefreshOnChange;
|
||||||
|
@ -340,6 +357,8 @@ begin
|
||||||
ndTmp := Tree.Items[8];
|
ndTmp := Tree.Items[8];
|
||||||
ndUni := Tree.Items[9];
|
ndUni := Tree.Items[9];
|
||||||
ndVar := Tree.Items[10];
|
ndVar := Tree.Items[10];
|
||||||
|
ndWarn := Tree.Items[11];
|
||||||
|
ndErr := Tree.Items[12];
|
||||||
//
|
//
|
||||||
png := TPortableNetworkGraphic.Create;
|
png := TPortableNetworkGraphic.Create;
|
||||||
try
|
try
|
||||||
|
@ -526,6 +545,8 @@ begin
|
||||||
ndTmp.Visible := ndTmp.Count > 0;
|
ndTmp.Visible := ndTmp.Count > 0;
|
||||||
ndUni.Visible := ndUni.Count > 0;
|
ndUni.Visible := ndUni.Count > 0;
|
||||||
ndVar.Visible := ndVar.Count > 0;
|
ndVar.Visible := ndVar.Count > 0;
|
||||||
|
ndWarn.Visible := ndWarn.Count > 0;
|
||||||
|
ndErr.Visible := ndErr.Count > 0;
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
ndAlias.Visible := true;
|
ndAlias.Visible := true;
|
||||||
|
@ -539,6 +560,8 @@ begin
|
||||||
ndTmp.Visible := true;
|
ndTmp.Visible := true;
|
||||||
ndUni.Visible := true;
|
ndUni.Visible := true;
|
||||||
ndVar.Visible := true;
|
ndVar.Visible := true;
|
||||||
|
ndWarn.Visible := true;
|
||||||
|
ndErr.Visible := true;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -555,6 +578,8 @@ begin
|
||||||
ndTmp.DeleteChildren;
|
ndTmp.DeleteChildren;
|
||||||
ndUni.DeleteChildren;
|
ndUni.DeleteChildren;
|
||||||
ndVar.DeleteChildren;
|
ndVar.DeleteChildren;
|
||||||
|
ndWarn.DeleteChildren;
|
||||||
|
ndErr.DeleteChildren;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCESymbolListWidget.TreeFilterEdit1AfterFilter(Sender: TObject);
|
procedure TCESymbolListWidget.TreeFilterEdit1AfterFilter(Sender: TObject);
|
||||||
|
@ -636,6 +661,13 @@ end;
|
||||||
procedure TCESymbolListWidget.toolTerminated(sender: TObject);
|
procedure TCESymbolListWidget.toolTerminated(sender: TObject);
|
||||||
//
|
//
|
||||||
function getCatNode(node: TTreeNode; stype: TSymbolType ): TTreeNode;
|
function getCatNode(node: TTreeNode; stype: TSymbolType ): TTreeNode;
|
||||||
|
//
|
||||||
|
function newCat(const aCat: string): TTreeNode;
|
||||||
|
begin
|
||||||
|
result := node.FindNode(aCat);
|
||||||
|
if result = nil then result := node.TreeNodes.AddChild(node, aCat);
|
||||||
|
end;
|
||||||
|
//
|
||||||
begin
|
begin
|
||||||
if node = nil then case stype of
|
if node = nil then case stype of
|
||||||
_alias : exit(ndAlias);
|
_alias : exit(ndAlias);
|
||||||
|
@ -649,62 +681,22 @@ begin
|
||||||
_template : exit(ndTmp);
|
_template : exit(ndTmp);
|
||||||
_union : exit(ndUni);
|
_union : exit(ndUni);
|
||||||
_variable : exit(ndVar);
|
_variable : exit(ndVar);
|
||||||
|
_warning : exit(ndWarn);
|
||||||
|
_error : exit(ndErr);
|
||||||
end else case stype of
|
end else case stype of
|
||||||
_alias:
|
_alias: exit(newCat('Alias'));
|
||||||
begin
|
_class: exit(newCat('Class'));
|
||||||
result := node.FindNode('Alias');
|
_enum: exit(newCat('Enum'));
|
||||||
if result = nil then result := node.TreeNodes.AddChild(node, 'Alias');
|
_function: exit(newCat('Function'));
|
||||||
end;
|
_import: exit(newCat('Import'));
|
||||||
_class:
|
_interface: exit(newCat('Interface'));
|
||||||
begin
|
_mixin: exit(newCat('Mixin'));
|
||||||
result := node.FindNode('Class');
|
_struct: exit(newCat('Struct'));
|
||||||
if result = nil then result := node.TreeNodes.AddChild(node, 'Class');
|
_template: exit(newCat('Template'));
|
||||||
end;
|
_union: exit(newCat('Union'));
|
||||||
_enum:
|
_variable: exit(newCat('Variable'));
|
||||||
begin
|
_warning: exit(ndWarn);
|
||||||
result := node.FindNode('Enum');
|
_error: exit(ndErr);
|
||||||
if result = nil then result := node.TreeNodes.AddChild(node, 'Enum');
|
|
||||||
end;
|
|
||||||
_function:
|
|
||||||
begin
|
|
||||||
result := node.FindNode('Function');
|
|
||||||
if result = nil then result := node.TreeNodes.AddChild(node, 'Function');
|
|
||||||
end;
|
|
||||||
_import:
|
|
||||||
begin
|
|
||||||
result := node.FindNode('Import');
|
|
||||||
if result = nil then result := node.TreeNodes.AddChild(node, 'Import');
|
|
||||||
end;
|
|
||||||
_interface:
|
|
||||||
begin
|
|
||||||
result := node.FindNode('Interface');
|
|
||||||
if result = nil then result := node.TreeNodes.AddChild(node, 'Interface');
|
|
||||||
end;
|
|
||||||
_mixin:
|
|
||||||
begin
|
|
||||||
result := node.FindNode('Mixin');
|
|
||||||
if result = nil then result := node.TreeNodes.AddChild(node, 'Mixin');
|
|
||||||
end;
|
|
||||||
_struct:
|
|
||||||
begin
|
|
||||||
result := node.FindNode('Struct');
|
|
||||||
if result = nil then result := node.TreeNodes.AddChild(node, 'Struct');
|
|
||||||
end;
|
|
||||||
_template:
|
|
||||||
begin
|
|
||||||
result := node.FindNode('Template');
|
|
||||||
if result = nil then result := node.TreeNodes.AddChild(node, 'Template');
|
|
||||||
end;
|
|
||||||
_union:
|
|
||||||
begin
|
|
||||||
result := node.FindNode('Union');
|
|
||||||
if result = nil then result := node.TreeNodes.AddChild(node, 'Union');
|
|
||||||
end;
|
|
||||||
_variable:
|
|
||||||
begin
|
|
||||||
result := node.FindNode('Variable');
|
|
||||||
if result = nil then result := node.TreeNodes.AddChild(node, 'Variable');
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
//
|
//
|
||||||
|
@ -743,6 +735,13 @@ begin
|
||||||
tree.BeginUpdate;
|
tree.BeginUpdate;
|
||||||
for i := 0 to fSyms.symbols.Count-1 do
|
for i := 0 to fSyms.symbols.Count-1 do
|
||||||
symbolToTreeNode(nil, fSyms.symbols[i]);
|
symbolToTreeNode(nil, fSyms.symbols[i]);
|
||||||
|
if fAutoExpandErrors then
|
||||||
|
begin
|
||||||
|
if ndWarn.Visible then
|
||||||
|
ndWarn.Expand(true);
|
||||||
|
if ndErr.Visible then
|
||||||
|
ndErr.Expand(true);
|
||||||
|
end;
|
||||||
tree.EndUpdate;
|
tree.EndUpdate;
|
||||||
end;
|
end;
|
||||||
{$ENDREGION --------------------------------------------------------------------}
|
{$ENDREGION --------------------------------------------------------------------}
|
||||||
|
|
Loading…
Reference in New Issue