format::desktop_entry: Line formatting now compiles

This commit is contained in:
Sasha Koshka 2024-10-22 13:17:02 -04:00
parent 34f1864d5f
commit 0bfa8f6914

View File

@ -1,4 +1,5 @@
use fmt; use fmt;
use io;
use locale; use locale;
use strings; use strings;
@ -46,9 +47,9 @@ export fn entry_finish(entr: entry) void = {
// Formats a [[line]] and writes it to an [[io::handle]]. // Formats a [[line]] and writes it to an [[io::handle]].
export fn fprint(output: io::handle, lin: line) (size | io::error) = match (lin) { export fn fprint(output: io::handle, lin: line) (size | io::error) = match (lin) {
case blank => yield fmt::fprintln(output, lin); case blank => yield fmt::fprintln(output);
case let lin: comment => yield fmt::fprintf(output, "#{}\n", lin: string); case let lin: comment => yield fmt::fprintf(output, "#{}\n", lin: str);
case let lin: group_header => yield fmt::fprintf(output, "[{}]\n", lin: string); case let lin: group_header => yield fmt::fprintf(output, "[{}]\n", lin: str);
case let lin: entry => case let lin: entry =>
let wrote = fmt::print(lin.key)?; let wrote = fmt::print(lin.key)?;
if (!locale::equal(locale::c, lin.locale)) { if (!locale::equal(locale::c, lin.locale)) {