1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# This is just an example to get you started. A typical hybrid package
# uses this file as the main entry point of the application.
import nloxpkg/lox
import os
let usage*: string = "Usage: nlox [script]"
when isMainModule:
let params = commandLineParams()
let num_params = params.len()
if num_params > 1:
echo usage
quit(64)
elif num_params == 1:
run_file(params[0])
else:
run_prompt()