falco
falco copied to clipboard
Add support for subroutines operating in multiple scopes
The current way we set annotations only allows for subroutines to be used in a single vcl state function.
Fastly is allows that and it also leads to copy-pasting functions with different annotations, which is not a good pattern.
I only implemented them as annotations in the form @<state_name>
instead of supporting them in the
function name because I think it will be weird to have sub foo_recv_miss_deliver
Fixes #84
Signed-off-by: Sotiris Nanopoulos [email protected]
@ysugimoto any chance you can take a look so we can get this on track for being merged :) Thank you!
I would suggest one thing a user also can define multiple scopes by separating commas like @recv,miss, what do you think about it?
I can swap to that instead of multiple lines, that might be cleaner.
re
@scope:
We should open an issue. My only concern is that this is a breaking change so I am not sure if there is a way to make it easier either via tooling or in some other way
The implementation looks so nice, and I would suggest one thing a user also can define multiple scopes by separating commas like @recv,miss, what do you think about it?
Done
@ysugimoto any middle ground solution that I could implement to make this pr better and also maintain backwards compatibility?
@ysugimoto any thoughts on the above?