| 1 | //go:build ignore |
| 2 | // +build ignore |
| 3 | |
| 4 | package main |
| 5 | |
| 6 | import ( |
| 7 | "fmt" |
| 8 | "os" |
| 9 | |
| 10 | tcellterm "git.sr.ht/~rockorager/tcell-term" |
| 11 | ) |
| 12 | |
| 13 | func main() { |
| 14 | fmt.Println("----- tcell-term parser example -----") |
| 15 | fmt.Println("reading from stdin") |
| 16 | parser := tcellterm.NewParser(os.Stdin) |
| 17 | for { |
| 18 | seq := parser.Next() |
| 19 | fmt.Printf("%s\n", seq) |
| 20 | switch seq.(type) { |
| 21 | case tcellterm.EOF: |
| 22 | return |
| 23 | } |
| 24 | |
| 25 | } |
| 26 | } |