diff --git a/dsymbol b/dsymbol index d22c971..6920a04 160000 --- a/dsymbol +++ b/dsymbol @@ -1 +1 @@ -Subproject commit d22c9714a60ac05cb32db938e81a396cffb5ffa6 +Subproject commit 6920a0489fbef44f105cdfb76d426a03ae14259a diff --git a/dub.json b/dub.json index e24801b..673a4f0 100644 --- a/dub.json +++ b/dub.json @@ -12,8 +12,8 @@ "StdLoggerDisableWarning" ], "dependencies" : { - "libdparse" : "~>0.7.1-beta.6", - "dsymbol" : "~>0.2.0", + "libdparse" : "~>0.7.1-beta.7", + "dsymbol" : "~>0.2.6", "inifiled" : ">=1.0.2", "emsi_containers" : "~>0.5.3", "libddoc" : "~>0.2.0" diff --git a/libdparse b/libdparse index 454a95a..4229f11 160000 --- a/libdparse +++ b/libdparse @@ -1 +1 @@ -Subproject commit 454a95abb2ac7093f1526f262d4a712730dd9ac3 +Subproject commit 4229f11828a901ea5379409015f14a033e742906 diff --git a/src/analysis/run.d b/src/analysis/run.d index 16f7e67..a8244fb 100644 --- a/src/analysis/run.d +++ b/src/analysis/run.d @@ -11,6 +11,7 @@ import std.conv; import std.algorithm; import std.range; import std.array; +import std.functional : toDelegate; import dparse.lexer; import dparse.parser; import dparse.ast; @@ -202,8 +203,9 @@ const(Module) parseModule(string fileName, ubyte[] code, RollbackAllocator* p, tokens = getTokensForParser(code, config, &cache); if (linesOfCode !is null) (*linesOfCode) += count!(a => isLineOfCode(a.type))(tokens); - return dparse.parser.parseModule(tokens, fileName, p, report - ? &messageFunctionJSON : &messageFunction, errorCount, warningCount); + return dparse.parser.parseModule(tokens, fileName, p, + report ? toDelegate(&messageFunctionJSON) : toDelegate(&messageFunction), + errorCount, warningCount); } /** diff --git a/src/ctags.d b/src/ctags.d index c4c76e8..939724a 100644 --- a/src/ctags.d +++ b/src/ctags.d @@ -17,6 +17,7 @@ import std.conv; import std.typecons; import containers.ttree; import std.string; +import std.functional : toDelegate; /** * Prints CTAGS information to the given file. @@ -65,7 +66,7 @@ void printCtags(File output, string[] fileNames) } auto tokens = getTokensForParser(bytes, config, &cache); - Module m = parseModule(tokens.array, fileName, &rba, &doNothing); + Module m = parseModule(tokens.array, fileName, &rba, toDelegate(&doNothing)); auto printer = new CTagsPrinter(&tags); printer.fileName = fileName; diff --git a/src/etags.d b/src/etags.d index a89ce6c..a072632 100644 --- a/src/etags.d +++ b/src/etags.d @@ -17,6 +17,7 @@ import std.path; import std.array; import std.conv; import std.string; +import std.functional : toDelegate; // Prefix tags with their module name. Seems like correct behavior, but just // in case, make it an option. @@ -48,7 +49,7 @@ void printEtags(File output, bool tagAll, string[] fileNames) auto bytes = uninitializedArray!(ubyte[])(to!size_t(f.size)); f.rawRead(bytes); auto tokens = getTokensForParser(bytes, config, &cache); - Module m = parseModule(tokens.array, fileName, &rba, &doNothing); + Module m = parseModule(tokens.array, fileName, &rba, toDelegate(&doNothing)); auto printer = new EtagsPrinter; printer.moduleName = m.moduleFullName(fileName); diff --git a/src/imports.d b/src/imports.d index 392ebe4..6389608 100644 --- a/src/imports.d +++ b/src/imports.d @@ -11,6 +11,7 @@ import dparse.parser; import dparse.rollback_allocator; import std.stdio; import std.container.rbtree; +import std.functional : toDelegate; import readers; /** @@ -63,7 +64,7 @@ private void visitFile(bool usingStdin, string fileName, RedBlackTree!string imp config.stringBehavior = StringBehavior.source; auto visitor = new ImportPrinter; auto tokens = getTokensForParser(usingStdin ? readStdin() : readFile(fileName), config, cache); - auto mod = parseModule(tokens, fileName, &rba, &doNothing); + auto mod = parseModule(tokens, fileName, &rba, toDelegate(&doNothing)); visitor.visit(mod); importedModules.insert(visitor.imports[]); } diff --git a/src/main.d b/src/main.d index 6b0a9b0..8f87c4a 100644 --- a/src/main.d +++ b/src/main.d @@ -15,6 +15,7 @@ import std.stdio; import std.range; import std.experimental.lexer; import std.typecons : scoped; +import std.functional : toDelegate; import dparse.lexer; import dparse.parser; import dparse.rollback_allocator; @@ -283,7 +284,7 @@ else config.stringBehavior = StringBehavior.source; auto tokens = getTokensForParser(usingStdin ? readStdin() : readFile(args[1]), config, &cache); - auto mod = parseModule(tokens, fileName, &rba, &doNothing); + auto mod = parseModule(tokens, fileName, &rba, toDelegate(&doNothing)); if (ast) { diff --git a/src/symbol_finder.d b/src/symbol_finder.d index baf63da..67cc6f3 100644 --- a/src/symbol_finder.d +++ b/src/symbol_finder.d @@ -12,6 +12,7 @@ import dparse.ast; import dparse.rollback_allocator; import std.stdio; import std.file : isFile; +import std.functional : toDelegate; void findDeclarationOf(File output, string symbolName, string[] fileNames) { @@ -31,7 +32,7 @@ void findDeclarationOf(File output, string symbolName, string[] fileNames) f.rawRead(bytes); auto tokens = getTokensForParser(bytes, config, &cache); RollbackAllocator rba; - Module m = parseModule(tokens.array, fileName, &rba, &doNothing); + Module m = parseModule(tokens.array, fileName, &rba, toDelegate(&doNothing)); visitor.fileName = fileName; visitor.visit(m); }