DzLox

:)
git clone https://git.sr.ht/~ashymad/DzLox
Log | Files | Refs | Submodules | LICENSE

commit 894c642b4d9c59a602305306f9ac8800d4108871
parent 1b34a0bc4690256fa3a4f42244856bc6c81c2461
Author: Szymon Mikulicz <szymon.mikulicz@posteo.net>
Date:   Fri, 21 Oct 2022 23:40:48 +0200

Add zlox template

Diffstat:
R.gitignore -> dlox/.gitignore | 0
Rbacon.lox -> dlox/bacon.lox | 0
Rboston.lox -> dlox/boston.lox | 0
Rcount.lox -> dlox/count.lox | 0
Rdub.json -> dlox/dub.json | 0
Rdub.selections.json -> dlox/dub.selections.json | 0
Rfib.lox -> dlox/fib.lox | 0
Rgaze.lox -> dlox/gaze.lox | 0
Rscopebug.lox -> dlox/scopebug.lox | 0
Rsource/app.d -> dlox/source/app.d | 0
Rsource/ast.d -> dlox/source/ast.d | 0
Rsource/astgen.d -> dlox/source/astgen.d | 0
Rsource/astprinter.d -> dlox/source/astprinter.d | 0
Rsource/callable.d -> dlox/source/callable.d | 0
Rsource/cls.d -> dlox/source/cls.d | 0
Rsource/environment.d -> dlox/source/environment.d | 0
Rsource/error.d -> dlox/source/error.d | 0
Rsource/fun.d -> dlox/source/fun.d | 0
Rsource/instance.d -> dlox/source/instance.d | 0
Rsource/interpreter.d -> dlox/source/interpreter.d | 0
Rsource/keywords.d -> dlox/source/keywords.d | 0
Rsource/parser.d -> dlox/source/parser.d | 0
Rsource/resolver.d -> dlox/source/resolver.d | 0
Rsource/scanner.d -> dlox/source/scanner.d | 0
Rsource/token.d -> dlox/source/token.d | 0
Rsource/tokentype.d -> dlox/source/tokentype.d | 0
Rthrice.lox -> dlox/thrice.lox | 0
Azlox/.gitignore | 2++
Azlox/build.zig | 34++++++++++++++++++++++++++++++++++
Azlox/src/main.zig | 9+++++++++
30 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/dlox/.gitignore diff --git a/bacon.lox b/dlox/bacon.lox diff --git a/boston.lox b/dlox/boston.lox diff --git a/count.lox b/dlox/count.lox diff --git a/dub.json b/dlox/dub.json diff --git a/dub.selections.json b/dlox/dub.selections.json diff --git a/fib.lox b/dlox/fib.lox diff --git a/gaze.lox b/dlox/gaze.lox diff --git a/scopebug.lox b/dlox/scopebug.lox diff --git a/source/app.d b/dlox/source/app.d diff --git a/source/ast.d b/dlox/source/ast.d diff --git a/source/astgen.d b/dlox/source/astgen.d diff --git a/source/astprinter.d b/dlox/source/astprinter.d diff --git a/source/callable.d b/dlox/source/callable.d diff --git a/source/cls.d b/dlox/source/cls.d diff --git a/source/environment.d b/dlox/source/environment.d diff --git a/source/error.d b/dlox/source/error.d diff --git a/source/fun.d b/dlox/source/fun.d diff --git a/source/instance.d b/dlox/source/instance.d diff --git a/source/interpreter.d b/dlox/source/interpreter.d diff --git a/source/keywords.d b/dlox/source/keywords.d diff --git a/source/parser.d b/dlox/source/parser.d diff --git a/source/resolver.d b/dlox/source/resolver.d diff --git a/source/scanner.d b/dlox/source/scanner.d diff --git a/source/token.d b/dlox/source/token.d diff --git a/source/tokentype.d b/dlox/source/tokentype.d diff --git a/thrice.lox b/dlox/thrice.lox diff --git a/zlox/.gitignore b/zlox/.gitignore @@ -0,0 +1,2 @@ +zig-cache/ +zig-out/ diff --git a/zlox/build.zig b/zlox/build.zig @@ -0,0 +1,34 @@ +const std = @import("std"); + +pub fn build(b: *std.build.Builder) void { + // Standard target options allows the person running `zig build` to choose + // what target to build for. Here we do not override the defaults, which + // means any target is allowed, and the default is native. Other options + // for restricting supported target set are available. + const target = b.standardTargetOptions(.{}); + + // Standard release options allow the person running `zig build` to select + // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. + const mode = b.standardReleaseOptions(); + + const exe = b.addExecutable("zlox", "src/main.zig"); + exe.setTarget(target); + exe.setBuildMode(mode); + exe.install(); + + const run_cmd = exe.run(); + run_cmd.step.dependOn(b.getInstallStep()); + if (b.args) |args| { + run_cmd.addArgs(args); + } + + const run_step = b.step("run", "Run the app"); + run_step.dependOn(&run_cmd.step); + + const exe_tests = b.addTest("src/main.zig"); + exe_tests.setTarget(target); + exe_tests.setBuildMode(mode); + + const test_step = b.step("test", "Run unit tests"); + test_step.dependOn(&exe_tests.step); +} diff --git a/zlox/src/main.zig b/zlox/src/main.zig @@ -0,0 +1,9 @@ +const std = @import("std"); + +pub fn main() anyerror!void { + std.log.info("All your codebase are belong to us.", .{}); +} + +test "basic test" { + try std.testing.expectEqual(10, 3 + 7); +}