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

Method load

expr/node.go:962–1001  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

960 return in
961}
962func (m *IdentityNode) load() {
963
964 if m.Quote != 0 {
965
966 // This is all deeply flawed, need to go fix it. Upgrade path will
967 // be sweep through and remove all usage of existing ones that used the flawed
968 // `left.right value` escape syntax assuming the period is a split
969
970 if strings.Contains(m.Text, "`.`") {
971 // this came in with quote which has been stripped by lexer
972 m.original = fmt.Sprintf("%s%s%s", string(m.Quote), m.Text, string(m.Quote))
973 m.left, m.right, _ = LeftRight(m.original)
974
975 //u.Debugf("branch1: l:%q r:%q original:%q text:%q", m.left, m.right, m.original, m.Text)
976
977 } else if strings.Contains(m.Text, "`.") || strings.Contains(m.Text, ".`") {
978
979 m.left, m.right, _ = LeftRight(m.Text)
980 l, r := IdentityMaybeQuote(m.Quote, m.left), IdentityMaybeQuote(m.Quote, m.right)
981 m.original = fmt.Sprintf("%s.%s", l, r)
982 m.left, m.right, _ = LeftRight(m.original)
983
984 //u.Debugf("branch2: l:%q r:%q original:%q text:%q", m.left, m.right, m.original, m.Text)
985
986 // this came in with quote which has been stripped by lexer
987 // m.original = fmt.Sprintf("%s%s%s", string(m.Quote), m.Text, string(m.Quote))
988 // m.left, m.right, _ = LeftRight(m.original)
989
990 } else {
991 // this came in with quote which has been stripped by lexer
992 m.original = fmt.Sprintf("%s%s%s", string(m.Quote), m.Text, string(m.Quote))
993 m.left, m.right, _ = LeftRight(m.original)
994
995 //u.Debugf("branch3: l:%q r:%q original:%q text:%q", m.left, m.right, m.original, m.Text)
996 }
997
998 } else {
999 m.left, m.right, _ = LeftRight(m.Text)
1000 }
1001}
1002func (m *IdentityNode) NodeType() string { return "Identity" }
1003func (m *IdentityNode) String() string {
1004 if m.original != "" {

Callers 3

NewIdentityNodeFunction · 0.95
NewIdentityNodeValFunction · 0.95
FromExprMethod · 0.95

Calls 2

LeftRightFunction · 0.85
IdentityMaybeQuoteFunction · 0.85

Tested by

no test coverage detected