[Issue 2445] D2 std.demangle example doesn't compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 29 17:06:33 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=2445


Trass3r <mrmocool at gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |spec
                 CC|                            |mrmocool at gmx.de
           Platform|x86                         |All
         OS/Version|Windows                     |All


--- Comment #2 from Trass3r <mrmocool at gmx.de> 2010-07-29 17:06:31 PDT ---
Also fgetc and writef give errors. Here's a working example (2.047):

import std.stdio;
import std.ctype;
import std.demangle;

int main()
{   string buffer;
    bool inword;
    foreach(c; InputByChar(stdin))
    {
        if (inword)
        {
            if (c == '_' || isalnum(c))
                buffer ~= cast(char) c;
            else
            {
                inword = false;
                write(demangle(buffer), cast(char) c);
            }
        }
        else
        {   if (c == '_' || isalpha(c))
            {        inword = true;
                buffer.length = 0;
                buffer ~= cast(char) c;
            }
            else
                write(cast(char) c);
        }
    }
    if (inword)
        write(demangle(buffer));
    return 0;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list