Commit 032c80d
feat: enhance REPL with value printing and formatting
Enhanced the WokeLang REPL to display evaluation results with proper formatting.
Features:
- Pretty-print all value types (Int, Float, String, Bool, Array, Record, Okay, Oops)
- Skip printing Unit values (no output for statements)
- Formatted arrays: [1, 2, 3]
- Formatted records: { key: value }
- Result type formatting: Okay(42), Oops("error")
- Function/channel display: <function>, <channel>
REPL Usage:
- Run: `woke repl`
- Type expressions or statements interactively
- Results displayed immediately
- exit/quit or Ctrl+D to exit
- History support via rustyline
Main.rs already supports:
- `woke repl` - Interactive REPL
- `woke <file.woke>` - Run program
- `woke --tokenize <file>` - Show tokens
- `woke --parse <file>` - Show AST
- `woke --typecheck <file>` - Type check only
Progress Update:
- REPL: 60% → 90% complete
- Overall project: 80% → 82% complete
Next:
- Aggregate-library integration
- Linter implementation
- Containerization
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 95d3283 commit 032c80d
1 file changed
Lines changed: 28 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
81 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
82 | 107 | | |
83 | 108 | | |
84 | 109 | | |
| |||
0 commit comments