demangle tool
Sergey Gromov
snake.scaly at gmail.com
Fri Apr 10 14:01:19 PDT 2009
Thu, 09 Apr 2009 13:40:36 -0700, Andrei Alexandrescu wrote:
> The line wraps are all garbled, but you get the idea: all symbols quoted
> `like this' have been demangled appropriately. Below is the source of
> the demangle script:
>
> #!/home/andrei/bin/rdmd
> import std.algorithm, std.demangle, std.getopt, std.stdio;
>
> void main(string[] args)
> {
> string lSep = "`", rSep = "'";
> getopt(args, "lsep", &lSep, "rsep", &rSep);
> foreach (line; stdin.byLine())
> {
> auto sym = find(line, lSep);
> if (!sym.length)
> {
> writeln(line);
> continue;
> }
> sym = sym[1 .. $];
> auto before = line[0 .. $ - sym.length];
> sym = sym[0 .. $ - find(sym, rSep).length];
> auto after = line[before.length + sym.length .. $];
> writeln(before, demangle(sym.idup), after);
> }
> }
What happened to the range boolean operations, those
before/after/whatever? Do you still plan to implement them?
More information about the Digitalmars-d
mailing list