~deciduously/nlox

ref: 6dc0caee503234b11cc7f326eee36e66e02baa7e nlox/src/nlox.nim -rw-r--r-- 438 bytes
6dc0caeeBen Lovy CLI 5 months ago
                                                                                
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()