diff --git a/src/compiler.zig b/src/compiler.zig index e029b9c..3545694 100644 --- a/src/compiler.zig +++ b/src/compiler.zig @@ -11,5 +11,7 @@ pub const Compiler = struct { return Compiler{ .src = source, .allocator = allocator }; } - pub fn compile(self: *Compiler) void {} + pub fn compile(self: *Compiler) void { + var scanr = scanner.Scanner.init(self.allocator, self.src); + } }; diff --git a/src/new_scanner.zig b/src/new_scanner.zig new file mode 100644 index 0000000..acc8e49 --- /dev/null +++ b/src/new_scanner.zig @@ -0,0 +1,15 @@ +const std = @import("std"); + +const Allocator = std.mem.Allocator; + +pub const Scanner = struct { + source: []const u8, + allocator: *Allocator, + + pub fn init(allocator: *Allocator, data: []const u8) Scanner { + return Scanner{ + .allocator = allocator, + .source = data, + }; + } +};