# HG changeset patch # User Aziz K?ksal # Date 1190197211 -7200 # Node ID 6440da4adb07d97ca1c7bed2cd3a3c7a4e416ec7 # Parent fce1e6133dac8d06cfed042521c77f1a324c1772 Fixed forward references of enum MID complaints by compiler. Fix in cmd.Generate: token whitespace mustn't be printed in printToken(). diff -r fce1e6133dac -r 6440da4adb07 trunk/src/cmd/Generate.d --- a/trunk/src/cmd/Generate.d Mon Sep 17 21:57:11 2007 +0200 +++ b/trunk/src/cmd/Generate.d Wed Sep 19 12:20:11 2007 +0200 @@ -333,6 +333,10 @@ { token = token.next; + // Print whitespace. + if (token.ws) + print(token.ws[0..token.start - token.ws]); + Node[]* nodes = token in beginNodes; if (nodes) @@ -382,6 +386,9 @@ while (token.type != TOK.EOF) { token = token.next; + // Print whitespace. + if (token.ws) + print(token.ws[0..token.start - token.ws]); printToken(token, tags, print); } print(\n~tags[DocPart.SrcEnd])(\n~tags[DocPart.Tail]); @@ -392,10 +399,6 @@ alias DocPart DP; string srcText = xml_escape(token.srcText); - // Print whitespace. - if (token.ws) - print(token.ws[0..token.start - token.ws]); - switch(token.type) { case TOK.Identifier: diff -r fce1e6133dac -r 6440da4adb07 trunk/src/dil/Messages.d --- a/trunk/src/dil/Messages.d Mon Sep 17 21:57:11 2007 +0200 +++ b/trunk/src/dil/Messages.d Wed Sep 19 12:20:11 2007 +0200 @@ -3,7 +3,6 @@ License: GPL3 +/ module dil.Messages; -import dil.Settings; import common; /// Index into table of compiler messages. @@ -70,10 +69,18 @@ HelpImportGraph, } +private string[] messages; + +package void SetMessages(string[] msgs) +{ + assert(MID.max+1 == msgs.length); + messages = msgs; +} + string GetMsg(MID mid) { - assert(mid < GlobalSettings.messages.length); - return GlobalSettings.messages[mid]; + assert(mid < messages.length); + return messages[mid]; } char[] FormatMsg(MID mid, ...) diff -r fce1e6133dac -r 6440da4adb07 trunk/src/dil/Settings.d --- a/trunk/src/dil/Settings.d Mon Sep 17 21:57:11 2007 +0200 +++ b/trunk/src/dil/Settings.d Wed Sep 19 12:20:11 2007 +0200 @@ -137,5 +137,6 @@ if (messages.length != MID.max+1) throw new Exception(Format("messages table in {0} must exactly have {1} entries, but {2} were found.", fileName, MID.max+1, messages.length)); GlobalSettings.messages = messages; + dil.Messages.SetMessages(messages); } }