MCPcopy Create free account
hub / github.com/araddon/qlbridge / Peek

Method Peek

expr/parse.go:137–151  ·  view source on GitHub ↗

Peek returns but does not consume the next token.

()

Source from the content-addressed store, hash-verified

135
136// Peek returns but does not consume the next token.
137func (m *LexTokenPager) Peek() lex.Token {
138 if len(m.tokens) <= m.cursor+1 && !m.done {
139 m.lexNext()
140 }
141 if len(m.tokens) < 2 {
142 m.lexNext()
143 }
144 if len(m.tokens) == m.cursor+1 {
145 return m.tokens[m.cursor]
146 }
147 if m.cursor == -1 {
148 return m.tokens[1]
149 }
150 return m.tokens[m.cursor+1]
151}
152
153// Tree is the representation of a single parsed expression
154type tree struct {

Callers

nothing calls this directly

Calls 1

lexNextMethod · 0.95

Tested by

no test coverage detected