https://github.com/heckj/slox
A swift variation of the content from Bob Nystrom's book: Crafting Interpreters
https://github.com/heckj/slox
crafting-interpreters interpreter parser swift
Last synced: 3 months ago
JSON representation
A swift variation of the content from Bob Nystrom's book: Crafting Interpreters
- Host: GitHub
- URL: https://github.com/heckj/slox
- Owner: heckj
- Created: 2021-03-03T00:18:12.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-08T00:11:47.000Z (over 4 years ago)
- Last Synced: 2025-03-14T18:51:38.116Z (11 months ago)
- Topics: crafting-interpreters, interpreter, parser, swift
- Language: Swift
- Homepage:
- Size: 393 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Slox
A swift port/variation following on the content from Bob Nystrom's
[Crafting Interpreters](https://craftinginterpreters.com/contents.html)
This is a hobby project to go through the book and do some learning, so don't _count_ on anything here.
## Compile, Test, and Code Coverage
You can open Package.swift in Xcode and run tests there and inspect code coverage.
If you want to run do this all from the command line (or a CI pipeline), then I've made a script to make this easier.
./codecov-report.sh
Runs the tests with `--enable-code-coverage`, and using `xcrun` to determine a location (macOS only currently) for the binary and uses `llvm-cov` and `lcov` to generate an HTML report in the directory `coverage`.
To set up CLI tooling (`lcov`) for the report generation:
brew install lcov
## Run the tests on Linux
docker run -it --rm --platform linux/amd64 -v "$PWD:$PWD" -w "$PWD" -e QEMU_CPU=max swift:5.3 swift test