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

Dictonary constructor literal for expressions and declarations #281

Open
pepov opened this issue Sep 13, 2024 · 1 comment
Open

Dictonary constructor literal for expressions and declarations #281

pepov opened this issue Sep 13, 2024 · 1 comment
Labels
bug Something isn't working filterx

Comments

@pepov
Copy link
Member

pepov commented Sep 13, 2024

AxoSyslog

Version of AxoSyslog

4.8.1

Platform

Linux

Issue

Failure

The dictionary constructor literal does not work inside expressions and in a declare statement

Steps to reproduce

# example 1: ternary
$meta = isset(meta) ? meta : {};

The error in this case:

Error parsing filterx expression: syntax error, unexpected '{'

In /usr/share/syslog-ng/include/...
88        filterx {
89          $vars = vars();
90---->     $meta = isset(meta) ? meta : {};
90---->                                  ^
91
# example 2: declare
declare meta = {};
@pepov pepov added bug Something isn't working filterx labels Sep 13, 2024
@alltilla
Copy link
Member

declare meta = {}; now works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working filterx
Projects
None yet
Development

No branches or pull requests

2 participants