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

Types #2

Merged
merged 4 commits into from
Feb 19, 2022
Merged

Types #2

merged 4 commits into from
Feb 19, 2022

Conversation

djluck
Copy link
Owner

@djluck djluck commented Feb 15, 2022

Adding stronger validation of PromQL expressions, principally type checking which will allow consumers to validate the type an expression produces.

This has meant a lot of improvements:

  • Aggregate operator and function signatures are now defined in the library and parameter counts and types can be checked.
  • Binary expressions are now parsed with the (correct) associativeness: left associativeness.
  • Binary operators now have precedence associated with them and binary expressions are grouped according to this
  • Every expression can determine it's return type
  • Expression types preceeding offset expressions are now validated more carefully
  • Positions of parsed expressions from the source input are now available in all AST nodes

- Expressions now expose their types
- Defined function signatures (including argument + return types)
- Enforced requirement to expose `Location` information (will work on this in next commit)
- Updated parser + printer to use new `Function` type
…provide useful error messages when type checking
@djluck djluck merged commit 7fb857d into master Feb 19, 2022
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.

1 participant