Commit 05deec6
committed
Change
* Current `bin/prism lex` becomes `bin/prism lex_compat`
* Change `bin/prism lex` to only output prism tokens
I sometimes find myself wanting to look at tokens but on the cli
it only compares against other sources. Then I check the code and see that that `VERBOSE=1`
does something but the output isn't very readable
and doesn't fit on my terminal screen.
The new output looks like this:
```
$ bin/prism lex -e "foo(1, BAR, baz, 'bat')"
IDENTIFIER (1,0)-(1,3) "foo"
PARENTHESIS_LEFT (1,3)-(1,4) "("
INTEGER (1,4)-(1,5) "1"
COMMA (1,5)-(1,6) ","
CONSTANT (1,7)-(1,10) "BAR"
COMMA (1,10)-(1,11) ","
IDENTIFIER (1,12)-(1,15) "baz"
COMMA (1,15)-(1,16) ","
STRING_BEGIN (1,17)-(1,18) "'"
STRING_CONTENT (1,18)-(1,21) "bat"
STRING_END (1,21)-(1,22) "'"
PARENTHESIS_RIGHT (1,22)-(1,23) ")"
EOF (1,23)-(1,23) ""
```bin/prism lex, add bin/prism lex_compat
1 parent 2ecd49d commit 05deec6
1 file changed
+17
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
195 | 197 | | |
196 | 198 | | |
197 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
198 | 215 | | |
199 | 216 | | |
200 | 217 | | |
| |||
0 commit comments