commit 19e17da6516be732014392872f3ae07ab5d781f4
parent c2c305acb5bbde4c09870c379a7c83c773f50d1a
Author: Szymon Mikulicz <szymon.mikulicz@aptiv.com>
Date: Wed, 24 Jul 2024 17:41:16 +0200
Update to zig master
Diffstat:
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/zlox/.gitignore b/zlox/.gitignore
@@ -3,3 +3,4 @@ zig-out/
.cache/
.envrc
.tool-versions
+.zig-cache/
diff --git a/zlox/build.zig b/zlox/build.zig
@@ -19,7 +19,7 @@ pub fn build(b: *std.Build) void {
.name = "zlox",
// In this case the main source file is merely a path, however, in more
// complicated build scripts, this could be a generated file.
- .root_source_file = .{ .path = "src/main.zig" },
+ .root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
@@ -64,7 +64,7 @@ pub fn build(b: *std.Build) void {
// Creates a step for unit testing. This only builds the test executable
// but does not run it.
const unit_tests = b.addTest(.{
- .root_source_file = .{ .path = "src/test.zig" },
+ .root_source_file = b.path("src/test.zig"),
.target = target,
.optimize = optimize,
});
diff --git a/zlox/src/scanner.zig b/zlox/src/scanner.zig
@@ -69,7 +69,7 @@ pub const Token = struct {
};
pub const Scanner = struct {
- const identifiers = std.ComptimeStringMap(TokenType, .{
+ const identifiers = std.StaticStringMap(TokenType).initComptime(.{
.{ "and", TokenType.AND },
.{ "class", TokenType.CLASS },
.{ "else", TokenType.ELSE },