lang: use std.mem.startsWith

This commit is contained in:
Luna 2019-08-13 10:19:39 -03:00
parent b0ddb35ae9
commit b66070c4e4
2 changed files with 2 additions and 4 deletions

View file

@ -332,7 +332,7 @@ pub const Lang = struct {
stmt = std.mem.trimLeft(u8, stmt, "\n");
if (stmt.len == 0) continue;
if (stmt[0] == '#') continue;
if (std.mem.startsWith(u8, stmt, "#")) continue;
// TODO better tokenizer instead of just tokenize(" ");
var tok_it = std.mem.tokenize(stmt, " ");

View file

@ -21,9 +21,7 @@ pub fn main() !void {
var args_it = std.process.args();
const exe_name = try (args_it.next(allocator) orelse @panic("expected exe name"));
// args[1] is the path to scri file
_ = try (args_it.next(allocator) orelse @panic("expected exe name"));
const scri_path = try (args_it.next(allocator) orelse @panic("expected scri path"));
var file = try std.fs.File.openRead(scri_path);