Skip to content

Dictonary constructor literal for expressions and declarations #281

@pepov

Description

@pepov

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 = {};

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfilterx

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions