Skip to content

Commit 7d58573

Browse files
committed
Discard other code
1 parent 376260d commit 7d58573

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

zig/src/main.zig

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,25 @@ const erbx = @cImport({
44
@cInclude("/Users/marcoroth/Development/erbx/src/include/erbx.h");
55
});
66

7-
pub fn main() !void {
8-
// Prints to stderr (it's a shortcut based on `std.io.getStdErr()`)
9-
std.debug.print("All your {s} are belong to us.\n", .{"codebase"});
10-
}
11-
12-
// const c_html: [*c]const u8 = &"<img required />"[0]; // Get a C-compatible pointer
13-
14-
test "erbx" {
7+
pub fn lex() void {
158
const html: *const [13:0]u8 = "<html></html>"; // String literal, null-terminated
169
const c_html: [*c]u8 = html[0]; // Get C-style pointer
1710

1811
const buffer: [*c]erbx.buffer_T = undefined; // Use C struct type
19-
2012
const init = erbx.buffer_init(buffer); // Explicit cast
2113

2214
if (init) {
2315
erbx.erbx_lex_to_buffer(c_html, buffer);
16+
//_ = erbx.erbx_lex(c_html);
17+
18+
//std.log.info("{}", .{hello[0].capacity});
2419
}
2520
}
2621

27-
test "simple test" {
28-
var list = std.ArrayList(i32).init(std.testing.allocator);
29-
defer list.deinit(); // try commenting this out and see if zig detects the memory leak!
30-
try list.append(42);
31-
try std.testing.expectEqual(@as(i32, 42), list.pop());
22+
pub fn main() !void {
23+
lex();
24+
}
25+
26+
test "erbx" {
27+
lex();
3228
}

0 commit comments

Comments
 (0)