summaryrefslogtreecommitdiffstats
path: root/test cases/d/16 code generation/generator.d
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/d/16 code generation/generator.d')
-rw-r--r--test cases/d/16 code generation/generator.d13
1 files changed, 13 insertions, 0 deletions
diff --git a/test cases/d/16 code generation/generator.d b/test cases/d/16 code generation/generator.d
new file mode 100644
index 0000000..f944dd3
--- /dev/null
+++ b/test cases/d/16 code generation/generator.d
@@ -0,0 +1,13 @@
+module generator;
+
+import std.file;
+import std.stdio;
+import std.string;
+
+void main(string[] args)
+{
+ const text = cast(string)read(args[1]);
+
+ writeln("module generated;");
+ writefln!`string generatedString() { return "%s"; }`(text.strip());
+}