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

AQL: More pseudo keywords #2055

Merged
merged 7 commits into from
Sep 16, 2019
Merged

Conversation

Simran-B
Copy link
Contributor

As a follow up to #2047, I want to add some more pseudo-keywords:

  • COUNT: COLLECT … WITH COUNT INTO …
  • CURRENT: array[* FILTER CURRENT.value == 1 RETURN CURRENT]
  • KEEP: COLLECT … INTO … KEEP …
  • PRUNE: FOR v IN 1..5 OUTBOUND "verts/1" edges PRUNE conditions …

I tried to avoid false-positives by detecting COUNT based on the surrounding keywords, but this is in exchange for false-negatives (it won't be detected if comments are inserted in between, which is unlikely however).

For OPTIONS I attempted something similar (it must be followed by an object literal, variables/expressions are not excepted in this position) , but I'm not sure if it's worth it. Let me know what you think.

@RunDevelopment
Copy link
Member

it won't be detected if comments are inserted in between, which is unlikely however

This is one of the most common types of false negatives in Prism, so I wouldn't worry too much about it. As you said, it's unlikely to occur.

Regarding OPTIONS: I think your solution is fine.

I think that language definition is ready to merge but we'll have to adjust the tests before that. Please add your new keywords to the keyword test. (More infos on test files.)

@Simran-B
Copy link
Contributor Author

Cool, will add the tests, probably tomorrow.

@Simran-B
Copy link
Contributor Author

@RunDevelopment I added some more tests

Copy link
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

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

LGTM!

@RunDevelopment RunDevelopment merged commit 899574e into PrismJS:master Sep 16, 2019
@Simran-B Simran-B deleted the aql-pseudo-keywords branch October 16, 2019 09:50
monotykamary added a commit to monotykamary/vscode-aql that referenced this pull request Nov 21, 2019
queryShowcase test query was taken from
PrismJS/prism#2055 (reference from Simran-B)
monotykamary added a commit to monotykamary/vscode-aql that referenced this pull request Nov 21, 2019
queryShowcase test query was taken from
PrismJS/prism#2055 (reference from Simran-B)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants