fix #90, dastworx issue under win32 + rework dastworx main()

This commit is contained in:
Basile Burg 2016-08-23 07:18:53 +02:00
parent a41fbd6271
commit e0fa57d8b6
3 changed files with 18 additions and 14 deletions

View File

@ -35,6 +35,8 @@ void main(string[] args)
version(devel)
{
mixin(logCall);
config = LexerConfig("", StringBehavior.source, WhitespaceBehavior.skip);
cache = construct!(StringCache)(StringCache.defaultBucketCount);
File f = File(__FILE__, "r");
foreach(ref buffer; f.byChunk(4096))
source.put(buffer);
@ -42,23 +44,29 @@ void main(string[] args)
}
else
{
// get the source to process.
// even when files are passed, the std input has to be closed by the IDE
foreach(ref buffer; stdin.byChunk(4096))
source.put(buffer);
if (!source.data.length)
{
files = args[1].splitter(pathSeparator).array;
version(devel) writeln(files);
}
// when files are passed, the global cache & config cant be used
else
{
config = LexerConfig("", StringBehavior.source, WhitespaceBehavior.skip);
cache = construct!(StringCache)(StringCache.defaultBucketCount);
}
}
if (args.length > 2)
{
files = args[1].splitter(pathSeparator).array;
version(devel) writeln(files);
}
config = LexerConfig("", StringBehavior.source, WhitespaceBehavior.skip);
cache = construct!(StringCache)(StringCache.defaultBucketCount);
// options for the worxs
getopt(args, std.getopt.config.passThrough,
"d", &deepSymList
);
// launch a worx directly
getopt(args, std.getopt.config.passThrough,
"i", &handleImportsOption,
"m", &handleMainfunOption,

View File

@ -50,8 +50,6 @@ begin
str := source.Text;
prc.Input.Write(str[1], str.length);
prc.CloseInput;
while prc.Running do
sleep(1);
processOutputToStrings(prc, imports);
finally
prc.free;
@ -75,8 +73,6 @@ begin
prc.ShowWindow := swoHIDE;
prc.Execute;
prc.CloseInput;
while prc.Running do
sleep(1);
processOutputToStrings(prc, results);
finally
prc.free;

View File

@ -6,7 +6,7 @@ interface
uses
Classes, SysUtils, FileUtil, ce_common, ce_writableComponent, LazFileUtils,
ghashmap, ghashset, process,
ghashmap, ghashset,
ce_dcd, ce_dialogs, ce_projutils, ce_interfaces, ce_dlang, ce_dastworx;
type