Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

locStr

Convert an aro.Source.Location to a 'file:line:column' string.

Translator.locStr
pub fn locStr(t: *Translator, loc: aro.Source.Location) ![]const u8

File

lib/compiler/translate-c/Translator.zig:154

Code

pub fn locStr(t: *Translator, loc: aro.Source.Location) ![]const u8 {
    const expanded = loc.expand(t.comp);
    const filename = expanded.path;

    const line = expanded.line_no;
    const col = expanded.col;

    return std.fmt.allocPrint(t.arena, "{s}:{d}:{d}", .{ filename, line, col });
}