()
| 67 | } |
| 68 | |
| 69 | func (t token) String() string { |
| 70 | switch t.typ { |
| 71 | case tokenEOF: |
| 72 | return "EOF" |
| 73 | case tokenError: |
| 74 | return fmt.Sprintf("{err:%q at pos: %d}", t.val, t.start) |
| 75 | } |
| 76 | return fmt.Sprintf("{t:%v,%q (col: %d)}", t.typ, t.val, t.start) |
| 77 | } |
| 78 | |
| 79 | type lexer struct { |
| 80 | input string |
no outgoing calls