fix deprecations messages related to message function (#503)

* fix deprecations messages related to message function

* update dsymbol as a git submodule too
This commit is contained in:
Basile Burg 2017-07-27 12:16:52 +02:00 committed by GitHub
parent 0b064a000e
commit 7ee23b3d73
9 changed files with 18 additions and 11 deletions

@ -1 +1 @@
Subproject commit d22c9714a60ac05cb32db938e81a396cffb5ffa6 Subproject commit 6920a0489fbef44f105cdfb76d426a03ae14259a

View File

@ -12,8 +12,8 @@
"StdLoggerDisableWarning" "StdLoggerDisableWarning"
], ],
"dependencies" : { "dependencies" : {
"libdparse" : "~>0.7.1-beta.6", "libdparse" : "~>0.7.1-beta.7",
"dsymbol" : "~>0.2.0", "dsymbol" : "~>0.2.6",
"inifiled" : ">=1.0.2", "inifiled" : ">=1.0.2",
"emsi_containers" : "~>0.5.3", "emsi_containers" : "~>0.5.3",
"libddoc" : "~>0.2.0" "libddoc" : "~>0.2.0"

@ -1 +1 @@
Subproject commit 454a95abb2ac7093f1526f262d4a712730dd9ac3 Subproject commit 4229f11828a901ea5379409015f14a033e742906

View File

@ -11,6 +11,7 @@ import std.conv;
import std.algorithm; import std.algorithm;
import std.range; import std.range;
import std.array; import std.array;
import std.functional : toDelegate;
import dparse.lexer; import dparse.lexer;
import dparse.parser; import dparse.parser;
import dparse.ast; import dparse.ast;
@ -202,8 +203,9 @@ const(Module) parseModule(string fileName, ubyte[] code, RollbackAllocator* p,
tokens = getTokensForParser(code, config, &cache); tokens = getTokensForParser(code, config, &cache);
if (linesOfCode !is null) if (linesOfCode !is null)
(*linesOfCode) += count!(a => isLineOfCode(a.type))(tokens); (*linesOfCode) += count!(a => isLineOfCode(a.type))(tokens);
return dparse.parser.parseModule(tokens, fileName, p, report return dparse.parser.parseModule(tokens, fileName, p,
? &messageFunctionJSON : &messageFunction, errorCount, warningCount); report ? toDelegate(&messageFunctionJSON) : toDelegate(&messageFunction),
errorCount, warningCount);
} }
/** /**

View File

@ -17,6 +17,7 @@ import std.conv;
import std.typecons; import std.typecons;
import containers.ttree; import containers.ttree;
import std.string; import std.string;
import std.functional : toDelegate;
/** /**
* Prints CTAGS information to the given file. * Prints CTAGS information to the given file.
@ -65,7 +66,7 @@ void printCtags(File output, string[] fileNames)
} }
auto tokens = getTokensForParser(bytes, config, &cache); 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); auto printer = new CTagsPrinter(&tags);
printer.fileName = fileName; printer.fileName = fileName;

View File

@ -17,6 +17,7 @@ import std.path;
import std.array; import std.array;
import std.conv; import std.conv;
import std.string; import std.string;
import std.functional : toDelegate;
// Prefix tags with their module name. Seems like correct behavior, but just // Prefix tags with their module name. Seems like correct behavior, but just
// in case, make it an option. // 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)); auto bytes = uninitializedArray!(ubyte[])(to!size_t(f.size));
f.rawRead(bytes); f.rawRead(bytes);
auto tokens = getTokensForParser(bytes, config, &cache); 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; auto printer = new EtagsPrinter;
printer.moduleName = m.moduleFullName(fileName); printer.moduleName = m.moduleFullName(fileName);

View File

@ -11,6 +11,7 @@ import dparse.parser;
import dparse.rollback_allocator; import dparse.rollback_allocator;
import std.stdio; import std.stdio;
import std.container.rbtree; import std.container.rbtree;
import std.functional : toDelegate;
import readers; import readers;
/** /**
@ -63,7 +64,7 @@ private void visitFile(bool usingStdin, string fileName, RedBlackTree!string imp
config.stringBehavior = StringBehavior.source; config.stringBehavior = StringBehavior.source;
auto visitor = new ImportPrinter; auto visitor = new ImportPrinter;
auto tokens = getTokensForParser(usingStdin ? readStdin() : readFile(fileName), config, cache); 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); visitor.visit(mod);
importedModules.insert(visitor.imports[]); importedModules.insert(visitor.imports[]);
} }

View File

@ -15,6 +15,7 @@ import std.stdio;
import std.range; import std.range;
import std.experimental.lexer; import std.experimental.lexer;
import std.typecons : scoped; import std.typecons : scoped;
import std.functional : toDelegate;
import dparse.lexer; import dparse.lexer;
import dparse.parser; import dparse.parser;
import dparse.rollback_allocator; import dparse.rollback_allocator;
@ -283,7 +284,7 @@ else
config.stringBehavior = StringBehavior.source; config.stringBehavior = StringBehavior.source;
auto tokens = getTokensForParser(usingStdin ? readStdin() auto tokens = getTokensForParser(usingStdin ? readStdin()
: readFile(args[1]), config, &cache); : readFile(args[1]), config, &cache);
auto mod = parseModule(tokens, fileName, &rba, &doNothing); auto mod = parseModule(tokens, fileName, &rba, toDelegate(&doNothing));
if (ast) if (ast)
{ {

View File

@ -12,6 +12,7 @@ import dparse.ast;
import dparse.rollback_allocator; import dparse.rollback_allocator;
import std.stdio; import std.stdio;
import std.file : isFile; import std.file : isFile;
import std.functional : toDelegate;
void findDeclarationOf(File output, string symbolName, string[] fileNames) void findDeclarationOf(File output, string symbolName, string[] fileNames)
{ {
@ -31,7 +32,7 @@ void findDeclarationOf(File output, string symbolName, string[] fileNames)
f.rawRead(bytes); f.rawRead(bytes);
auto tokens = getTokensForParser(bytes, config, &cache); auto tokens = getTokensForParser(bytes, config, &cache);
RollbackAllocator rba; RollbackAllocator rba;
Module m = parseModule(tokens.array, fileName, &rba, &doNothing); Module m = parseModule(tokens.array, fileName, &rba, toDelegate(&doNothing));
visitor.fileName = fileName; visitor.fileName = fileName;
visitor.visit(m); visitor.visit(m);
} }