Is there any preprocessor scripting language?

2014-08-22 Thread MarisaLovesUsAll via Digitalmars-d
I just want to write something like this: #ololo script foreach(child; findAllChildrens()) { child.insert( static void doABarrelRoll() { } ); } #end Templates/mixins is not enough for me... maybe because of hands.dll error :)

Re: Is there any preprocessor scripting language?

2014-08-22 Thread Kagamin via Digitalmars-d
You can try D parsing libraries: http://forum.dlang.org/thread/jqwvudiwgiuprqcua...@forum.dlang.org they're believed to enable writing refactoring scripts.

Re: Is there any preprocessor scripting language?

2014-08-22 Thread Kagamin via Digitalmars-d
Example: import std.lexer; import std.d.lexer; import std.array; import std.stdio; void main(string[] args) { File input = File(args[1]); File output = args.length 2 ? File(args[2]) : stdout; ubyte[] inputBytes = uninitializedArray!(ubyte[])(input.size);

Re: Is there any preprocessor scripting language?

2014-08-22 Thread MarisaLovesUsAll via Digitalmars-d
On Friday, 22 August 2014 at 13:33:12 UTC, Kagamin wrote: You can try D parsing libraries: http://forum.dlang.org/thread/jqwvudiwgiuprqcua...@forum.dlang.org they're believed to enable writing refactoring scripts. Thanks a lot! It will be useful.