Skip to content

Fix backtick subst in multi-line SCL block args#920

Merged
OverOrion merged 7 commits intoaxoflow:mainfrom
MrAnno:fix-backticksubst-in-args
Jan 22, 2026
Merged

Fix backtick subst in multi-line SCL block args#920
OverOrion merged 7 commits intoaxoflow:mainfrom
MrAnno:fix-backticksubst-in-args

Conversation

@MrAnno
Copy link
Contributor

@MrAnno MrAnno commented Jan 21, 2026

This fixes a bug where global backtick substitution didn't work in SCL arguments in case those arguments were spread across multiple lines.

Reviewers please check if commit cfg-lexer: suspend input subst explicitly for blocks and args is truly an equivalent transformation.

Reproducer (check the output of preprocess-into):

@define bufdir "/tmp/"
@include "scl.conf"

block destination test(disk_buf_opts()) {
  http(disk-buffer(`disk_buf_opts`));
};

log {
  destination {
    test(
      disk_buf_opts( dir("`bufdir`") # works
        capacity-bytes(1M) dir("`bufdir`") # didn't work
        dir("`bufdir`") # didn't work
      )
    );
  };
};

@MrAnno MrAnno requested a review from OverOrion January 21, 2026 14:54
MrAnno added a commit to MrAnno/axosyslog that referenced this pull request Jan 21, 2026
Signed-off-by: László Várady <[email protected]>
@MrAnno MrAnno marked this pull request as draft January 22, 2026 10:57
Copy link
Member

@bazsi bazsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did check if the suspend_input, resume_input patch was equivalent, and I found that all cases where we exit the block state, we call resume, so that's a check.

we now have three ways to lex block and function arguments:

  • block_param: when we are parsing the parameter list for blocks?
  • block_arg: when we are invoking the block and passing the value
  • func_arg: when we are invoking a block in filterx and is more like a function call

These names are not used consistently everywhere, so I'd add some comments, but otherwise I did not find functional issues, great job.

@MrAnno
Copy link
Contributor Author

MrAnno commented Jan 22, 2026

Thank you.

Yes, parameters are for declaration, args are the actual passed values, which we currently have 2 flavors of.

@MrAnno MrAnno marked this pull request as ready for review January 22, 2026 11:32
@bazsi
Copy link
Member

bazsi commented Jan 22, 2026

that's all, I had a 3rd comment, but that was invalid.

It modifies the input, so "filter" is no longer the correct name.

Signed-off-by: László Várady <[email protected]>
This is a refactor (equivalent transformation) and preparation for
fixing a backtick subst bug.

Signed-off-by: László Várady <[email protected]>
This fixes a bug where global backtick substitution didn't work in
SCL arguments in case those arguments were spread across multiple lines.

Signed-off-by: László Várady <[email protected]>
Signed-off-by: László Várady <[email protected]>
@MrAnno MrAnno force-pushed the fix-backticksubst-in-args branch from e400703 to 9a2601d Compare January 22, 2026 13:11
@MrAnno MrAnno force-pushed the fix-backticksubst-in-args branch from 9a2601d to d2eeb66 Compare January 22, 2026 13:15
Copy link
Contributor

@OverOrion OverOrion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, your atomic commits really helped with the review! ⚛️ 🚀

@OverOrion OverOrion merged commit feed475 into axoflow:main Jan 22, 2026
22 checks passed
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.

3 participants