mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-07 14:44:59 +00:00
update .rules for new snapshot format
This commit is contained in:
parent
c67630533f
commit
486842f655
1 changed files with 11 additions and 5 deletions
16
.rules
16
.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 -- <file_path>`. 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 -- <file_path>`. 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]
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue