[prev in list] [next in list] [prev in thread] [next in thread] 

List:       syslog-ng
Subject:    Re: [syslog-ng] [PATCH 1/3] value-pairs: Type hinting support
From:       Gergely Nagy <algernon () balabit ! hu>
Date:       2012-11-22 12:40:31
Message-ID: 87624xyfnk.fsf () algernon ! balabit
[Download RAW message or body]

Balazs Scheidler <bazsi77@gmail.com> writes:

>> +template_content
>> +               : string                                                 { $$.str = $1; $$.typehint =
>> NULL; } +               | LL_IDENTIFIER '(' string ')'     { $$.str = $3;
>> $$.typehint = $1; } +               ;
>> +
>
> can't we move template compilation here somehow? e.g. return logtemplate as a ptr?

We can. Turns out that the reason I did it this way, was due to the
filter expressions, but there type-hinting makes little sense, so I
updated the patch in such a way that template_content returns a
LogTemplate as <ptr>, and filter expressions don't support type hinting
anymore.

This did make the code a lot nicer, thanks!

I pushed the new code to feature/3.4/templates/cast-typehints for now,
as this is something I'll likely be poking at during the next few days,
and would need a througher review. So I'm not pushing it to
merge-queue/3.4 yet.

(The updated branch also adds a set of unit tests to guard the hinting &
type casting logic)

-- 
|8]

______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.balabit.com/wiki/syslog-ng-faq


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic