2019-06-01 19:21:36 +00:00
|
|
|
const std = @import("std");
|
2019-06-01 19:37:24 +00:00
|
|
|
const tokens = @import("token.zig");
|
2019-06-01 19:21:36 +00:00
|
|
|
|
|
|
|
const Allocator = std.mem.Allocator;
|
|
|
|
|
|
|
|
pub const Scanner = struct {
|
|
|
|
source: []const u8,
|
2019-06-01 19:37:24 +00:00
|
|
|
|
|
|
|
start: usize = 0,
|
|
|
|
current: usize = 0,
|
|
|
|
line: usize = 1,
|
|
|
|
|
2019-06-01 19:21:36 +00:00
|
|
|
allocator: *Allocator,
|
|
|
|
|
|
|
|
pub fn init(allocator: *Allocator, data: []const u8) Scanner {
|
|
|
|
return Scanner{
|
|
|
|
.allocator = allocator,
|
|
|
|
.source = data,
|
|
|
|
};
|
|
|
|
}
|
2019-06-01 19:37:24 +00:00
|
|
|
|
|
|
|
pub fn scanToken(self: *Scanner) tokens.Token {
|
|
|
|
return tokens.Token{};
|
|
|
|
}
|
2019-06-01 19:21:36 +00:00
|
|
|
};
|