From 6a1443950766700fac72bb52c611f583ab069248 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Tue, 24 Feb 2015 12:18:43 +0100 Subject: [PATCH 1/5] fix, docking options checkbox hidden --- src/ce_dockoptions.pas | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/ce_dockoptions.pas b/src/ce_dockoptions.pas index a2e085e0..f199cd8d 100644 --- a/src/ce_dockoptions.pas +++ b/src/ce_dockoptions.pas @@ -44,13 +44,6 @@ begin DragThresholdTrackBar.OnChange := @doChanged; SplitterWidthTrackBar.OnChange := @doChanged; // - FlattenHeaders.OnChange := @doChanged; - FilledHeaders.OnChange := @doChanged; - HideHeaderCaptionForFloatingCheckBox.OnChange := @doChanged; - ScaleOnResizeCheckBox.OnChange := @doChanged; - ShowHeaderCaptionCheckBox.OnChange := @doChanged; - ShowHeaderCheckBox.OnChange := @doChanged; - // HeaderStyleComboBox.OnChange:= @doChanged; // EntitiesConnector.addObserver(self); @@ -109,7 +102,11 @@ begin ' ('+IntToStr(HeaderAlignLeftTrackBar.Position) +')'; SplitterWidthLabel.Caption:=adrsSplitterWidth + ' ('+IntToStr(SplitterWidthTrackBar.Position) +')'; - ShowHeaderCheckBox.Visible:=adofShow_ShowHeader in Flags; + + FlattenHeaders.Enabled := adofShow_ShowHeader in Flags; + FilledHeaders.Enabled := adofShow_ShowHeader in Flags; + ShowHeaderCaptionCheckBox.Enabled := adofShow_ShowHeader in Flags; + HideHeaderCaptionForFloatingCheckBox.Enabled := adofShow_ShowHeader in Flags; // SaveToMaster; end; From 7daa8e93d159ab058041f901162b77e71f16c132 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Tue, 24 Feb 2015 18:32:33 +0100 Subject: [PATCH 2/5] deleted duplicated resources --- icons/other/link.png | Bin 313 -> 0 bytes icons/other/link_break.png | Bin 509 -> 0 bytes icons/other/link_edit.png | Bin 888 -> 0 bytes 3 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 icons/other/link.png delete mode 100644 icons/other/link_break.png delete mode 100644 icons/other/link_edit.png diff --git a/icons/other/link.png b/icons/other/link.png deleted file mode 100644 index 54e626d71cdc6aaf6ad355d06b7a3dbb47e36e02..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 313 zcmV-90mlA`P);fn42MRE8)OCHk zJLioRmStVPaV*P{plO=0t}78mQJ`rW5Js6=CHo+sjBd<>+)q;!1KKQg)v4N5z8Dg zL6K#d)m_pV!o1Cm` z?gn0FX5ZY)?Cvb%oUvjj#HX=fmdj--RCnjn4|o^c zpAM+r^E_I!(!TGre!tJi*X#9!s$$zVwQ7ZVtybeQJD*PC4sZ!P1BV#n8}*Qra)Oy(!@OSs28u`UZTJAbL^1gFNCCWo z)QBgJfYSEc=i}rtO>PzW6XFfvfa+v{9{~mcVMl$dHqw(U00000NkvXXu0mjf!&KnN diff --git a/icons/other/link_edit.png b/icons/other/link_edit.png deleted file mode 100644 index d8dc44f9ec742202a8d2b0530bb291f7acb12bbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 888 zcmV-;1Bd*HP)PG>HG1&kK;HKOeWxYu2rYgrzsW17#SIb&2B?`$L)Md!tw%~*5fNO& z2B-_?~*>wgollNh+IO&gTVF%qgs6vg~fr2>`J zCsB3cm_SQE)YjI{^msgZKG6@tEdJ|P$|QqnV95YoM@Prt^LkNGxUb*kbaHy5DK9oY z9xksN5+Vi1n#jOXsT3U@cc>B`B5hWHHj64C9tu8QaRiy!If#m$g7up=V%3KPh+F_( zhn)*q_}fSpOn!ipPy!rRl_O(UHZrra;B>n1=Itx2OJ0t#;c-NL_Yt0XX9P6Vfq+Q- zem`L+v$f(#8Fpsv!Kbk=&~|p?wPhH&IeTzrs0H?qHu$XLz%6Y%%+Fu6DwKza^{b5x z4!$Ic(!<2eZmJt>^&^oFb#M&Ou=8FF)hTdI-{Vhs4|2G&`Yn$YO_KT8AVNzlER{c z{fSA*$eeK&OAE7sX{&*6JqAFwlfS(90#mfzoo=cD`;iBg9X`QZ5&VKm)B4)+S>5O&`ZH@Ffv3+qA z5{ue}=7TE?JV)sCd7+;!hln4@_%bgfCV@t57_pVctgyY|e^36G00RJb%XhVvt5jG3 O0000 Date: Tue, 24 Feb 2015 18:35:41 +0100 Subject: [PATCH 3/5] several HL fixes - when folds where deactivated, regions were not scanned correctly - related: /+/ or /*/ were cinsidred as open/close pairs. --- src/ce_d2syn.pas | 71 ++++++++++++++++-------------------------------- 1 file changed, 24 insertions(+), 47 deletions(-) diff --git a/src/ce_d2syn.pas b/src/ce_d2syn.pas index 3899a6e6..8b8d5929 100644 --- a/src/ce_d2syn.pas +++ b/src/ce_d2syn.pas @@ -518,8 +518,10 @@ begin // block comments 1 if fCurrRange.rangeKinds = [] then if readDelim(reader, fTokStop, '/*') then begin - if readDelim(reader, fTokStop, '*') then fTokKind := tkDDocs - else fTokKind := tkCommt; + fTokKind := tkCommt; + if readDelim(reader, fTokStop, '*') then + if readDelim(reader, fTokStop, '/') then exit + else fTokKind := tkDDocs; if readUntil(reader, fTokStop, '*/') then exit; if fTokKind = tkDDocs then @@ -527,8 +529,7 @@ begin else fCurrRange.rangeKinds += [rkBlockCom1]; readLine(reader, fTokStop); - if fkComments1 in fFoldKinds then - StartCodeFoldBlock(nil); + StartCodeFoldBlock(nil, fkComments1 in fFoldKinds); exit; end else readerReset; if (rkBlockCom1 in fCurrRange.rangeKinds) or (rkBlockDoc1 in fCurrRange.rangeKinds) then @@ -538,8 +539,7 @@ begin if readUntil(reader, fTokStop, '*/') then begin fCurrRange.rangeKinds -= [rkBlockDoc1, rkBlockCom1]; - if fkComments1 in fFoldKinds then - EndCodeFoldBlock; + EndCodeFoldBlock(fkComments1 in fFoldKinds ); exit; end; readLine(reader, fTokStop); @@ -549,19 +549,18 @@ begin // block comments 2 if fCurrRange.rangeKinds = [] then if readDelim(reader, fTokStop, '/+') then begin + fTokKind := tkCommt; + if readDelim(reader, fTokStop, '+') then + if readDelim(reader, fTokStop, '/') then exit + else fTokKind := tkDDocs; + if readUntil(reader, fTokStop, '+/') then exit; inc(fCurrRange.nestedCommentsCount); - if readDelim(reader, fTokStop, '+') then fTokKind := tkDDocs - else fTokKind := tkCommt; - if readUntil(reader, fTokStop, '+/') then - begin - dec(fCurrRange.nestedCommentsCount); - exit; - end; - if fTokKind = tkDDocs then fCurrRange.rangeKinds += [rkBlockDoc2] - else fCurrRange.rangeKinds += [rkBlockCom2]; + if fTokKind = tkDDocs then + fCurrRange.rangeKinds += [rkBlockDoc2] + else + fCurrRange.rangeKinds += [rkBlockCom2]; readLine(reader, fTokStop); - if fkComments2 in fFoldKinds then - StartCodeFoldBlock(nil); + StartCodeFoldBlock(nil, fkComments2 in fFoldKinds); exit; end else readerReset; if (rkBlockCom2 in fCurrRange.rangeKinds) or (rkBlockDoc2 in fCurrRange.rangeKinds) then @@ -577,8 +576,7 @@ begin if fCurrRange.nestedCommentsCount <> 0 then exit; fCurrRange.rangeKinds -= [rkBlockDoc2, rkBlockCom2]; - if fkComments2 in fFoldKinds then - EndCodeFoldBlock; + EndCodeFoldBlock(fkComments2 in fFoldKinds); exit; end; readLine(reader, fTokStop); @@ -618,8 +616,7 @@ begin end; end; fCurrRange.rangeKinds += [rkString1]; - if fkStrings in fFoldKinds then - StartCodeFoldBlock(nil); + StartCodeFoldBlock(nil, fkStrings in fFoldKinds); exit; end else _postString1: readerReset; if rkString1 in fCurrRange.rangeKinds then @@ -640,8 +637,7 @@ begin fCurrRange.rangeKinds -= [rkString1]; readDelim(reader, fTokStop, stringPostfixes); fCurrRange.rString := false; - if fkStrings in fFoldKinds then - EndCodeFoldBlock(); + EndCodeFoldBlock(fkStrings in fFoldKinds); exit; end else break; @@ -661,8 +657,7 @@ begin end; fCurrRange.rangeKinds += [rkString2]; readLine(reader, fTokStop); - if fkStrings in fFoldKinds then - StartCodeFoldBlock(nil); + StartCodeFoldBlock(nil, fkStrings in fFoldKinds); exit; end else readerReset; if rkString2 in fCurrRange.rangeKinds then @@ -671,8 +666,7 @@ begin if readUntil(reader, fTokStop, '`') then begin fCurrRange.rangeKinds -= [rkString2]; - if fkStrings in fFoldKinds then - EndCodeFoldBlock(); + EndCodeFoldBlock(fkStrings in fFoldKinds); readDelim(reader, fTokStop, stringPostfixes); exit; end; @@ -686,8 +680,7 @@ begin fTokKind := tkIdent; inc(fCurrRange.tokenStringBracketsCount); fCurrRange.rangeKinds += [rkTokString]; - if (fkBrackets in fFoldKinds) then - StartCodeFoldBlock(nil); + StartCodeFoldBlock(nil, fkBrackets in fFoldKinds); exit; end else readerReset; @@ -712,21 +705,6 @@ begin exit; end else readerReset; - // hex litterals - {if readDelim(reader, fTokStop, '0x') then - begin - readWhile(reader, fTokStop, hexaChars); - if not tryReadDelim(reader, fTokStop, 'Lu') then - if not tryReadDelim(reader, fTokStop, 'LU') then - if not tryReadDelim(reader, fTokStop, 'uL') then - if not tryReadDelim(reader, fTokStop, 'UL') then - if not tryReadDelim(reader, fTokStop, 'L') then - if not tryReadDelim(reader, fTokStop, 'u') then - tryReadDelim(reader, fTokStop, 'U'); - fTokKind := tkNumbr; - exit; - end else readerReset;} - // numbers 1 if (isNumber(reader^)) then begin @@ -740,11 +718,10 @@ begin begin fTokKind := tkSymbl; case reader^ of - '{': if (fkBrackets in fFoldKinds) then StartCodeFoldBlock(nil); + '{': StartCodeFoldBlock(nil,fkBrackets in fFoldKinds); '}': begin - if (fkBrackets in fFoldKinds) then - EndCodeFoldBlock; + EndCodeFoldBlock(fkBrackets in fFoldKinds); if (reader^ = '}') and (rkAsm in fCurrRange.rangeKinds) then fCurrRange.rangeKinds -= [rkAsm]; ; if (rkTokString in fCurrRange.rangeKinds) then From 54467da8177cb10077654125ce3b683a73645315 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Tue, 24 Feb 2015 18:36:01 +0100 Subject: [PATCH 4/5] clean up --- src/ce_icons.inc | 74 --------------------------------------------- src/ce_todolist.pas | 2 +- 2 files changed, 1 insertion(+), 75 deletions(-) diff --git a/src/ce_icons.inc b/src/ce_icons.inc index 2640a69b..383a0254 100644 --- a/src/ce_icons.inc +++ b/src/ce_icons.inc @@ -1316,80 +1316,6 @@ LazarusResources.Add('keyboard_pencil','PNG',[ +#140#227'2'#217#189'['#210'K'#229'8v'#158#165#236#7#170'&'#25#255'u'#127#254 +#8'0'#0#204#231'b U<'#159'Q'#0#0#0#0'IEND'#174'B`'#130 ]); -LazarusResources.Add('link','PNG',[ - #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a' - +#0#0#0#25'tEXtSoftware'#0'Adobe ImageReadyq'#201'e<'#0#0#0#219'IDATx'#218#236 - +#147'='#11#131'@'#12#134#147'z'#139#160#127#207'I\'#156#236#164#139#142#226 - +#168'88Huq'#17''''#127#156#224#7#8#130#156#189#208#131#182'h;'#184#149'f'#184 - +#4#158'7'#31#228#238#144's'#14'g'#236#2''''#237#7#10'0q'#212'u}'#187';'#231 - +#141#21#150'e]'#191'q,'#203#146#160'i'#154#176#174'+'#17'EQ'#160'i'#26#18'=' - +#196#135#28#211'4'#229#182'mCUU'#4'5M'#3'UUw'#199#157#231#25#166'i'#162'X' - +#230#176'a'#24#160#235':'#16'>'#138'"'#140#227#152'?w'#147'&'#186#230'y'#14 - +'A'#16'`'#24#134'\'#230#176#190#239#169#170#240#174#235#242'eY'#192#243#188 - +#253#133'1F'#26#17#203#28'1A'#145'e'#153#227#251'>'#232#186'N'#194'q'#28'!I' - +#146#151#29#28'q'#20'O'#217'0'#140#221'-'#183'mK'#183#240#137#227#255'/'#192 - +'&'#192#0'd'#173#130';*'#219#202#230#0#0#0#0'IEND'#174'B`'#130 -]); -LazarusResources.Add('link_break','PNG',[ - #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a' - +#0#0#0#25'tEXtSoftware'#0'Adobe ImageReadyq'#201'e<'#0#0#1#159'IDATx'#218'|S' - +'=K'#3'A'#16#221'|`'#170#211#24'L'#254#132#141'U~'#128'`'#165'XD'#184'J'#175 - +#137#10'w('#4#14#210#134'TB'#4'9,r'#9'zM'#16#145#128#141#4#180#17',l-'#5#127 - +#131'J4'#151#131#152'B'#214'7'#155#156#172'k'#238#6'^ff'#223#220#203#236#238 - +','#227#156#179'('#244#10#218'~'#28'OH'#178#169']'#23#230'S'#192#3#176#18#174 - +'}q'#214#150#248'"pOuL'#178'_'#129#173'W'#255'{'#196#147''''#192#237'E>+D'#16 - +#11#14'y'#17'q'#15'8'#166':Y Am'#200'v'#182#180#184#9#231#0#203'So'#3'/'#192 - +#238#222#251#199#29'Sm'#214#190'Ns'#217#156#146'/D'#157#129#232#160#211#233 - +'4'#161'e*'#218#174'a'#24'V'#28''''#162'V'#171#213#4'x'#16#4'|0'#24#8'PLk$' - +#30#197#209'w'#196#167#177'`'#150#203'e*Tw'#231#210#15'x'#23#220#159#14#168 - +#222#243''#207'y'#158#247#188#135#211#233#251 - +#241#191#143#227'8H$'#18'X,'#22#181#201'd. '#129#0#252#162#136#164'E'#139#26 - +#204#3#3#5'<'#207'C'#242#183#152#16#18#4'L&'#224'y'#174'U'#167#211#167')'#21 - +#197#24#25#25#133#205'nC{'#199#237'|J'#194#242#5'!'#2#198#22#17#17#17'\'#195 - +#8#234#155#155'['#210'*'#202#203'p'#162#178#6'D'#244'V'#219#29#206'C'#169#169 - +#169#184#223#213#149'O'#235#127#19#176#147#24#184#173'M'#27#148#204'1'#18#170 - +'H'#20#197#252'R'#165#2#149#213'''Qu'#226#152'@K?'#212#214#214#206#244'x' - +#209#15#194','#254#235'W'#202'$'#131'i`'#201#0']GG'#199#224#243'zQP'#184#175 - +#223#229'trz'#163')/6>'#30'.'#175#27#18'"'#5#199#154#200#192'R'#169#20#29#29 - +'w'#168#18#30'"mV'#128'6'#139'* '#30#10'>^q'#4#153#217'9'#136#138#158#130#245 - +#155'6b'#213#135#4#136'\'#0'^'#135#157#11'Y'#248#219'H'#22'L~'#128#146'P'#2 - +#28'W'#149'#cW62'#179#178#224't'#186#240#230#237'+'#172'K^'#142#177#225'qD}' - +#247#17#158'yg'#4'4'#212#129#128'H'#252'~?a'''#179#181#226'H'#25'vf'#237#193 - +#167#177'/'#208'vv'#227#181'e'#24#185'9{pe'#168#5#246#143'6'#248#172#227#192 - +'-m;'#204#207'_'#180'*'#148#135#136#245#171#141#12#14#190'$'#138#210#195#196 - +#237'v'#147'm;'#210#169#28#200'X'#152'UK'#200#196#219'N'#162#170'9G'#186#31 - +'>&'#251#202'J'#131'9'#238#206#221#174#182#158#158'^yI'#241'~'#168#235'/'#128 - +#2#177'n'#237#26'h'#154'.cx'#228'3'#174'nqp'#14#143#132#8#155'b'#128#247#175 - +'0'#20#185#27#141'}>'#156#169':*'#24#247'6'#25'x'#221'3'#189'\'#169'(A'#157 - +#186#17#170#242'2'#193#225#152'@'#211#165'+H'#167#190#23'$'#11'pyx"l'#158'I/' - +'p'#20'p'#184#240#236#129'6'#8'.V'#149#27'h'#247#192#179'n'#179#9#251#233'v' - +#214'4_'#187'fhP'#159#23'f'#207#141#135'}'#194#7'E'#236'=,'#219'0'#13'x7L' - +#193'_'#161'1-'#196#174':'#163#160#172#168'2'#132#6#208'K'#175#201'j'#179'B' - +#18#25'EM'#145#146#194#162#131#253#137'I'#201#200#156'q'#22'K'#11#179#129'i' - +#171#129'o'#227#208#24#231'#'#247#252'S'#225#230#1#193#128#176#137#231'e2' - +#153#246'z'#235#13#164#164#164' zj'#204#169#149'+W'#161#175#183#7'7'#204'q' - +#232'~'#228#162'*c'#254#128#159#8'-'#197#203#13#147#158'K'#144'+'#225#162#230 - +#242'i'#157#174'O'#206'~'#248#253'"f'#197#205#233#140'v'#14'm'#141#244'9'#177 - +'}q'#20#18#139#218#133#230#131'+'#12' Date: Tue, 24 Feb 2015 18:38:35 +0100 Subject: [PATCH 5/5] static explorer might use libdparse instead of using dmd json. dmd compiles the whole thing while we only need the ast. --- ceast/ceast.d | 205 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 ceast/ceast.d diff --git a/ceast/ceast.d b/ceast/ceast.d new file mode 100644 index 00000000..76976c03 --- /dev/null +++ b/ceast/ceast.d @@ -0,0 +1,205 @@ +module runnable; + +import std.path, std.file; +import std.stdio; +import std.d.lexer; +import std.d.ast; +import std.d.parser; + + +interface I{} + +class A +{ + class AA + { + class AA1{} + class AA2{} + } + + class BB + { + class BB1{} + class BB2{} + } +} + +enum SymbolType +{ + _alias, + _class, // X + _enum, // X + _function, // X + _interface, // X + _import, + _mixin, + _struct, // X + _template, // X + _union, // X + _variable +} + +struct Symbol +{ + uint line; + uint col; + string name; + SymbolType type; + Symbol * [] subs; +} + +void main(string[] args) +{ + if (args.length < 2) return; + auto fname = args[1]; + if (!fname.exists) return; + + // load and parse the file + auto config = LexerConfig(fname, StringBehavior.source, WhitespaceBehavior.include); + auto source = cast(ubyte[]) read(fname, size_t.max); + auto scache = StringCache(StringCache.defaultBucketCount); + auto ast = parseModule(getTokensForParser(source, config, &scache), fname); + + // visit each root member + auto slb = new SymbolListBuilder; + foreach(Declaration decl; ast.declarations) + { + slb.resetRoot; + slb.visit(decl); + } + + int level = -1; + void print(Symbol * s) + { + + foreach(i; 0..level) write("."); + level++; + write(s.name, '\r'); + foreach(ss; s.subs) + print(ss); + + level--; + } + + print(&slb.root); + writeln(); + +} + +class SymbolListBuilder : ASTVisitor +{ + Symbol root; + Symbol * parent; + + alias visit = ASTVisitor.visit; + + this(){resetRoot;} + + void resetRoot(){parent = &root;} + + /// returns a new symbol if the declarator is based on a Token named "name". + Symbol * addDeclaration(DT)(DT adt) + { + static if + ( + is(DT == const(ClassDeclaration)) || + is(DT == const(Declarator)) || + is(DT == const(EnumDeclaration)) || + is(DT == const(FunctionDeclaration)) || + is(DT == const(InterfaceDeclaration)) || + is(DT == const(StructDeclaration)) || + is(DT == const(TemplateDeclaration)) || + is(DT == const(UnionDeclaration)) + + ) + { + auto result = new Symbol; + result.name = adt.name.text; + result.line = adt.name.line; + result.col = adt.name.column; + parent.subs ~= result; + return result; + } + + assert(0, "addDeclaration no implemented for " ~ DT.stringof); + } + + /// visitor implementation if the declarator is based on a Token named "name". + void namedVisitorImpl(DT, SymbolType st, bool dig = true)(const(DT) dt) + { + auto newSymbol = addDeclaration(dt); + newSymbol.type = st; + // + auto previousParent = parent; + parent = newSymbol; + static if (dig) dt.accept(this); + parent = previousParent; + } + + + + final override void visit(const AliasDeclaration aliasDeclaration) + { + // IdentifierList + } + + final override void visit(const ClassDeclaration decl) + { + namedVisitorImpl!(ClassDeclaration, SymbolType._class)(decl); + } + + final override void visit(const EnumDeclaration decl) + { + namedVisitorImpl!(EnumDeclaration, SymbolType._class)(decl); + } + + final override void visit(const FunctionDeclaration decl) + { + namedVisitorImpl!(FunctionDeclaration, SymbolType._function)(decl); + } + + final override void visit(const InterfaceDeclaration decl) + { + namedVisitorImpl!(InterfaceDeclaration, SymbolType._interface)(decl); + } + + final override void visit(const ImportDeclaration decl) + { + // singlesImp[] + + // singleImport.identifierchain.join + + import std.array; + foreach(const(SingleImport) si; decl.singleImports) + + writeln( si.identifierChain.identifiers[0].text ); + } + + final override void visit(const MixinDeclaration decl) + { + // identifier + } + + final override void visit(const StructDeclaration decl) + { + namedVisitorImpl!(StructDeclaration, SymbolType._struct)(decl); + } + + final override void visit(const TemplateDeclaration decl) + { + namedVisitorImpl!(TemplateDeclaration, SymbolType._function)(decl); + } + + final override void visit(const UnionDeclaration decl) + { + namedVisitorImpl!(UnionDeclaration, SymbolType._function)(decl); + } + + final override void visit(const VariableDeclaration decl) + { + foreach(elem; decl.declarators) + namedVisitorImpl!(Declarator, SymbolType._variable, false)(elem); + } +} + +