changeset 405:e2529923a0cb

Added two error messages.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Sun, 23 Sep 2007 20:32:12 +0200
parents fe46b5ea7a18
children e242f0ee2d27
files trunk/src/dil/Messages.d trunk/src/dil/Parser.d trunk/src/lang_de.d trunk/src/lang_en.d trunk/src/lang_fi.d trunk/src/lang_tr.d
diffstat 6 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/dil/Messages.d	Sun Sep 23 18:42:36 2007 +0200
+++ b/trunk/src/dil/Messages.d	Sun Sep 23 20:32:12 2007 +0200
@@ -62,6 +62,8 @@
   OutContract,
   MissingLinkageType,
   UnrecognizedLinkageType,
+  ExpectedBaseClasses,
+  BaseClassInForwardDeclaration,
 
   // Help messages:
   HelpMain,
--- a/trunk/src/dil/Parser.d	Sun Sep 23 18:42:36 2007 +0200
+++ b/trunk/src/dil/Parser.d	Sun Sep 23 20:32:12 2007 +0200
@@ -860,8 +860,6 @@
       moduleFQNs ~= moduleFQN;
       moduleAliases ~= moduleAlias;
 
-      if (token.type == T.Colon)
-        break;
       if (token.type != T.Comma)
         break;
       nT();
@@ -980,8 +978,8 @@
 
     if (token.type == T.Semicolon)
     {
-      //if (bases.length != 0)
-        // TODO: Error: bases classes are not allowed in forward declarations.
+      if (bases.length != 0)
+        error(MID.BaseClassInForwardDeclaration);
       nT();
     }
     else if (token.type == T.LBrace)
@@ -1017,7 +1015,7 @@
       case T.Package:   prot = Protection.Package;   break;
       case T.Public:  /*prot = Protection.Public;*/  break;
       default:
-        // TODO: issue error msg
+        error(MID.ExpectedBaseClasses, token.srcText);
         return bases;
       }
       nT(); // Skip protection attribute.
@@ -1056,8 +1054,8 @@
 
     if (token.type == T.Semicolon)
     {
-      //if (bases.length != 0)
-        // TODO: error: base classes are not allowed in forward declarations.
+      if (bases.length != 0)
+        error(MID.BaseClassInForwardDeclaration);
       nT();
     }
     else if (token.type == T.LBrace)
--- a/trunk/src/lang_de.d	Sun Sep 23 18:42:36 2007 +0200
+++ b/trunk/src/lang_de.d	Sun Sep 23 20:32:12 2007 +0200
@@ -60,6 +60,8 @@
   "der 'out'-Vertrag der Funktion wurde bereits geparsed.",
   "es wurde kein Verbindungstyp angegeben.",
   "unbekannter Verbindungstyp '{0}'; gültig sind C, C++, D, Windows, Pascal und System.",
+  "erwartete eine oder mehrere Basisklassen, nicht '{0}'.",
+  "Basisklassen sind in Vorwärtsdeklarationen nicht erlaubt.",
 
   // Help messages:
   `dil v{0}
--- a/trunk/src/lang_en.d	Sun Sep 23 18:42:36 2007 +0200
+++ b/trunk/src/lang_en.d	Sun Sep 23 20:32:12 2007 +0200
@@ -60,6 +60,8 @@
   "the functions 'out' contract was already parsed.",
   "no linkage type was specified.",
   "unrecognized linkage type '{0}'; valid types are C, C++, D, Windows, Pascal und System.",
+  "expected one or more base classes, not '{0}'.",
+  "base classes are not allowed in forward declarations.",
 
   // Help messages:
   `dil v{0}
--- a/trunk/src/lang_fi.d	Sun Sep 23 18:42:36 2007 +0200
+++ b/trunk/src/lang_fi.d	Sun Sep 23 20:32:12 2007 +0200
@@ -60,6 +60,8 @@
   "funktion loppuehto jäsennettiin jo.",
   "linkitystyyppiä ei määritelty.",
   "tunnistamaton linkitystyyppi '{0}'; sallittuja tyyppejä ovat C, C++, D, Windows, Pascal ja System.",
+  "expected one or more base classes, not '{0}'.", // TODO: translate
+  "base classes are not allowed in forward declarations.", // TODO: translate
 
   // Help messages:
   `dil v{0}
--- a/trunk/src/lang_tr.d	Sun Sep 23 18:42:36 2007 +0200
+++ b/trunk/src/lang_tr.d	Sun Sep 23 20:32:12 2007 +0200
@@ -60,6 +60,8 @@
   "fonksiyonun 'out' kontratı daha önceden ayrıştırılmış.",
   "bağlantı tüp (linkage type) belirtilmedi.",
   "bilinmeyen bağlantı tüpü (linkage type) '{0}'; geçerli olanlar C, C++, D, Windows, Pascal ve System.",
+  "expected one or more base classes, not '{0}'.", // TODO: translate
+  "base classes are not allowed in forward declarations.", // TODO: translate
 
   // Help messages:
   `dil v{0}