mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-18 15:31:32 +03:00
update readme
This commit is contained in:
parent
7ae351c0c6
commit
bba5396cfd
31
README.md
31
README.md
@ -545,6 +545,37 @@ test function expect_fail() {
|
||||
}
|
||||
```
|
||||
|
||||
## Macros
|
||||
|
||||
Leo supports `println!`, `debug!`, and `error!` macros.
|
||||
|
||||
Macros support string formatting arguments `[macro]!("{} {}", [argument_1], [argument_2])`
|
||||
|
||||
#### `println!`
|
||||
Directly calls the `println!` macro in rust.
|
||||
```js
|
||||
function main(a: u32) {
|
||||
println!("a is {}", a);
|
||||
}
|
||||
```
|
||||
|
||||
#### `debug!`
|
||||
Enabled by specifying the `-d` flag after a Leo command.
|
||||
```js
|
||||
function main(a: u32) {
|
||||
debug!("a is {}", a);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
#### `error!`
|
||||
Halts program execution and prints to console.
|
||||
```js
|
||||
function main(a: u32) {
|
||||
error!("a is {}", a);
|
||||
}
|
||||
```
|
||||
|
||||
# Leo Inputs
|
||||
|
||||
Private inputs for a Leo program are specified in the `inputs/` directory. The syntax for an input file is a limited subset of the Leo program syntax. The default inputs file is `inputs/inputs.leo`.
|
||||
|
Loading…
Reference in New Issue
Block a user