Zuletzt aktiv 4 days ago

A simple command parser.

Änderung 8fb8f57ac77d1f1bddd6b155e820f7f7987d9bc4

command.nv Originalformat Playground
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