Skip to content

Commit f5719ae

Browse files
authored
Merge pull request #3465 from thetarnav/fmt-printfln-js
Add printfln and eprintfln procs to fmt_js.odin
2 parents caa8863 + 2a70fac commit f5719ae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/fmt/fmt_js.odin

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ print :: proc(args: ..any, sep := " ", flush := true) -> int { return wprint(w
3737
println :: proc(args: ..any, sep := " ", flush := true) -> int { return wprintln(w=stdout, args=args, sep=sep, flush=flush) }
3838
// printf formats according to the specififed format string and writes to stdout
3939
printf :: proc(fmt: string, args: ..any, flush := true) -> int { return wprintf(stdout, fmt, ..args, flush=flush) }
40+
// printfln formats according to the specified format string and writes to stdout, followed by a newline.
41+
printfln :: proc(fmt: string, args: ..any, flush := true) -> int { return wprintf(stdout, fmt, ..args, flush=flush, newline=true) }
4042

4143
// eprint formats using the default print settings and writes to stderr
4244
eprint :: proc(args: ..any, sep := " ", flush := true) -> int { return wprint(w=stderr, args=args, sep=sep, flush=flush) }
4345
// eprintln formats using the default print settings and writes to stderr
4446
eprintln :: proc(args: ..any, sep := " ", flush := true) -> int { return wprintln(w=stderr, args=args, sep=sep, flush=flush) }
4547
// eprintf formats according to the specififed format string and writes to stderr
4648
eprintf :: proc(fmt: string, args: ..any, flush := true) -> int { return wprintf(stderr, fmt, ..args, flush=flush) }
49+
// eprintfln formats according to the specified format string and writes to stderr, followed by a newline.
50+
eprintfln :: proc(fmt: string, args: ..any, flush := true) -> int { return wprintf(stdout, fmt, ..args, flush=flush, newline=true) }

0 commit comments

Comments
 (0)