june ha revisionato questo gist 4 days ago. Vai alla revisione
1 file changed, 29 insertions
command.nv(file creato)
| @@ -0,0 +1,29 @@ | |||
| 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 | |
Più nuovi
Più vecchi