-
-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make FQL keywords case-insensitive #393
Conversation
@@ -12,7 +13,11 @@ type Parser struct { | |||
|
|||
func New(query string) *Parser { | |||
input := antlr.NewInputStream(query) | |||
lexer := fql.NewFqlLexer(input) | |||
// converts tokens to upper case, so now it doesn’t matter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To upper case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. You can type key-words in any case because they all will be converted to upper case before parsing.
Does this PR supports namespaces and functions on both cases? |
It doesn't for now |
pkg/stdlib/datetime/lib.go
Outdated
@@ -2,8 +2,8 @@ package datetime | |||
|
|||
import "github.com/MontFerret/ferret/pkg/runtime/core" | |||
|
|||
func NewLib() map[string]core.Function { | |||
return map[string]core.Function{ | |||
func NewLib() core.FunctionsMap { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why RegisterLib
function doesn't register datetime
fucntions?
Lines 15 to 45 in e960121
func RegisterLib(ns core.Namespace) error { | |
if err := types.RegisterLib(ns); err != nil { | |
return err | |
} | |
if err := strings.RegisterLib(ns); err != nil { | |
return err | |
} | |
if err := math.RegisterLib(ns); err != nil { | |
return err | |
} | |
if err := collections.RegisterLib(ns); err != nil { | |
return err | |
} | |
if err := arrays.RegisterLib(ns); err != nil { | |
return err | |
} | |
if err := objects.RegisterLib(ns); err != nil { | |
return err | |
} | |
if err := html.RegisterLib(ns); err != nil { | |
return err | |
} | |
return utils.RegisterLib(ns) | |
} |
Looks like a bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! But what about unit tests? :)
Great job! |
Closes #286