Skip to content

Commit

Permalink
Update defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
pedropark99 committed Sep 6, 2024
1 parent 05dbc24 commit f3b05f4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion Chapters/02-debugging.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ syntax-definition: "../Assets/zig.xml"
#| include: false
source("../zig_engine.R")
knitr::opts_chunk$set(
auto_main=TRUE
auto_main = FALSE,
build_type = "lib"
)
```


# Debugging Zig applications

Being able to debug your programs is essential to any programmer who wants to
Expand Down Expand Up @@ -81,6 +83,7 @@ with the `d` format specifier.

```{zig}
#| auto_main: false
#| build_type: "run"
const std = @import("std");
const stdout = std.io.getStdOut().writer();
fn add(x: u8, y: u8) u8 {
Expand All @@ -101,6 +104,7 @@ call with the function `std.debug.print()`. Like this:

```{zig}
#| auto_main: false
#| build_type: "run"
const std = @import("std");
fn add(x: u8, y: u8) u8 {
return x + y;
Expand Down Expand Up @@ -156,6 +160,7 @@ piece of Zig code:

```{zig}
#| auto_main: false
#| build_type: "run"
const std = @import("std");
const stdout = std.io.getStdOut().writer();
Expand Down
Loading

0 comments on commit f3b05f4

Please sign in to comment.