MCPcopy Index your code
hub / github.com/yuin/gopher-lua / Next

Method Next

utils.go:72–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70func (fs *flagScanner) String() string { return string(fs.buf) }
71
72func (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
102var cDateFlagToGo = map[byte]string{
103 'a': "mon", 'A': "Monday", 'b': "Jan", 'B': "January", 'c': "02 Jan 06 15:04 MST", 'd': "02",

Callers 1

strftimeFunction · 0.45

Calls 2

AppendStringMethod · 0.95
AppendCharMethod · 0.95

Tested by

no test coverage detected