Skip to content

Commit

Permalink
improve format
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zhengda committed Dec 16, 2024
1 parent 29c6a92 commit 06a308b
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions sqllexer_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,45 +256,25 @@ func isProcedure(token *Token) bool {
if token.Type != IDENT {
return false
}
if token.Value == "PROCEDURE" || token.Value == "procedure" || token.Value == "Procedure" || token.Value == "PROC" || token.Value == "proc" || token.Value == "Proc" {
return true
}

return false
return token.Value == "PROCEDURE" || token.Value == "procedure" || token.Value == "Procedure" || token.Value == "PROC" || token.Value == "proc" || token.Value == "Proc"
}

func isBoolean(ident string) bool {
// allocation free fast path for common cases
if ident == "true" || ident == "false" || ident == "TRUE" || ident == "FALSE" || ident == "True" || ident == "False" {
return true
}

return false
return ident == "true" || ident == "false" || ident == "TRUE" || ident == "FALSE" || ident == "True" || ident == "False"
}

func isNull(ident string) bool {
// allocation free fast path for common cases
if ident == "null" || ident == "NULL" || ident == "Null" {
return true
}

return false
return ident == "null" || ident == "NULL" || ident == "Null"
}

func isWith(ident string) bool {
if ident == "WITH" || ident == "with" || ident == "With" {
return true
}

return false
return ident == "WITH" || ident == "with" || ident == "With"
}

func isAs(ident string) bool {
if ident == "AS" || ident == "as" || ident == "As" {
return true
}

return false
return ident == "AS" || ident == "as" || ident == "As"
}

func isJsonOperator(token *Token) bool {
Expand Down

0 comments on commit 06a308b

Please sign in to comment.