forked from luna/jorts
add src/new_scanner.zig
This commit is contained in:
parent
b80cd52c50
commit
63045e4df5
2 changed files with 18 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
15
src/new_scanner.zig
Normal file
15
src/new_scanner.zig
Normal file
|
@ -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,
|
||||
};
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue