diff trunk/src/dil/Messages.d @ 798:c24be8d4f6ab

Added documentation comments.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Sat, 01 Mar 2008 02:53:06 +0100
parents c1d5cfd7aa44
children cb8040538772
line wrap: on
line diff
--- a/trunk/src/dil/Messages.d	Fri Feb 29 22:51:24 2008 +0100
+++ b/trunk/src/dil/Messages.d	Sat Mar 01 02:53:06 2008 +0100
@@ -3,9 +3,10 @@
   License: GPL3
 +/
 module dil.Messages;
+
 import common;
 
-/// Index into table of compiler messages.
+/// Enumeration of indices into the table of compiler messages.
 enum MID
 {
   // Lexer messages:
@@ -72,25 +73,29 @@
   HelpImportGraph,
 }
 
-private string[] messages;
+/// The table of compiler messages.
+private string[] g_compilerMessages;
 
 static this()
 {
-  messages = new string[MID.max+1];
+  g_compilerMessages = new string[MID.max+1];
 }
 
+/// Sets the compiler messages.
 void SetMessages(string[] msgs)
 {
   assert(MID.max+1 == msgs.length);
-  messages = msgs;
+  g_compilerMessages = msgs;
 }
 
+/// Returns the compiler message for mid.
 string GetMsg(MID mid)
 {
-  assert(mid < messages.length);
-  return messages[mid];
+  assert(mid < g_compilerMessages.length);
+  return g_compilerMessages[mid];
 }
 
+/// Returns a formatted string.
 char[] FormatMsg(MID mid, ...)
 {
   return Format(_arguments, _argptr, GetMsg(mid));