digitalmars.D.learn - Cache Building of Pegged-Generated Parsers in a DUB Project
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (4/4) Nov 26 2014 I want to cache parsers generated by Pegged grammars in a DUB
- Stefan Koch (3/7) Nov 26 2014 preBuildCommand in check if the files are there
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (4/6) Nov 26 2014 Thanks!
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (12/20) Nov 26 2014 I guess I could right a separate d program that generates the
I want to cache parsers generated by Pegged grammars in a DUB project by writing the generated parser strings to files. Is it possible to add this build logic somewhere in DUB or do I have to resort to SCons for this?
Nov 26 2014
On Wednesday, 26 November 2014 at 10:26:05 UTC, Nordlöw wrote:I want to cache parsers generated by Pegged grammars in a DUB project by writing the generated parser strings to files. Is it possible to add this build logic somewhere in DUB or do I have to resort to SCons for this?preBuildCommand in check if the files are there if not generate them if yes do nothing
Nov 26 2014
On Wednesday, 26 November 2014 at 12:09:34 UTC, Stefan Koch wrote:preBuildCommand in check if the files are there if not generate them if yes do nothingThanks! Documented here http://code.dlang.org/package-format by searching for preBuildCommands
Nov 26 2014
On Wednesday, 26 November 2014 at 12:09:34 UTC, Stefan Koch wrote:On Wednesday, 26 November 2014 at 10:26:05 UTC, Nordlöw wrote:I guess I could right a separate d program that generates the files called by preBuildCommand. But it would be even greater if we could do CTFE-file-io to check whether the evaluation needs to be called at all. As we can import files (generated parser module) into strings and write the generated parser strings at run-time the only thing need is to add some logic that generates a digest every time a parser is generated write that digest to a file and then import that digest at compile time at compare it to the digest of the parser string read at compile time. If they differ (at compile time) using static if the parser enum string is updated. Does my vision hold water? Destroy.I want to cache parsers generated by Pegged grammars in a DUB project by writing the generated parser strings to files. Is it possible to add this build logic somewhere in DUB or do I have to resort to SCons for this?preBuildCommand in check if the files are there if not generate them if yes do nothing
Nov 26 2014