diff options
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/il.ha | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -10,11 +10,26 @@ use io; export fn main() void = { const scanner = bufio::newscanner(os::stdin); defer bufio::finish(&scanner); + let items: []str = []; for (let line: const str => bufio::scan_line(&scanner)!) { append(items, strings::dup(line)); }; defer strings::freeall(items); + + // static slice allocation + //let buf: [1024]str = [""...]; + //let items = buf[..0]; + //for (let line: const str => bufio::scan_line(&scanner)!) { + // match (static append(items, strings::dup(line))) { + // case void => + // void; + // case nomem => + // fmt::fatal("Error: too many items"); + // }; + //}; + //defer for (let s .. items) free(s); + const state = tui::init()!; defer tui::finish(&state); let li = list::newscrolllist( |
