From 0572c3e048551e26b59c9268e667793b1a97a8b9 Mon Sep 17 00:00:00 2001 From: Azareal Date: Mon, 13 Nov 2017 00:36:31 +0000 Subject: [PATCH] Experimenting. --- query_gen/lib/utils.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/query_gen/lib/utils.go b/query_gen/lib/utils.go index c0f0dfcd..1f5ff85d 100644 --- a/query_gen/lib/utils.go +++ b/query_gen/lib/utils.go @@ -112,11 +112,12 @@ func (where *DBWhere) parseColumn(segment string, i int) int { var buffer string for ; i < len(segment); i++ { char := segment[i] - if ('a' <= char && char <= 'z') || ('A' <= char && char <= 'Z') || char == '.' || char == '_' { + switch { + case ('a' <= char && char <= 'z') || ('A' <= char && char <= 'Z') || char == '.' || char == '_': buffer += string(char) - } else if char == '(' { + case char == '(': return where.parseFunction(segment, buffer, i) - } else { + default: i-- where.Expr = append(where.Expr, DBToken{buffer, "column"}) return i