-
Notifications
You must be signed in to change notification settings - Fork 374
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
SUB arguments use-before-define #3555
Comments
Isn't this the case with other symbols too? (backend, acl, anything named) |
exactly. But |
It's actually not true that anything named can be defined after use. It's only true for a subset of the VCL parsing like the With this test case snippet:
I get this:
I think we could generalize "defined after use" for all types that need to be referenced when used via a symbol:
If we agree on doing that, I would implement this special case with a new field in |
This is as far declaring symbols goes, because we can still find hard-coded prefixes in other places. Having them in the types could actually help centralize them for good, but this is a minimal change for the purpose of referencing global symbols before they are defined. Refs varnishcache#3555
A side effect is slightly more accurate error messages. Closes varnishcache#3555
This is as far declaring symbols goes, because we can still find hard-coded prefixes in other places. Having them in the types could actually help centralize them for good, but this is a minimal change for the purpose of referencing global symbols before they are defined. Refs varnishcache#3555
A side effect is slightly more accurate error messages. Closes varnishcache#3555
This is as far declaring symbols goes, because we can still find hard-coded prefixes in other places. Having them in the types could actually help centralize them for good, but this is a minimal change for the purpose of referencing global symbols before they are defined. Refs varnishcache#3555
A side effect is slightly more accurate error messages. Closes varnishcache#3555
This is as far declaring symbols goes, because we can still find hard-coded prefixes in other places. Having them in the types could actually help centralize them for good, but this is a minimal change for the purpose of referencing global symbols before they are defined. Refs #3555
A side effect is slightly more accurate error messages. Closes #3555
to the extent that the match operator ~ will actually accept vmod function/method calls returning it. Because VMODs also need an invalid ACL value to signal error, we stop panicking for a NULL ACL and trigger a VCL failure instead. The use case is not (yet) to generate dynamic ACLs, but rather to store and recall global ACL symbols. This implementation was particularly simple thanks to Dridis work on varnishcache#3555 and VCL_REGEX.
to the extent that the match operator ~ will actually accept vmod function/method calls returning it. Because VMODs also need an invalid ACL value to signal error, we stop panicking for a NULL ACL and trigger a VCL failure instead. The use case is not (yet) to generate dynamic ACLs, but rather to store and recall global ACL symbols. This implementation was particularly simple thanks to Dridis work on #3555 and VCL_REGEX.
SUB arguments currently can only be used after being defined. E.g. this works:
but this does not:
The text was updated successfully, but these errors were encountered: