diff --git a/cesyms/cesyms.d b/cesyms/cesyms.d index 5bdb477b..e4a16f01 100644 --- a/cesyms/cesyms.d +++ b/cesyms/cesyms.d @@ -6,19 +6,28 @@ import std.traits; void main(string[] args) { - if (args.length < 2) return; - auto fname = args[1]; - if (!fname.exists) return; + // get either the module from stdin or from first arg + string fname; + ubyte[] source; + if (args.length == 1) + { + source.length = cast(size_t)stdin.size; + source = stdin.rawRead(source); + } + else + { + fname = args[1]; + if (!fname.exists) return; + source = cast(ubyte[]) read(fname, size_t.max); + } // load and parse the file auto config = LexerConfig(fname, StringBehavior.source, WhitespaceBehavior.skip); - auto source = cast(ubyte[]) read(fname, size_t.max); auto scache = StringCache(StringCache.defaultBucketCount); - auto ast = parseModule(getTokensForParser(source, config, &scache), fname, null, &(SymbolListBuilder.astError)); // visit each root member - auto slb = construct!SymbolListBuilder; + SymbolListBuilder slb = construct!SymbolListBuilder; foreach(Declaration decl; ast.declarations) { slb.resetRoot; diff --git a/src/ce_symlist.lfm b/src/ce_symlist.lfm index aae9e839..d397d870 100644 --- a/src/ce_symlist.lfm +++ b/src/ce_symlist.lfm @@ -24,6 +24,7 @@ inherited CESymbolListWidget: TCESymbolListWidget Width = 302 Align = alClient BorderSpacing.Around = 4 + DefaultItemHeight = 18 HideSelection = False Images = imgList ReadOnly = True diff --git a/src/ce_symlist.pas b/src/ce_symlist.pas index f10be381..7ee9439f 100644 --- a/src/ce_symlist.pas +++ b/src/ce_symlist.pas @@ -652,14 +652,13 @@ end; procedure TCESymbolListWidget.callToolProc; var - srcFname: string; + str: string; begin if not fHasToolExe then exit; if fDoc = nil then exit; if fDoc.Lines.Count = 0 then exit; if not fDoc.isDSource then exit; - - // standard process options + // killProcess(fToolProc); fToolProc := TCEProcess.Create(nil); fToolProc.ShowWindow := swoHIDE; @@ -667,15 +666,10 @@ begin fToolProc.Executable := exeFullName(toolExeName); fToolProc.OnTerminate := @toolTerminated; fToolProc.CurrentDirectory := ExtractFileDir(Application.ExeName); - - // focused source - srcFname := fDoc.fileName; - if not fileExists(srcFname) or (srcFname = fDoc.tempFilename) then - fDoc.saveTempFile; - srcFname := fDoc.fileName; - fToolProc.Parameters.Add(srcFname); - fToolProc.Execute; + str := fDoc.Text; + fToolProc.Input.Write(str[1], length(str)); + fToolProc.CloseInput; end; procedure TCESymbolListWidget.toolTerminated(sender: TObject);