command.nv
· 636 B · Text
Исходник
Playground
|:: read a line? :@stdio: (10 $x)|
:@stdio: 10
:buffer: $x
|:: read a line :@stdio: 10|
|:: read a line?|
:@stdio: read
|:: print the buffer? :buffer: $x|
:@stdio: write $x
|:: print the buffer|
:@stdio: write 10
|:: skip leading whitespace? :buffer: 10 |
|:: skip leading whitespace? :buffer: 9 |
|:: skip leading whitespace? :buffer: ' '|
|:: skip leading whitespace|
|:: parse a command :buffer: "quit"|
:quit:
|:: parse a command :buffer: "say"|
:: skip leading whitespace
:: print the buffer
|:: command loop :quit:|
|:: command loop?|
:: read a line
:: parse a command
||:: command loop
| 1 | |:: read a line? :@stdio: (10 $x)| |
| 2 | :@stdio: 10 |
| 3 | :buffer: $x |
| 4 | |:: read a line :@stdio: 10| |
| 5 | |:: read a line?| |
| 6 | :@stdio: read |
| 7 | |
| 8 | |:: print the buffer? :buffer: $x| |
| 9 | :@stdio: write $x |
| 10 | |:: print the buffer| |
| 11 | :@stdio: write 10 |
| 12 | |
| 13 | |:: skip leading whitespace? :buffer: 10 | |
| 14 | |:: skip leading whitespace? :buffer: 9 | |
| 15 | |:: skip leading whitespace? :buffer: ' '| |
| 16 | |:: skip leading whitespace| |
| 17 | |
| 18 | |:: parse a command :buffer: "quit"| |
| 19 | :quit: |
| 20 | |:: parse a command :buffer: "say"| |
| 21 | :: skip leading whitespace |
| 22 | :: print the buffer |
| 23 | |
| 24 | |:: command loop :quit:| |
| 25 | |:: command loop?| |
| 26 | :: read a line |
| 27 | :: parse a command |
| 28 | |
| 29 | ||:: command loop |