Closed kvnandula04 closed 3 years ago
What file extension do I use?
It doesn't matter. The interpreter will accept anything. But by convention, it's .lox
.
How do I run it? Is it using the terminal?
Yes, it runs on the command line. You run it the same way you start the REPL except you also pass the path to the file you want to run.
Do I need to compile the code before running it?
No, Lox is a scripting language and runs from source.
Would you be able to share a script to run it from command line please?
It's literally just:
jlox your_lox_program.lox
Hi, so, I'm new to all of this but I am trying to run a file with lox code and am not sure how to do it. I cloned the java interpreter to try it out and I feel so constrained as I can only type single line code snippets in the REPL. So, I was wondering about how to run a file with multiline code. I have a few questions:
Any help would be much appreciated! Thanks a lot!