On Tue, Mar 08, 2022 at 02:36:00PM +0100, Claudio Jeker wrote:
> bgpd's parse.y uses a lot of STRING that is then further bisected in the
> actual rule. One good example are all communities. Now if someone wants to
> use macros in such arguments they do not work in all cases. e.g.
> large-community $someas:1:2 works but large-community 1:$someas:2 does
> not.
> 
> Right now macro expansion only happens at the start of a token but not
> inside a string token. The following diff changes this. It will also
> expand:
> large-community $someas:$otheras:42
> 
> This only works if the macro name ends on a not-allowed-in-macro-name
> character ([^a-zA-Z0-9_]). So while 'descr v4_$name' or 'descr $name-v4'
> works 'descr $name_v4' will not. Also no expansion happens inside quoted
> strings like 'descr "$name-v4"'.

The diff reads ok to me and makes sense, but I'm not super familiar with
yacc, so I'd prefer if someone with better yacc experience could look
over this, especially in view of what should be done in all the other
parse.y.

Reply via email to