diff --git a/.rules b/.rules index 97ba9d9c0b..a551508541 100644 --- a/.rules +++ b/.rules @@ -1,15 +1,18 @@ ## Roc snapshot tool -The Roc compiler uses golden snapshots to assist with debugging and verification of the compiler's behavior. The snapshots are generated by running `zig build snapshot`, and individual files can be generated using `zig build snapshot -- `. For example, to generate a snapshot for the file `src/snapshots/can_two_decls.txt`, run: `zig build snapshot -- src/snapshots/can_two_decls.txt`. +The Roc compiler uses golden snapshots to assist with debugging and verification of the compiler's behavior. The snapshots are generated by running `zig build snapshot`, and individual files can be generated using `zig build snapshot -- `. For example, to generate a snapshot for the file `src/snapshots/can_two_decls.md`, run: `zig build snapshot -- src/snapshots/can_two_decls.md`. Here is an example of a snapshot file for a roc program that prints `Hello world!`: ```txt -~~~META +# META +~~~ini description=Hello world type=file -~~~SOURCE +~~~ +# SOURCE +~~~roc app [main!] { pf: platform "../basic-cli/platform.roc" } import pf.Stdout @@ -20,10 +23,13 @@ main! = |_| Stdout.line!("Hello, world!") And another which represents a single expression of a list: ```txt -~~~META +# META +~~~ini description=List with integer literals type=expr -~~~SOURCE +~~~ +# SOURCE +~~~roc [1, 2, 3] ```