Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
43
Task/Naming-conventions/Zig/naming-conventions.zig
Normal file
43
Task/Naming-conventions/Zig/naming-conventions.zig
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
const namespace_name = @import("dir_name/file_name.zig");
|
||||
const TypeName = @import("dir_name/TypeName.zig");
|
||||
var global_var: i32 = undefined;
|
||||
const const_name = 42;
|
||||
const primitive_type_alias = f32;
|
||||
const string_alias = []u8;
|
||||
|
||||
const StructName = struct {
|
||||
field: i32,
|
||||
};
|
||||
const StructAlias = StructName;
|
||||
|
||||
fn functionName(param_name: TypeName) void {
|
||||
var functionPointer = functionName;
|
||||
functionPointer();
|
||||
functionPointer = otherFunction;
|
||||
functionPointer();
|
||||
}
|
||||
const functionAlias = functionName;
|
||||
|
||||
fn ListTemplateFunction(comptime ChildType: type, comptime fixed_size: usize) type {
|
||||
return List(ChildType, fixed_size);
|
||||
}
|
||||
|
||||
fn ShortList(comptime T: type, comptime n: usize) type {
|
||||
return struct {
|
||||
field_name: [n]T,
|
||||
fn methodName() void {}
|
||||
};
|
||||
}
|
||||
|
||||
// The word XML loses its casing when used in Zig identifiers.
|
||||
const xml_document =
|
||||
\\<?xml version="1.0" encoding="UTF-8"?>
|
||||
\\<document>
|
||||
\\</document>
|
||||
;
|
||||
const XmlParser = struct {
|
||||
field: i32,
|
||||
};
|
||||
|
||||
// The initials BE (Big Endian) are just another word in Zig identifier names.
|
||||
fn readU32Be() u32 {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue