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

Function LexSelectList

lex/lexer.go:1781–1801  ·  view source on GitHub ↗

Handle repeating Select List for columns SELECT := [, ]* :== ( | | '*' ) [AS ] [IF ] [ ] Note, our Columns support a non-standard IF guard at a per column basis

(l *Lexer)

Source from the content-addressed store, hash-verified

1779// Note, our Columns support a non-standard IF guard at a per column basis
1780//
1781func LexSelectList(l *Lexer) StateFn {
1782 l.SkipWhiteSpaces()
1783 if l.IsEnd() {
1784 return nil
1785 }
1786 word := strings.ToLower(l.PeekWord())
1787 //u.Debugf("LexSelectList looking for operator: word=%q", word)
1788 switch word {
1789 case "as":
1790 l.ConsumeWord(word)
1791 l.Emit(TokenAs)
1792 l.Push("LexSelectList", LexSelectList)
1793 return LexIdentifier
1794 case "if":
1795 l.skipX(2)
1796 l.Emit(TokenIf)
1797 l.Push("LexSelectList", LexSelectList)
1798 return LexExpression
1799 }
1800 return LexExpression
1801}
1802
1803// Handle Source References ie [From table], [SubSelects], Joins
1804//

Callers

nothing calls this directly

Calls 7

SkipWhiteSpacesMethod · 0.80
PeekWordMethod · 0.80
ConsumeWordMethod · 0.80
EmitMethod · 0.80
PushMethod · 0.80
skipXMethod · 0.80
IsEndMethod · 0.65

Tested by

no test coverage detected