~deciduously/nlox

cb32d928c2baa8dddb2cb2bb16b431ece7783613 — Ben Lovy 2 years ago
Initial commit
8 files changed, 53 insertions(+), 0 deletions(-)

A LICENSE
A README.md
A nlox
A nlox.nimble
A src/nlox.nim
A src/treewalkpkg/lox.nim
A tests/config.nims
A tests/test1.nim
A  => LICENSE +7 -0
@@ 1,7 @@
Copyright © 2020 Ben Lovy

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file

A  => README.md +0 -0
A  => nlox +0 -0
A  => nlox.nimble +15 -0
@@ 1,15 @@
# Package

version       = "0.1.0"
author        = "Ben Lovy"
description   = "Nim implementation of the treewalk interpreter for Lox for Crafting Interpreters."
license       = "MIT"
srcDir        = "src"
installExt    = @["nim"]
bin           = @["nlox"]



# Dependencies

requires "nim >= 1.0.4"

A  => src/nlox.nim +7 -0
@@ 1,7 @@
# 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 treewalkpkg/lox

when isMainModule:
  run()

A  => src/treewalkpkg/lox.nim +11 -0
@@ 1,11 @@
# This is just an example to get you started. Users of your hybrid library will
# import this file by writing ``import treewalkpkg/submodule``. Feel free to rename or
# remove this file altogether. You may create additional modules alongside
# this file as required.

let usage*: string = "Usage: nlox [script]"

# Entrypoint - java's main
proc run*() =
    echo usage
    # Check arg num

A  => tests/config.nims +1 -0
@@ 1,1 @@
switch("path", "$projectDir/../src")
\ No newline at end of file

A  => tests/test1.nim +12 -0
@@ 1,12 @@
# This is just an example to get you started. You may wish to put all of your
# tests into a single file, or separate them into multiple `test1`, `test2`
# etc. files (better names are recommended, just make sure the name starts with
# the letter 't').
#
# To run these tests, simply execute `nimble test`.

import unittest

import treewalkpkg/lox
test "correct usage message":
  check usage == "Usage: nlox [script]"