From 6f00a166c7939fa6c76eea22e43e125f04bfe3ea Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Mon, 13 Jan 2014 22:35:27 +0000 Subject: [PATCH] Fix #58 --- ctags.d | 2 +- stdx/d/parser.d | 13 +++++++------ style.d | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ctags.d b/ctags.d index 7000833..ab808b1 100644 --- a/ctags.d +++ b/ctags.d @@ -14,7 +14,7 @@ import std.stdio; import std.array; import std.conv; -void doNothing(string, size_t, size_t, string) {} +void doNothing(string, size_t, size_t, string, bool) {} void printCtags(File output, string[] fileNames) { diff --git a/stdx/d/parser.d b/stdx/d/parser.d index a9936a9..4f7b2e1 100644 --- a/stdx/d/parser.d +++ b/stdx/d/parser.d @@ -19,11 +19,12 @@ import std.string : format; * tokens = the tokens parsed by std.d.lexer * messageFunction = a function to call on error or warning messages. * The parameters are the file name, line number, column number, - * and the error or warning message. + * the error or warning message, and a boolean (true means error, false + * means warning). * Returns: the parsed module */ Module parseModule(const(Token)[] tokens, string fileName, - void function(string, size_t, size_t, string) messageFunction = null) + void function(string, size_t, size_t, string, bool) messageFunction = null) { auto parser = new Parser(); parser.fileName = fileName; @@ -5984,7 +5985,7 @@ q{doStuff(5)}c; * The parameters are the file name, line number, column number, * and the error or warning message. */ - void function(string, size_t, size_t, string) messageFunction; + void function(string, size_t, size_t, string, bool) messageFunction; bool isSliceExpression() { @@ -6278,7 +6279,7 @@ protected: if (messageFunction is null) stderr.writefln("%s(%d:%d)[warn]: %s", fileName, line, column, message); else - messageFunction(fileName, line, column, message); + messageFunction(fileName, line, column, message, false); } void error(lazy string message, bool shouldAdvance = true) @@ -6294,7 +6295,7 @@ protected: stderr.writefln("%s(%d:%d)[error]: %s", fileName, line, column, message); } else - messageFunction(fileName, line, column, message); + messageFunction(fileName, line, column, message, true); } while (shouldAdvance && moreTokens()) { @@ -6502,7 +6503,7 @@ protected: } version (unittest) static void doNothingErrorFunction(string fileName, - size_t line, size_t column, string message) {} + size_t line, size_t column, string message, bool isError) {} version (unittest) static Parser getParserForUnittest(string sourceCode, string testName) diff --git a/style.d b/style.d index 322bad6..bcfc886 100644 --- a/style.d +++ b/style.d @@ -13,7 +13,7 @@ import std.regex; import std.array; import std.conv; -void doNothing(string, size_t, size_t, string) {} +void doNothing(string, size_t, size_t, string, bool) {} void styleCheck(File output, string[] fileNames) {