diff --git a/stdx/d/parser.d b/stdx/d/parser.d index 493cf3e..974a065 100644 --- a/stdx/d/parser.d +++ b/stdx/d/parser.d @@ -1599,11 +1599,20 @@ class ClassFour(A, B) if (someTest()) : Super {}}c; break; } if (currentIs(TokenType.colon)) + { node.attributeDeclaration = parseAttributeDeclaration(attr); + break; + } else node.attributes ~= attr; } while (moreTokens()); + if (!moreTokens) + { + error("Declaration expected"); + return null; + } + with (TokenType) switch (current.type) { case semicolon: @@ -6247,11 +6256,12 @@ private: if (suppressMessages <= 0) { ++errorCount; - auto column = index < tokens.length ? tokens[index].column : 0; - column++; - auto line = index < tokens.length ? tokens[index].line : 0; + auto column = index < tokens.length ? tokens[index].column : tokens[$ - 1].column; + auto line = index < tokens.length ? tokens[index].line : tokens[$ - 1].line; if (messageFunction is null) + { writefln("%s(%d:%d)[error]: %s", fileName, line, column, message); + } else messageFunction(fileName, line, column, message); }