comparison trunk/src/cmd/DDoc.d @ 777:9f61e8af55d5

Added module dil.Compilation. Added predefined ID 'startaddress'. Added keyword 'nothrow'.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Wed, 20 Feb 2008 01:24:19 +0100
parents 580d4ca9f1ff
children 78be32e3e157
comparison
equal deleted inserted replaced
776:580d4ca9f1ff 777:9f61e8af55d5
88 mtable = new MacroTable(mtable); 88 mtable = new MacroTable(mtable);
89 // Define runtime macros. 89 // Define runtime macros.
90 mtable.insert("MODPATH", mod.getFQNPath() ~ mod.fileExtension()); 90 mtable.insert("MODPATH", mod.getFQNPath() ~ mod.fileExtension());
91 91
92 mtable.insert("TITLE", mod.getFQN()); 92 mtable.insert("TITLE", mod.getFQN());
93 mtable.insert("DOCFILENAME", mod.getFQN()); 93 mtable.insert("DOCFILENAME", mod.getFQN() ~ ".html");
94 auto timeStr = Time.toString(); 94 auto timeStr = Time.toString();
95 mtable.insert("DATETIME", timeStr); 95 mtable.insert("DATETIME", timeStr);
96 mtable.insert("YEAR", timeStr[20..24]); 96 mtable.insert("YEAR", Time.year(timeStr));
97 97
98 auto doc = new DDocEmitter(mtable, incUndoc, mod, tokenHL); 98 auto doc = new DDocEmitter(mtable, incUndoc, mod, tokenHL);
99 doc.emit(); 99 doc.emit();
100 // Set BODY macro to the text produced by the DDocEmitter. 100 // Set BODY macro to the text produced by the DDocEmitter.
101 mtable.insert("BODY", doc.text); 101 mtable.insert("BODY", doc.text);
427 if (bases.length == 0) 427 if (bases.length == 0)
428 return; 428 return;
429 auto basesBegin = bases[0].begin.prevNWS; 429 auto basesBegin = bases[0].begin.prevNWS;
430 if (basesBegin.kind == TOK.Colon) 430 if (basesBegin.kind == TOK.Colon)
431 basesBegin = bases[0].begin; 431 basesBegin = bases[0].begin;
432 text ~= " : " ~ escape(textSpan(basesBegin, bases[$-1].end)); 432 write(" : ", escape(textSpan(basesBegin, bases[$-1].end)));
433 } 433 }
434 434
435 void write(char[][] strings...) 435 void write(char[][] strings...)
436 { 436 {
437 foreach (s; strings) 437 foreach (s; strings)
439 } 439 }
440 440
441 void SYMBOL(char[] name, Declaration d) 441 void SYMBOL(char[] name, Declaration d)
442 { 442 {
443 auto loc = d.begin.getRealLocation(); 443 auto loc = d.begin.getRealLocation();
444 auto str = Format("$(SYMBOL {}, {}, {}.{}, {})", 444 auto str = Format("$(SYMBOL {}, {})", name, loc.lineNum);
445 name, modul.getFQN(), modul.getFQNPath(),
446 modul.fileExtension(), loc.lineNum);
447 write(str); 445 write(str);
448 // write("$(DDOC_PSYMBOL ", name, ")"); 446 // write("$(DDOC_PSYMBOL ", name, ")");
449 } 447 }
450 448
451 uint prevDeclOffset; 449 uint prevDeclOffset;