()
| 60 | } |
| 61 | |
| 62 | func (l *usageLexer) Next() bool { |
| 63 | l.skipSpaces() |
| 64 | if !l.valid { |
| 65 | return false |
| 66 | } |
| 67 | switch l.curLine[0] { |
| 68 | case '{', '}', '|', '[', ']', ',': |
| 69 | l.cutToken(1, true) |
| 70 | return true |
| 71 | } |
| 72 | |
| 73 | t := tokenRe.FindString(l.curLine) |
| 74 | if len(t) > 0 { |
| 75 | l.cutToken(len(t), false) |
| 76 | return true |
| 77 | } |
| 78 | l.abort(fmt.Errorf("cannot tokenize: %v", l.curLine)) |
| 79 | return false |
| 80 | } |
| 81 | |
| 82 | func (l *usageLexer) Token() string { |
| 83 | return l.curToken |
no test coverage detected