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

Add tests for precedence and associativity? #2

Open
eed3si9n opened this issue Nov 29, 2024 · 3 comments
Open

Add tests for precedence and associativity? #2

eed3si9n opened this issue Nov 29, 2024 · 3 comments

Comments

@eed3si9n
Copy link

https://doc.biscuitsec.org/reference/specifications

Given that binary_op_expression is the central point of complexity, it might be good to add tests for corner cases to test operator precedence so if we want, we can start refactoring rules around it?

@divarvel
Copy link
Collaborator

divarvel commented Nov 29, 2024

yes, there is a shocking lack of tests for now (operator precedence / assoc is tested a bit here: https://github.com/biscuit-auth/tree-sitter-biscuit/blob/main/test/corpus/rules-expr.txt#L5 )

I have added some in #1 but more would be welcome.

Before refactoring things, the first objective would be proper parsing of method calls, which are conflicting with predicates (it’s not a conflict detected by tree-sitter , but method calls are identified as predicates during parsing)

@eed3si9n
Copy link
Author

Before refactoring things...

Could you create an issue for that plz? A repro example would be helpful.

@divarvel
Copy link
Collaborator

#3 showcases the issue in the v5 branch

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

No branches or pull requests

2 participants