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

Fix insanely slow compilation #18410

Merged
merged 2 commits into from May 17, 2016

Conversation

Projects
None yet
3 participants
@rmuir
Copy link
Contributor

commented May 17, 2016

The issue is caused by too much ambiguity in the grammar, particularly the fact that semicolons aren't needed to separate statements.

Instead, just make the semicolon optional at the very end (in other words, EOF is equivalent). This means that very simple one liner cases like 5 or _score + log(doc['pagerank'].value) or whatever do not need semicolons. But you can't do int x = y int z = x + 5 return z anymore. I really don't think we should be allowing that anyway.

Closes #18398

@rmuir

This comment has been minimized.

Copy link
Contributor Author

commented May 17, 2016

Note that i'd really like to hook in stuff to fail on ambiguities in tests, but there are other ambiguity problems. Maybe dangling-else type stuff that is easily fixed. But that is not to do here: we have to keep the scope of this PR contained.

@jdconrad

This comment has been minimized.

Copy link
Contributor

commented May 17, 2016

LGTM. Thanks!

@rmuir

This comment has been minimized.

Copy link
Contributor Author

commented May 17, 2016

Thanks @jdconrad. I am sure this can be improved if we wish, e.g. to allow newlines too. But I think most users will not even have more than 1 line with painless because it works inline. It may be good enough to keep it simple like this. I will look into the other ambiguity...

@rmuir rmuir merged commit ee6d29b into elastic:master May 17, 2016

1 check passed

CLA Commit author is a member of Elasticsearch
Details

@clintongormley clintongormley changed the title painless: fix insanely slow compilation Fix insanely slow compilation May 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.