# HG changeset patch # User Trass3r # Date 1284512430 -7200 # Node ID 4092a614a9f3b56de6837409b4e51f444f6af4c5 # Parent 766e6dc390e1eeb464e26ab873a59e77d6b2bf3c moved Escape and Macro to ddoc folder diff -r 766e6dc390e1 -r 4092a614a9f3 dmd/Escape.d --- a/dmd/Escape.d Wed Sep 15 02:47:24 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -module dmd.Escape; - -struct Escape -{ - string[256] strings; - - /*************************************** - * Find character string to replace c with. - */ - static string escapeChar(char c) - { - switch (c) - { - case '<': - return "<"; - case '>': - return ">"; - case '&': - return "&"; - default: - return null; - } - } -} \ No newline at end of file diff -r 766e6dc390e1 -r 4092a614a9f3 dmd/Macro.d --- a/dmd/Macro.d Wed Sep 15 02:47:24 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -module dmd.Macro; - -struct Macro -{ -} \ No newline at end of file diff -r 766e6dc390e1 -r 4092a614a9f3 dmd/Module.d --- a/dmd/Module.d Wed Sep 15 02:47:24 2010 +0200 +++ b/dmd/Module.d Wed Sep 15 03:00:30 2010 +0200 @@ -18,8 +18,6 @@ import dmd.ModuleInfoDeclaration; import dmd.FuncDeclaration; import dmd.Loc; -import dmd.Macro; -import dmd.Escape; import dmd.OutBuffer; import dmd.HdrGenState; import dmd.ArrayTypes; @@ -54,6 +52,8 @@ import dmd.backend.glue; import dmd.backend.LIST; import dmd.codegen.Util; +import dmd.ddoc.Macro; +import dmd.ddoc.Escape; import core.stdc.string; import core.stdc.stdlib; diff -r 766e6dc390e1 -r 4092a614a9f3 dmd/ddoc/DocComment.d --- a/dmd/ddoc/DocComment.d Wed Sep 15 02:47:24 2010 +0200 +++ b/dmd/ddoc/DocComment.d Wed Sep 15 03:00:30 2010 +0200 @@ -1,9 +1,9 @@ module dmd.ddoc.DocComment; +import dmd.ddoc.Escape; +import dmd.ddoc.Macro; import dmd.ddoc.Sections; import dmd.Array; -import dmd.Macro; -import dmd.Escape; import dmd.Scope; import dmd.Dsymbol; import dmd.OutBuffer; @@ -28,7 +28,7 @@ { unsigned idlen; - //printf("parse(%s): '%s'\n", s.toChars(), comment); + // writef("parse(%s): '%s'\n", s.toChars(), comment); if (sc.lastdc && isDitto(comment)) return null; @@ -54,11 +54,25 @@ return dc; } + /************************************************ + * Parse macros out of Macros: section. + * Macros are of the form: + * name1 = value1 + * + * name2 = value2 + */ static void parseMacros(Escape** pescapetable, Macro** pmacrotable, ubyte* m, uint mlen) { assert(false); } + /************************************** + * Parse escapes of the form: + * /c/string/ + * where c is a single character. + * Multiple escapes can be separated + * by whitespace and/or commas. + */ static void parseEscapes(Escape** pescapetable, ubyte* textstart, uint textlen) { assert(false); @@ -70,7 +84,7 @@ * If paragraph ends in 'identifier:', * then (*pcomment)[0 .. idlen] is the identifier. */ - void parseSections(ubyte* comment) + void parseSections(string comment) { ubyte*p; ubyte*pstart; diff -r 766e6dc390e1 -r 4092a614a9f3 dmd/ddoc/Escape.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dmd/ddoc/Escape.d Wed Sep 15 03:00:30 2010 +0200 @@ -0,0 +1,24 @@ +module dmd.ddoc.Escape; + +struct Escape +{ + string[256] strings; + + /*************************************** + * Find character string to replace c with. + */ + static string escapeChar(char c) + { + switch (c) + { + case '<': + return "<"; + case '>': + return ">"; + case '&': + return "&"; + default: + return null; + } + } +} \ No newline at end of file diff -r 766e6dc390e1 -r 4092a614a9f3 dmd/ddoc/Macro.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dmd/ddoc/Macro.d Wed Sep 15 03:00:30 2010 +0200 @@ -0,0 +1,5 @@ +module dmd.ddoc.Macro; + +struct Macro +{ +} \ No newline at end of file diff -r 766e6dc390e1 -r 4092a614a9f3 main.d --- a/main.d Wed Sep 15 02:47:24 2010 +0200 +++ b/main.d Wed Sep 15 03:00:30 2010 +0200 @@ -1,6 +1,5 @@ module main; -import dmd.Macro; import dmd.Array; import dmd.Module; import dmd.Global;