mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-07 22:55:00 +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
|
## 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!`:
|
Here is an example of a snapshot file for a roc program that prints `Hello world!`:
|
||||||
|
|
||||||
```txt
|
```txt
|
||||||
~~~META
|
# META
|
||||||
|
~~~ini
|
||||||
description=Hello world
|
description=Hello world
|
||||||
type=file
|
type=file
|
||||||
~~~SOURCE
|
~~~
|
||||||
|
# SOURCE
|
||||||
|
~~~roc
|
||||||
app [main!] { pf: platform "../basic-cli/platform.roc" }
|
app [main!] { pf: platform "../basic-cli/platform.roc" }
|
||||||
|
|
||||||
import pf.Stdout
|
import pf.Stdout
|
||||||
|
@ -20,10 +23,13 @@ main! = |_| Stdout.line!("Hello, world!")
|
||||||
And another which represents a single expression of a list:
|
And another which represents a single expression of a list:
|
||||||
|
|
||||||
```txt
|
```txt
|
||||||
~~~META
|
# META
|
||||||
|
~~~ini
|
||||||
description=List with integer literals
|
description=List with integer literals
|
||||||
type=expr
|
type=expr
|
||||||
~~~SOURCE
|
~~~
|
||||||
|
# SOURCE
|
||||||
|
~~~roc
|
||||||
[1, 2, 3]
|
[1, 2, 3]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue