Mercurial > projects > ddmd
changeset 152:4092a614a9f3
moved Escape and Macro to ddoc folder
author | Trass3r |
---|---|
date | Wed, 15 Sep 2010 03:00:30 +0200 |
parents | 766e6dc390e1 |
children | 560eaedcb7a2 |
files | dmd/Escape.d dmd/Macro.d dmd/Module.d dmd/ddoc/DocComment.d dmd/ddoc/Escape.d dmd/ddoc/Macro.d main.d |
diffstat | 7 files changed, 49 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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
--- 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;
--- 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;
--- /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