Skip to content

Commit 5d2d846

Browse files
committed
Update schema
1 parent 05f8b84 commit 5d2d846

File tree

2 files changed

+38
-9
lines changed

2 files changed

+38
-9
lines changed

pdl-live-react/src/pdl_ast.d.ts

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2917,9 +2917,8 @@ export interface Defs3 {
29172917
*
29182918
* Example:
29192919
* ```PDL
2920-
* - def: N
2921-
* lang: python
2922-
* code: |
2920+
* lang: python
2921+
* code: |
29232922
* import random
29242923
* # (In PDL, set `result` to the output you wish for your code block.)
29252924
* result = random.randint(1, 20)
@@ -3201,11 +3200,12 @@ export interface Defs7 {
32013200
*
32023201
* Example:
32033202
* ```PDL
3204-
* - if: ${ eval == 'no' }
3205-
* then:
3206-
* text:
3207-
* - read:
3208-
* message: "Why not?\n"
3203+
* defs:
3204+
* answer:
3205+
* read:
3206+
* message: "Enter a number? "
3207+
* if: ${ (answer | int) == 42 }
3208+
* then: You won!
32093209
* ```
32103210
*/
32113211
export interface IfBlock {
@@ -3270,6 +3270,23 @@ export interface Defs8 {
32703270
}
32713271
/**
32723272
* Match control structure.
3273+
*
3274+
* Example:
3275+
* ```PDL
3276+
* defs:
3277+
* answer:
3278+
* read:
3279+
* message: "Enter a number? "
3280+
* match: ${ (answer | int) }
3281+
* with:
3282+
* - case: 42
3283+
* then: You won!
3284+
* - case:
3285+
* any:
3286+
* def: x
3287+
* if: ${ x > 42 }
3288+
* then: Too high
3289+
* - then: Too low
32733290
*/
32743291
export interface MatchBlock {
32753292
description?: Description9
@@ -3706,6 +3723,18 @@ export interface Defs15 {
37063723
}
37073724
/**
37083725
* Read from a file or standard input.
3726+
*
3727+
* Example. Read from the standard input with a prompt starting with `> `.
3728+
* ```PDL
3729+
* read:
3730+
* message: "> "
3731+
* ```
3732+
*
3733+
* Example. Read the file `./data.yaml` in the same directory of the PDL file containing the block and parse it into YAML.
3734+
* ```PDL
3735+
* read: ./data.yaml
3736+
* parser: yaml
3737+
* ```
37093738
*/
37103739
export interface ReadBlock {
37113740
description?: Description16

src/pdl/pdl-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9208,7 +9208,7 @@
92089208
},
92099209
"ReadBlock": {
92109210
"additionalProperties": false,
9211-
"description": "Read from a file or standard input.",
9211+
"description": "Read from a file or standard input.\n\nExample. Read from the standard input with a prompt starting with `> `.\n```PDL\nread:\nmessage: \"> \"\n```\n\nExample. Read the file `./data.yaml` in the same directory of the PDL file containing the block and parse it into YAML.\n```PDL\nread: ./data.yaml\nparser: yaml\n```",
92129212
"properties": {
92139213
"description": {
92149214
"anyOf": [

0 commit comments

Comments
 (0)