Skip to content
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

Merged
merged 9 commits into from
Oct 17, 2019

Conversation

3timeslazy
Copy link
Member

@3timeslazy 3timeslazy commented Oct 9, 2019

Closes #286

Владимир Фетисов added 2 commits October 9, 2019 20:45
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To upper case?

Copy link
Member Author

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.

@ziflex
Copy link
Member

ziflex commented Oct 13, 2019

Does this PR supports namespaces and functions on both cases?

@3timeslazy
Copy link
Member Author

3timeslazy commented Oct 14, 2019

Does this PR supports namespaces and functions on both cases?

It doesn't for now

@3timeslazy 3timeslazy closed this Oct 14, 2019
@3timeslazy 3timeslazy reopened this Oct 14, 2019
@@ -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 {
Copy link
Member Author

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?

ferret/pkg/stdlib/lib.go

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

Copy link
Member

@ziflex ziflex left a 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? :)

@ziflex
Copy link
Member

ziflex commented Oct 17, 2019

Great job!

@ziflex ziflex merged commit 3aab1b4 into MontFerret:master Oct 17, 2019
@3timeslazy 3timeslazy deleted the feature/issue_#286 branch October 19, 2019 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make FQL keywords case-insensitive
2 participants