-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.zig
608 lines (556 loc) · 22.8 KB
/
build.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
const builtin = @import("builtin");
const std = @import("std");
pub const Options = struct {
showdown: ?bool = null,
log: ?bool = null,
chance: ?bool = null,
calc: ?bool = null,
};
const Step = if (@hasDecl(std.Build, "Step")) std.Build.Step else .{
.Compile = std.Build.CompileStep,
.Options = std.Build.OptionsStep,
.Run = std.Build.RunStep,
};
const has_path = @hasField(std.Build.LazyPath, "path");
const root_module = @hasField(Step.Compile, "root_module");
const force_pic = !@hasField(std.Build.SharedLibraryOptions, "pic");
const ResolvedTarget =
if (@hasDecl(std.Build, "ResolvedTarget")) std.Build.ResolvedTarget else std.zig.CrossTarget;
pub fn module(b: *std.Build, options: Options) *std.Build.Module {
const dirname = comptime std.fs.path.dirname(@src().file) orelse ".";
const build_options = b.addOptions();
build_options.addOption(?bool, "showdown", options.showdown);
build_options.addOption(?bool, "log", options.log);
build_options.addOption(?bool, "chance", options.chance);
build_options.addOption(?bool, "calc", options.calc);
const root_source_file: std.Build.LazyPath =
.{ .cwd_relative = dirname ++ "/src/lib/pkmn.zig" };
const Import = if (@hasDecl(std.Build.Module, "Import"))
std.Build.Module.Import
else
std.Build.ModuleDependency;
const imports: []const Import =
&.{.{ .name = "build_options", .module = build_options.createModule() }};
return b.createModule(if (@hasDecl(std.Build, "CreateModuleOptions"))
.{ .source_file = root_source_file, .dependencies = imports }
else
.{ .root_source_file = root_source_file, .imports = imports });
}
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const default: ?bool = if (force_pic) false else null;
const node_headers = b.option([]const u8, "node-headers", "Path to node-headers");
const node_import_lib =
b.option([]const u8, "node-import-library", "Path to node import library (Windows)");
const demo = if (try exists("src/tools/demo.zig"))
b.option(bool, "demo", "Build the demo library") orelse false
else
false;
const wasm = b.option(bool, "wasm", "Build a WASM library") orelse false;
const wasm_stack_size =
b.option(u64, "wasm-stack-size", "The size of WASM stack") orelse std.wasm.page_size;
const dynamic = b.option(bool, "dynamic", "Build a dynamic library") orelse false;
const strip = b.option(bool, "strip", "Strip debugging symbols from binary") orelse default;
const pic = b.option(bool, "pic", "Force position independent code") orelse default;
const emit_asm = b.option(bool, "emit-asm", "Output .s (assembly code)") orelse false;
const emit_ll = b.option(bool, "emit-ll", "Output .ll (LLVM IR)") orelse false;
const cmd = b.findProgram(&.{"strip"}, &.{}) catch null;
const json = @embedFile("package.json");
var parsed = try std.json.parseFromSlice(std.json.Value, b.allocator, json, .{});
defer parsed.deinit();
const version = parsed.value.object.get("version").?.string;
const description = parsed.value.object.get("description").?.string;
var repository = std.mem.splitSequence(u8, parsed.value.object.get("repository").?.string, ":");
std.debug.assert(std.mem.eql(u8, repository.first(), "github"));
const fast = try std.SemanticVersion.parse("0.12.0-dev.866+3a47bc715");
if (optimize != .Debug and fast.order(builtin.zig_version) == .lt) {
std.log.warn("Release builds are ~10-20% slower than before Zig " ++
"v0.12.0-dev.866+3a47bc715 due to ziglang/zig#17768", .{});
}
const showdown =
b.option(bool, "showdown", "Enable Pokémon Showdown compatibility mode") orelse false;
const log = b.option(bool, "log", "Enable protocol message logging") orelse false;
const chance = b.option(bool, "chance", "Enable update probability tracking") orelse false;
const calc = b.option(bool, "calc", "Enable damage calculator support") orelse false;
const extra = b.option([]const []const u8, "option", "Enable extra option");
const options = b.addOptions();
options.addOption(?bool, "showdown", showdown);
options.addOption(?bool, "log", log);
options.addOption(?bool, "chance", chance);
options.addOption(?bool, "calc", calc);
if (extra) |opts| {
for (opts) |opt| {
if (std.mem.indexOfScalar(u8, opt, '=')) |i| {
options.addOption(?bool, opt[0..i], if (std.mem.eql(u8, opt[i + 1 ..], "true"))
true
else if (std.mem.eql(u8, opt[i + 1 ..], "false"))
false
else {
std.log.err("Invalid option: {s}\n", .{opt});
return error.InvalidOption;
});
} else {
options.addOption(?bool, opt, true);
}
}
}
const name = if (showdown) "pkmn-showdown" else "pkmn";
const pkmn: ?*std.Build.Module = if (@hasDecl(std.Build, "CreateModuleOptions"))
null
else
b.addModule("pkmn", .{
.root_source_file = if (has_path)
.{ .path = "src/lib/pkmn.zig" }
else
b.path("src/lib/pkmn.zig"),
.optimize = optimize,
.target = target,
.imports = &.{.{ .name = "build_options", .module = options.createModule() }},
});
var c = false;
if (node_headers) |headers| {
const addon = b.fmt("{s}.node", .{name});
const path = if (has_path) .{ .path = "src/lib/node.zig" } else b.path("src/lib/node.zig");
const lib = b.addSharedLibrary(if (force_pic) .{
.name = addon,
.root_source_file = path,
.optimize = optimize,
.target = target,
} else .{
.name = addon,
.root_source_file = path,
.optimize = optimize,
.target = target,
.strip = strip,
.pic = pic,
});
(if (root_module) lib.root_module else lib).addOptions("build_options", options);
lib.addSystemIncludePath(if (has_path) .{ .path = headers } else b.path(headers));
lib.linkLibC();
if (node_import_lib) |il| {
lib.addObjectFile(if (has_path) .{ .path = il } else b.path(il));
} else if (detect(target).os.tag == .windows) {
try std.io.getStdErr().writeAll("Must provide --node-import-library path on Windows\n");
std.process.exit(1);
}
lib.linker_allow_shlib_undefined = true;
maybeStrip(b, lib, b.getInstallStep(), strip, cmd);
if (force_pic and pic orelse false) lib.force_pic = pic;
// Always emit to build/lib because this is where the driver code expects to find it
// TODO: ziglang/zig#2231 - using the following used to work (though was hacky):
//
// lib.emit_bin = .{ .emit_to = b.fmt("build/lib/{s}", .{addon}) };
// b.getInstallStep().dependOn(&lib.step);
//
// But ziglang/zig#14647 broke this so we now need to do an install() and then manually
// rename the file ourself in install-pkmn-engine
b.installArtifact(lib);
} else if (wasm) {
const path = "src/lib/wasm.zig";
try buildWasm(b, name, path, optimize, strip, pic, wasm_stack_size, null, options);
} else if (demo) {
const path = "src/tools/demo.zig";
const n = if (showdown) "demo-showdown" else "demo";
const mod = pkmn orelse module(b, .{
.showdown = showdown,
.log = log,
.chance = chance,
.calc = calc,
});
try buildWasm(b, n, path, optimize, strip, pic, wasm_stack_size, mod, options);
} else if (dynamic) {
const path = if (has_path) .{ .path = "src/lib/c.zig" } else b.path("src/lib/c.zig");
const lib = b.addSharedLibrary(if (force_pic) .{
.name = name,
.root_source_file = path,
.version = try std.SemanticVersion.parse(version),
.optimize = optimize,
.target = target,
} else .{
.name = name,
.root_source_file = path,
.version = try std.SemanticVersion.parse(version),
.optimize = optimize,
.target = target,
.strip = strip,
.pic = pic,
});
(if (root_module) lib.root_module else lib).addOptions("build_options", options);
lib.addIncludePath(if (has_path) .{ .path = "src/include" } else b.path("src/include"));
maybeStrip(b, lib, b.getInstallStep(), strip, cmd);
if (force_pic and pic orelse false) lib.force_pic = pic;
b.installArtifact(lib);
c = true;
} else {
const path = if (has_path) .{ .path = "src/lib/c.zig" } else b.path("src/lib/c.zig");
const lib = b.addStaticLibrary(if (force_pic) .{
.name = name,
.root_source_file = path,
.optimize = optimize,
.target = target,
} else .{
.name = name,
.root_source_file = path,
.optimize = optimize,
.target = target,
.strip = strip,
.pic = pic,
});
(if (root_module) lib.root_module else lib).addOptions("build_options", options);
lib.addIncludePath(if (has_path) .{ .path = "src/include" } else b.path("src/include"));
lib.bundle_compiler_rt = true;
maybeStrip(b, lib, b.getInstallStep(), strip, cmd);
if (force_pic and pic orelse false) lib.force_pic = pic;
if (emit_asm) {
b.getInstallStep().dependOn(&b.addInstallFileWithDir(
lib.getEmittedAsm(),
.prefix,
b.fmt("{s}.s", .{name}),
).step);
}
if (emit_ll) {
b.getInstallStep().dependOn(&b.addInstallFileWithDir(
lib.getEmittedLlvmIr(),
.prefix,
b.fmt("{s}.ll", .{name}),
).step);
}
b.installArtifact(lib);
c = true;
}
if (c) {
const path =
if (has_path) .{ .path = "src/include/pkmn.h" } else b.path("src/include/pkmn.h");
const header = b.addInstallFileWithDir(path, .header, "pkmn.h");
b.getInstallStep().dependOn(&header.step);
const pc = b.fmt("lib{s}.pc", .{name});
const file = try std.fs.path.relative(
b.allocator,
try std.process.getCwdAlloc(b.allocator),
try b.cache_root.join(b.allocator, &.{pc}),
);
const pkgconfig_file = try std.fs.cwd().createFile(file, .{});
const dirname = comptime std.fs.path.dirname(@src().file) orelse ".";
const writer = pkgconfig_file.writer();
try writer.print(
\\prefix={0s}/{1s}
\\includedir=${{prefix}}/include
\\libdir=${{prefix}}/lib
\\
\\Name: lib{2s}
\\URL: https://github.com/{3s}
\\Description: {4s}
\\Version: {5s}
\\Cflags: -I${{includedir}}
\\Libs: -L${{libdir}} -l{2s}
, .{ dirname, b.install_path, name, repository.next().?, description, version });
defer pkgconfig_file.close();
b.installFile(file, b.fmt("share/pkgconfig/{s}", .{pc}));
}
const config: Config = .{
.target = target,
.optimize = optimize,
.pic = pic,
.strip = strip,
.cmd = cmd,
};
// TODO: tests can be run multiple times due to @imports
const tests = TestStep.create(b, options, config);
var exes = std.ArrayList(*Step.Compile).init(b.allocator);
const tools: ToolConfig = .{
.options = .{
.showdown = showdown,
.log = log,
.chance = chance,
.calc = calc,
},
.module = pkmn,
.general = config,
.tool = .{
.tests = if (tests.build) tests else null,
.exes = &exes,
},
};
var benchmark_config = tools;
benchmark_config.general.optimize = .ReleaseFast;
benchmark_config.general.strip = true;
const benchmark = try tool(b, "src/test/benchmark.zig", benchmark_config);
var fuzz_config = tools;
fuzz_config.general.strip = false;
fuzz_config.tool.name = "fuzz";
const fuzz = try tool(b, "src/test/fuzz.zig", fuzz_config);
const analyze = try tool(b, "src/tools/analyze.zig", tools);
const dump = try tool(b, "src/tools/dump.zig", tools);
const transitions = try tool(b, "src/tools/transitions.zig", tools);
// FIXME: serde randomly fails to build in some release configurations
var hack = tools;
if (optimize != .Debug) hack.tool.tests = null;
const serde = try tool(b, "src/tools/serde.zig", hack);
if (analyze) |t| b.step("analyze", "Run LLVM analysis tool").dependOn(&t.step);
if (benchmark) |t| b.step("benchmark", "Run benchmark code").dependOn(&t.step);
if (dump) |t| b.step("dump", "Run protocol dump tool").dependOn(&t.step);
if (fuzz) |t| b.step("fuzz", "Run fuzz tester").dependOn(&t.step);
if (serde) |t| b.step("serde", "Run serialization/deserialization tool").dependOn(&t.step);
b.step("test", "Run all tests").dependOn(&tests.step);
b.step("tools", "Install tools").dependOn(&ToolsStep.create(b, &exes).step);
if (transitions) |t| {
b.step("transitions", "Visualize transitions algorithm search").dependOn(&t.step);
}
}
fn buildWasm(
b: *std.Build,
name: []const u8,
root_src_file: []const u8,
optimize: std.builtin.OptimizeMode,
strip: ?bool,
pic: ?bool,
wasm_stack_size: u64,
import: ?*std.Build.Module,
options: anytype,
) !void {
const entry = @hasDecl(Step.Compile, "Entry");
const mode = switch (optimize) {
.ReleaseFast, .ReleaseSafe => .ReleaseSmall,
else => optimize,
};
// https://webassembly.org/features/
var features = std.Target.wasm.featureSet(&.{
.atomics,
.bulk_memory,
// .exception_handling,
.extended_const,
// .half_precision,
// .multimemory,
.mutable_globals,
.nontrapping_fptoint,
.reference_types,
// .relaxed_simd,
.sign_ext,
.simd128,
// .tail_call,
});
if (builtin.zig_version.order(try std.SemanticVersion.parse("0.12.0")) != .lt) {
features.addFeature(@intFromEnum(std.Target.wasm.Feature.multivalue));
}
const freestanding = if (@hasDecl(std.Build, "resolveTargetQuery"))
b.resolveTargetQuery(.{
.cpu_arch = .wasm32,
.os_tag = .freestanding,
.cpu_features_add = features,
})
else
ResolvedTarget{
.cpu_arch = .wasm32,
.os_tag = .freestanding,
.cpu_features_add = features,
};
const path = if (has_path) .{ .path = root_src_file } else b.path(root_src_file);
const bin = if (entry) bin: {
const exe = b.addExecutable(if (force_pic) .{
.name = name,
.root_source_file = path,
.optimize = mode,
.target = freestanding,
} else .{
.name = name,
.root_source_file = path,
.optimize = mode,
.target = freestanding,
.strip = strip,
.pic = pic,
});
var file = try std.fs.cwd().openFile(root_src_file, .{});
defer file.close();
const bytes = try file.readToEndAlloc(b.allocator, std.math.maxInt(usize));
(if (root_module) exe.root_module else exe).export_symbol_names = try exports(b, bytes);
exe.entry = .disabled;
break :bin exe;
} else bin: {
const lib = b.addSharedLibrary(.{
.name = name,
.root_source_file = path,
.optimize = mode,
.target = freestanding,
});
lib.rdynamic = true;
break :bin lib;
};
if (import) |i| {
if (root_module) {
bin.root_module.addImport("pkmn", i);
} else {
bin.addModule("pkmn", i);
}
}
bin.stack_size = wasm_stack_size;
if (@hasDecl(@TypeOf(bin.*), "strip")) bin.strip = strip orelse false;
if (force_pic and pic orelse false) bin.force_pic = pic;
(if (root_module) bin.root_module else bin).addOptions("build_options", options);
const opt = b.findProgram(&.{"wasm-opt"}, &.{"./node_modules/.bin"}) catch null;
if (optimize != .Debug and opt != null) {
const out = b.fmt("build/lib/{s}.wasm", .{name});
const sh = b.addSystemCommand(&.{ opt.?, "--enable-bulk-memory", "--enable-simd", "-O4" });
sh.addArtifactArg(bin);
sh.addArg("-o");
if (@hasDecl(@TypeOf(sh.*), "addFileSourceArg")) {
sh.addFileSourceArg(if (has_path) .{ .path = out } else b.path(out));
} else {
sh.addFileArg(if (has_path) .{ .path = out } else b.path(out));
}
b.getInstallStep().dependOn(&sh.step);
if (!entry) b.installArtifact(bin);
} else if (entry) {
b.getInstallStep().dependOn(&b.addInstallArtifact(bin, .{
.dest_dir = .{ .override = std.Build.InstallDir{ .lib = {} } },
}).step);
} else {
b.installArtifact(bin);
}
}
fn maybeStrip(
b: *std.Build,
artifact: *Step.Compile,
step: *std.Build.Step,
strip: ?bool,
cmd: ?[]const u8,
) void {
if (@hasDecl(@TypeOf(artifact.*), "strip")) artifact.strip = strip orelse false;
if (!(strip orelse false) or cmd == null) return;
// Using `strip -r -u` for dynamic libraries is supposed to work on macOS but doesn't...
const mac = builtin.os.tag == .macos;
if (mac and artifact.isDynamicLibrary()) return;
// Assuming GNU strip, which complains "illegal pathname found in archive member"...
if (!mac and artifact.isStaticLibrary()) return;
const sh = b.addSystemCommand(&.{ cmd.?, if (mac) "-x" else "-s" });
sh.addArtifactArg(artifact);
step.dependOn(&sh.step);
}
const Config = struct {
target: ResolvedTarget,
optimize: std.builtin.OptimizeMode,
pic: ?bool,
strip: ?bool,
cmd: ?[]const u8,
};
const TestStep = struct {
step: std.Build.Step,
build: bool,
pub fn create(b: *std.Build, options: *Step.Options, config: Config) *TestStep {
const coverage = b.option([]const u8, "test-coverage", "Generate test coverage");
const test_filter =
b.option([]const u8, "test-filter", "Skip tests that do not match filter");
const self = b.allocator.create(TestStep) catch @panic("OOM");
const step = std.Build.Step.init(.{ .id = .custom, .name = "Run all tests", .owner = b });
self.* = .{ .step = step, .build = test_filter == null };
const path = if (has_path) .{ .path = "src/lib/test.zig" } else b.path("src/lib/test.zig");
const tests = b.addTest(if (force_pic) .{
.root_source_file = path,
.optimize = config.optimize,
.target = config.target,
.filter = test_filter,
} else .{
.root_source_file = path,
.optimize = config.optimize,
.target = config.target,
.filter = test_filter,
.single_threaded = true,
.strip = config.strip,
.pic = config.pic,
});
(if (root_module) tests.root_module else tests).addOptions("build_options", options);
maybeStrip(b, tests, &tests.step, config.strip, config.cmd);
if (force_pic) {
tests.single_threaded = true;
if (config.pic orelse false) tests.force_pic = config.pic;
}
if (coverage) |c| {
tests.setExecCmd(&.{ "kcov", "--include-pattern=src/lib", c, null });
}
self.step.dependOn(&b.addRunArtifact(tests).step);
return self;
}
};
const ToolConfig = struct {
options: Options,
module: ?*std.Build.Module,
general: Config,
tool: struct {
tests: ?*TestStep,
name: ?[]const u8 = null,
exes: *std.ArrayList(*Step.Compile),
},
};
fn tool(b: *std.Build, path: []const u8, config: ToolConfig) !?*Step.Run {
if (!try exists(path)) return null;
var name = config.tool.name orelse std.fs.path.basename(path);
const index = std.mem.lastIndexOfScalar(u8, name, '.');
if (index) |i| name = name[0..i];
if (config.options.showdown orelse false) name = b.fmt("{s}-showdown", .{name});
const exe = b.addExecutable(if (force_pic) .{
.name = name,
.root_source_file = if (has_path) .{ .path = path } else b.path(path),
.target = config.general.target,
.optimize = config.general.optimize,
} else .{
.name = name,
.root_source_file = if (has_path) .{ .path = path } else b.path(path),
.target = config.general.target,
.optimize = config.general.optimize,
.single_threaded = true,
.strip = config.general.strip,
.pic = config.general.pic,
});
if (root_module) {
const import = if (config.module) |m| m else module(b, config.options);
exe.root_module.addImport("pkmn", import);
} else {
exe.addModule("pkmn", module(b, config.options));
}
if (force_pic) {
exe.single_threaded = true;
if (config.general.pic orelse false) exe.force_pic = config.general.pic;
}
if (config.tool.tests) |ts| ts.step.dependOn(&exe.step);
config.tool.exes.append(exe) catch @panic("OOM");
const run = b.addRunArtifact(exe);
maybeStrip(b, exe, &run.step, config.general.strip, config.general.cmd);
if (b.args) |args| run.addArgs(args);
return run;
}
fn exists(path: []const u8) !bool {
std.fs.cwd().access(path, .{}) catch |err| switch (err) {
error.FileNotFound => return false,
else => |e| return e,
};
return true;
}
const ToolsStep = struct {
step: std.Build.Step,
pub fn create(b: *std.Build, exes: *std.ArrayList(*Step.Compile)) *ToolsStep {
const self = b.allocator.create(ToolsStep) catch @panic("OOM");
const step = std.Build.Step.init(.{ .id = .custom, .name = "Install tools", .owner = b });
self.* = .{ .step = step };
for (exes.items) |t| self.step.dependOn(&b.addInstallArtifact(t, .{}).step);
return self;
}
};
fn detect(target: anytype) std.Target {
if (@hasField(@TypeOf(target), "result")) return target.result;
return (std.zig.system.NativeTargetInfo.detect(target) catch unreachable).target;
}
pub fn exports(b: *std.Build, bytes: []const u8) ![][]const u8 {
var symbols = std.ArrayList([]const u8).init(b.allocator);
var it = std.mem.splitSequence(u8, bytes, "export ");
_ = it.next();
while (it.next()) |s| {
if (std.mem.startsWith(u8, s, "const ")) {
const i = std.mem.indexOf(u8, s[6..], " ").?;
try symbols.append(s[6 .. 6 + i]);
} else { // "fn "
const i = std.mem.indexOf(u8, s[3..], "(").?;
try symbols.append(s[3 .. 3 + i]);
}
}
return symbols.items;
}