dastworx, prevent analysis of modules without module declaration

This commit is contained in:
Basile Burg 2016-10-18 03:16:37 +02:00
parent 4ceca1b9eb
commit 465ea9d267
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
1 changed files with 15 additions and 7 deletions

View File

@ -28,9 +28,13 @@ in
body body
{ {
mixin(logCall); mixin(logCall);
writeln('"', mod.moduleDeclaration.moduleName.identifiers auto rng = mod.moduleDeclaration.moduleName.identifiers
.map!(a => a.text).join("."), '"'); .map!(a => a.text).join(".");
construct!(ImportLister).visit(mod); if (!rng.empty)
{
writeln('"', rng, '"');
construct!(ImportLister).visit(mod);
}
} }
/** /**
@ -54,10 +58,14 @@ void listFilesImports(string[] files)
ubyte[] source = cast(ubyte[]) std.file.read(fname); ubyte[] source = cast(ubyte[]) std.file.read(fname);
Module mod = parseModule(getTokensForParser(source, config, &cache), Module mod = parseModule(getTokensForParser(source, config, &cache),
fname, &allocator, &ignoreErrors); fname, &allocator, &ignoreErrors);
writeln('"', mod.moduleDeclaration.moduleName.identifiers auto rng = mod.moduleDeclaration.moduleName.identifiers
.map!(a => a.text).join("."), '"'); .map!(a => a.text).join(".");
il.visit(mod); if (!rng.empty)
stdout.flush; {
writeln('"', rng, '"');
il.visit(mod);
stdout.flush;
}
} }
} }