Skip to content

Commit

Permalink
fix self-hosted parser test
Browse files Browse the repository at this point in the history
  • Loading branch information
thejoshwolfe committed Dec 27, 2017
1 parent 192a039 commit 4e3d7fc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src-self-hosted/parser.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,13 @@ pub const Parser = struct {
var fixed_buffer_mem: [100 * 1024]u8 = undefined;

fn testParse(source: []const u8, allocator: &mem.Allocator) -> %[]u8 {
var tokenizer = Tokenizer.init(source);
var padded_source: [0x100]u8 = undefined;
std.mem.copy(u8, padded_source[0..source.len], source);
padded_source[source.len + 0] = '\n';
padded_source[source.len + 1] = '\n';
padded_source[source.len + 2] = '\n';

var tokenizer = Tokenizer.init(padded_source[0..source.len + 3]);
var parser = Parser.init(&tokenizer, allocator, "(memory buffer)");
defer parser.deinit();

Expand Down

0 comments on commit 4e3d7fc

Please sign in to comment.