File: file.zig

package info (click to toggle)
gtksourceview5 5.18.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,780 kB
  • sloc: ansic: 71,161; xml: 1,493; javascript: 866; perl: 216; sh: 144; java: 49; php: 48; yacc: 45; ruby: 38; ml: 36; python: 33; sql: 30; makefile: 23; cobol: 20; objc: 19; lisp: 19; fortran: 14; awk: 9; cpp: 8
file content (22 lines) | stat: -rw-r--r-- 770 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/// for documentation
const std = @import("std");
const builtin = @import("builtin");
// comment line
const direction = enum { north, south, east, west };
const vec = struct { x: f32, y: f32, z: f32 };
pub fn main() !void {
    const array = [_]u8{ 1, 2, 3, 4, 5 };
    const multiline_string =
        \\one
        \\multiline
        \\string
    ;
    const my_vector = vec{
        .x = 123 + 0xff,
        .y = 1_000 + 0o755,
        .z = 0b11110000,
    };
    std.debug.print("Hello from " ++ "Zig {}\n", .{builtin.zig_version});
    std.debug.print("{d}\n", .{'\u{10ffff}'}); // maximum valid Unicode scalar value
    std.debug.print("slice:{any}\nstring:{s}\nenum: {s}\nstruct:{?}", .{ array[0..3], multiline_string, @tagName(direction.south), my_vector });
}