Ah I see - when you have a print
call in your data.vis it doesn't print anything in the compiler program, but when you call copy
from your compiler program it does create main.vis but the file contains File.Copy("@"C:/test.txt", "C:/output.txt");
?
There's an extra leading double quote there before the @ - is that the issue you're trying to solve?
I've not done much compiler work myself but from what I've seen the common pattern is to split the process into "lexing" to find meaningful tokens from the stream of characters, then "parsing" to produce language constructs based on the tokens.
Here's how I'd be tempted to structure it: https://pastebin.com/xbtv2WYG