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

filters: fix the precedence of ';' #122

Merged
merged 2 commits into from
May 23, 2024

Conversation

MrAnno
Copy link
Member

@MrAnno MrAnno commented May 23, 2024

In 6d74e60, the precedence of ';' has implicitly changed for filter rules, changing the meaning of filter expressions:

The expression not program("a"); message("b"); should have the following interpretation: (not program("a")) and message("b").

Due to accidentally changed precedence of ';', currently it is interpreted as not (message("a") and message("b")).

This patch recovers the original precedence, but also introduces precedence and left associativity for other semicolon-separated rules.

All the other (non-filter) uses of the ';' token are unambiguous, so this declaration won't interfere with those rules.

Related issue syslog-ng/syslog-ng#4980

MrAnno and others added 2 commits May 23, 2024 12:50
In 6d74e60, the precedence of ';' has
implicitly changed for filter rules, changing the meaning of filter
expressions:

The expression `not program("a"); message("b");` should have the following
interpretation: `(not program("a")) and message("b")`.

Due to accidentally changed precedence of ';', currently it is interpreted
as `not (message("a") and message("b"))`.

This patch recovers the original precedence, but also introduces
precedence and left associativity for other semicolon-separated rules.

All the other (non-filter) uses of the ';' token are unambiguous, so this
declaration won't interfere with those rules.

Signed-off-by: László Várady <laszlo.varady@anno.io>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
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.

2 participants