()
| 70 | func (fs *flagScanner) String() string { return string(fs.buf) } |
| 71 | |
| 72 | func (fs *flagScanner) Next() (byte, bool) { |
| 73 | c := byte('\000') |
| 74 | fs.ChangeFlag = false |
| 75 | if fs.Pos == fs.Length { |
| 76 | if fs.HasFlag { |
| 77 | fs.AppendString(fs.end) |
| 78 | } |
| 79 | return c, true |
| 80 | } else { |
| 81 | c = fs.str[fs.Pos] |
| 82 | if c == fs.flag { |
| 83 | if fs.Pos < (fs.Length-1) && fs.str[fs.Pos+1] == fs.flag { |
| 84 | fs.HasFlag = false |
| 85 | fs.AppendChar(fs.flag) |
| 86 | fs.Pos += 2 |
| 87 | return fs.Next() |
| 88 | } else if fs.Pos != fs.Length-1 { |
| 89 | if fs.HasFlag { |
| 90 | fs.AppendString(fs.end) |
| 91 | } |
| 92 | fs.AppendString(fs.start) |
| 93 | fs.ChangeFlag = true |
| 94 | fs.HasFlag = true |
| 95 | } |
| 96 | } |
| 97 | } |
| 98 | fs.Pos++ |
| 99 | return c, false |
| 100 | } |
| 101 | |
| 102 | var cDateFlagToGo = map[byte]string{ |
| 103 | 'a': "mon", 'A': "Monday", 'b': "Jan", 'B': "January", 'c': "02 Jan 06 15:04 MST", 'd': "02", |
no test coverage detected