2018-02-15 17:14:20 +00:00
|
|
|
const std = @import("std");
|
2019-02-08 23:18:47 +00:00
|
|
|
const expect = std.testing.expect;
|
2022-03-09 17:26:48 +00:00
|
|
|
const builtin = @import("builtin");
|
2018-02-15 17:14:20 +00:00
|
|
|
|
|
|
|
test "struct contains null pointer which contains original struct" {
|
2022-03-09 17:26:48 +00:00
|
|
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
|
|
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
2018-05-31 15:56:59 +01:00
|
|
|
var x: ?*NodeLineComment = null;
|
2021-05-04 19:23:22 +01:00
|
|
|
try expect(x == null);
|
2018-02-15 17:14:20 +00:00
|
|
|
}
|
|
|
|
|
2018-11-13 13:08:37 +00:00
|
|
|
pub const Node = struct {
|
2018-02-15 17:14:20 +00:00
|
|
|
id: Id,
|
2018-05-31 15:56:59 +01:00
|
|
|
comment: ?*NodeLineComment,
|
2018-02-15 17:14:20 +00:00
|
|
|
|
2018-11-13 13:08:37 +00:00
|
|
|
pub const Id = enum {
|
2018-02-15 17:14:20 +00:00
|
|
|
Root,
|
|
|
|
LineComment,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-11-13 13:08:37 +00:00
|
|
|
pub const NodeLineComment = struct {
|
2018-02-15 17:14:20 +00:00
|
|
|
base: Node,
|
|
|
|
};
|